Search code examples
c#.netbddnbehave

Any BDD success stories out there?


Having written a small article on BDD, I got questions from people asking whether there are any cases of large-scale use of BDD (and specifically NBehave).

So my question goes to the community: do you have a project that used BDD successfully? If so, what benefits did you get, and what could have been better? Would you do BDD again? Would you recommend it to other people?


Solution

  • We've used somewhat of BDD at the code level in different scenarios (open source and ND projects).

    1. Telling the view in MVC scenario, what kind of input to accept from user (DDD and Rule driven UI Validation in .NET)

      result = view.GetData(
        CustomerIs.Valid, 
        CustomerIs.From(AddressIs.Valid, AddressIs.In(Country.Russia)));
      
    2. Telling the service layer, about the exception handling behavior (ActionPolicy is injected into the decorators):

      var policy = ActionPolicy
        .Handle<WebException>()
        .Retry(3);
      

    Using these approaches has immensely reduced code duplication, made the codebase more stable and flexible. Additionally, it made everything more simple, due to the logical encapsulation of complex details.