MSpec (aka Machine.Specifications)
What is BDD?
http://www.code-magazine.com/article.aspx?quickid=0805061
Where do I find MSpec?
http://github.com/machine/machine.specifications
Why use MSpec?
MSpec helps guide you toward a BDD style of unit testing. MSpec is useful primarily at the unit test level and in a TDD workflow, though it can be used for acceptance-level testing as well.
You can write BDD-style unit tests in any test framework, but MSpec is concise, elegant, and drives you toward the "pit of success". A quick compare/contrast can be found here: http://blogs.msdn.com/elee/archive/2010/02/04/mspec-is-fantastic.aspx
How do I use MSpec?
Here are some blog posts to get you started:
http://elegantcode.com/2010/02/19/getting-started-with-machine-specifications-mspec/
http://elegantcode.com/2010/02/26/behaviors-with-mspec/
http://elegantcode.com/2010/03/01/an-evolution-of-test-specification-styles-my-journey-to-mspec/
You can also look at a personal project of mine on GitHub that has some real-world usage examples. This is a work-in-progress and not everything in it is guarenteed to be correct, but it's more than a contrived example:
http://github.com/SaintGimp/GenesisEngine
How do I get MSpec to play nicely with Resharper?
http://codebetter.com/blogs/aaron.jensen/archive/2008/10/19/getting-resharper-and-vs-to-play-nice-with-mspec.aspx
I hate typing boxcar-style identifiers!
PascalCasing works too, or you can use one of several published VS macros that convert spaces to underscores for you, like this one:
http://blogs.msdn.com/elee/archive/2010/02/28/my-bdd-naming-macro.aspx
Comments (0)
You don't have permission to comment on this page.