DevCamp: A testing framework for everyday use
Specflow is a testing framework developed by TechTalk and published under the BSD license. As said on the webpage http://specflow.org it “aims at bridging the communication gap between domain experts and developers by binding business readable behavior specifications to the underlying implementation.“ Specflow is highly influenced by the Cucumber framework which is quite obvious.
A picture is worth a thousand words so let us start with a picture first.
At first a test case is written down in plain text. This text can be used to generate a unit test by now Specflow works with nUnit. The usage of MSTest was not covered in the presentation. The syntax of the plain text is quite easy to understand.
- Given – defines the initial state for the unit test
- When – defines the tested situation
- Then – defines the desired outcome
It is possible to use the keywords “or” and “and” to define more complex scenarios than the ones in the picture above. The link between the generated unit test code and the written scenario is established via attributing the test methods. The part of the plain text which is linked to the source code can be defined by the user. Hence it is even possible to reuse the unit test code in another scenario without rewriting it.
Specflow uses the idea of BDD (behavior driven design) and merges it with TDD (test driven development). Due to the fact that it uses good old unit testing frameworks it is quite easy to use it in a project.
But for me the killing feature is the plain text description because the project manager or the requirements engineer or anyone else is able to read and maybe write it too. Therefore the overhead of documentation is getting smaller and there is also less room for misunderstanding between the members of the development team. Yes, even the costumer can read and review the scenarios.
Although I never used it in a project the thought of business readable test cases is quite intriguing. It may not be a silver bullet but the possibilities for continuous integration, less documentation and most important less misunderstandings are quite interesting.
The PowerPoint of the presentation can be viewed and downloaded at http://www.devcamp.at/Archive.aspx.
Related Posts
- NHibernate was blocked (starting my unit test project)
- DevCamp: Komplexe Dateneingabe in Sharepoint für Inhaltstypen
- QA Corner: Microsoft Test and Lab Manager
- Why you should plan to migrate to Visual Studio 2010 already now!
- HSG at Remix
One Response to “DevCamp: A testing framework for everyday use”
Leave a Reply



Thanks for the nice words for SpecFlow.
Just wanted to let you know that support for MSTest will be released very soon.
New releases are announced on:
http://groups.google.com/group/specflow-announcements
Discussions are here:
http://groups.google.com/group/SpecFlow