Search The Blog
About this site

@RoyOsherove

Subscribe!

This site aims to connect all the dots of my online activities - from tools, books blogs and twitter accounts, to upcoming conferences, engagements and user group talks.

from 5whys.com
Twitter: @RoyOsherove
My Book: The Art of Unit Testing
Latest Posts
« See you at Agile Israel today! | Main | ORMappers.Com is open for business (sort of) »
Wednesday
Jun282006

NSPec - The evolution of unit tests into behavior description?

Get ready for another naming storm. This time it's going to be "Behavior Driven Development". The most important thing coming out of the BDD "movement" thee days is NSpec - a framework and specification for writing Behavior Verification code (Think Unit Tests with a clearer syntax that explains what you're *really* doing).

Here's a code sample using NSpec:

 

 

              [Specification]
                public void BooleanSpecificationExample()
                {
                        // ...Some set up code...
                        Specify.That( someObj.SomeMethod() ).ShouldBeFalse();
                        // Or...
                        Specify.That( someObj.SomeOtherMethod() ).ShouldBeTrue();
                }

 

Does feels pretty nice, but I think there's along way to go before this start feeling like something I would use for my production code. Still, I think this is an interesting direction to go, but the real development would be to make these behaviors possibly written by the customer for specific scenarios, and the developer for other scenarios - one system that handles both cases.

Not that the customer should write code, but they can write in a laungage that can be transformed into such code. With this syntax it's possible.

Still - this is a long way away, and right now, NSPec looks awful promising.

 

[via larkware]

 

 

PrintView Printer Friendly Version

Reader Comments

There are no comments for this journal entry. To create a new comment, use the form below.

PostPost a New Comment

Enter your information below to add a new comment.

My response is on my own website »
Author Email (optional):
Author URL (optional):
Post:
 
Some HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>