C# – What’s the best BDD framework for working with ASP.NET MVC 2 + C# 4

.net-4.0asp.net-mvc-2bddc#-4.0

I just heard about BDD when I watch video of Scott Guthrie in Sweden. One of listener asked question to Scott about How VS2010 and ASP.NET MVC do to support BDD.

After that, I search about BDD (Behavior Driven Development) that focus on specification more than unit testing when compares with TDD (Test Driven Development). I found some framework that work with Ruby and Java. But I do not any famous framework for .NET.

Please suggest me about BDD framework and summary PROs/CONs of it.

PS. Suggested BDD framework must work great on .NET 4, C# 4.0 and ASP.NET MVC 2.

Thanks,

Best Answer

I see this question already has an answer, and I have not tried NBehave. But, we are using MSpec (Machine.Specifications) for this fairly large Enterprise project and it is working quite well for us here. Very well worth mentioning.

Rob Conery did an EXCELLENT video on Learning BDD, where he uses MSpec, line by line: (link removed, no longer available, but search for it)

More about MSpec from Rob Conery, and why he uses it.
http://wekeroad.com/2009/09/21/make-bdd-your-bff-2/ You might also want to check out his other posts tagged BDD as well.

Pros:

  • Allows for quickly "stubbing" of your entire Story, Scenerios, Contexts, and Specifications - without any actual code. Let's you focus on the overall "Behaviors", which is the purpose of BDD!, without worry about code and making it compile.
  • Produces an EXCELLENT HTML report, with "<- NOT IMPLEMENTED" next to stubbed specifications. I often hand this report to: The Client (CEO and CTO), The Testers, New Resources I bring onto the project, and anyone else that wants to know how the software works - without me having to show a line of code!
  • TestDriven.NET runners are included with MSpec using the new tdnet linking (no setup!).
  • The [Behaviors] attribute, along with its Behaves_like delegate type, makes copying existing specifications from one scenerio over to other another scenerio a snap.

Cons:

  • Little to no documentation, even though not much is needed (watch the videos above). The author recently blogged for help on documenting.
  • Still new, and just a side-project from the author (not his main gig). But, it is very active as of this post.

Hope that helps.

Related Topic