NSpec – BDD comes to the .Net world

I saw this this morning –> http://nspec.tigris.org/


If you haven’t seen it before, think of Behavior Driven Development as a refined version of TDD.  Most of the writings on BDD I’ve seen so far are geared towards Ruby and other dynamic languages.  I honestly didn’t think this was going to be possible in a static language.  I’m definitely going to give NSpec a spin soon.

About Jeremy Miller

Jeremy is the Chief Software Architect at Dovetail Software, the coolest ISV in Austin. Jeremy began his IT career writing "Shadow IT" applications to automate his engineering documentation, then wandered into software development because it looked like more fun. Jeremy is the author of the open source StructureMap tool for Dependency Injection with .Net, StoryTeller for supercharged acceptance testing in .Net, and one of the principal developers behind FubuMVC. Jeremy's thoughts on all things software can be found at The Shade Tree Developer at http://codebetter.com/jeremymiller.
This entry was posted in Uncategorized. Bookmark the permalink. Follow any comments here with the RSS feed for this post.
  • http://code.google.com/p/artspec/ robert

    NSpec just created extension methods to provide better syntax for validation but real BDD comes with ArtSpec

  • neil martin

    Intent is so importent , your code is driven form your intent these frameworks help you align you rin tent and hence your code with the storys and acceptance criteria.

  • http://garth.wi.llia.ms Garth

    You should check out rbehave http://dannorth.net/2007/06/introducing-rbehave, this is I think how BDD should be implemented and Agile Joe has been trying to port it over to .NET take a look at his recent post http://www.lostechies.com/blogs/joe_ocampo/archive/2007/06/28/introducing-nunit-behave-or-insert-what-ever-other-catchy-name.aspx

  • Greg

    I have used spec# on a few apps already. Wonderful does not begin to describe it.

  • http://flimflan.com/blog Joshua Flanagan

    It is my impression that it IS just a syntax change from NUnit, but that should be no reason to dismiss it. I think they make a compelling argument in the short introduction on the main page (bullet #2 really hit home). Something to keep an eye on…

  • Sachin Rao

    Funny, ‘cuz I’ve always thought too many attributes make code harder to read. :)

    I’m not sure if extending method signatures qualifies as defensive coding. Spec# or any such product would be, after all, just a language extension.

    Anyways, would be interesting to know how NSpec complements an existing unit testing framework.

  • jmiller

    I’ve never thought that DBC goes far enough, but I’ve always wished MS was add DBC to .Net through declarative attributes. I hate the way copious amounts of defensive coding makes code harder to read.

  • Sachin Rao

    Jeremy,

    I haven’t read much about BDD, so I must admit I’m unsure of its purpose. Having said that, I always thought a Design By Contract framework in conjunction with TDD would be a great way of providing specifications and defining behaviour:

    http://research.microsoft.com/specsharp/

    I’m kinda hoping this comes out in the mainstream soon.

    Sachin

  • Tony

    Aaron beat me to the punch, but I was wondering the same thing.

    When I first heard about BDD at behaviour-driven.org, BDD seemed to be much more. This might be a result of the imaturity of the NSpec project, but the example that they present seems to be a dolled up unit test (or it could be a result of my ignorance on BDD).

    Jeremy, I’d love to read more about it if you do get a chance to get some info at No Fluff, Just Stuff.

    Also, I didn’t know about RSpec as I’m just now starting to learn Ruby. I’ll have to take a look at that as well.

  • jmiller

    Aaron,

    I don’t know yet. I’ve only read enough to be interested. I think I’ll get a chance to see some of it at No Fluff, Just Stuff in Austin soon. I’ve been meaning to play with RSpec in Ruby to try it out, but haven’t gotten around to it.

    Jeremy

  • Aaron

    Does this (or any) BDD framework actually have any functional difference from NUnit (or your favorite unit testing framework), or is it simply a syntax change to make it “feel” more like you’re writing specifications instead of tests?