My first ever “write” operation to the Open Source community just happened! Todd (who I am working with at Datacom) was really keen to start using NBehave. He wanted to provide our clients with more visibility of what features were implemented / broken in each release. Because we were releasing every time someone checked in some code, it was pretty important to automate this.
NBehave, much like ruby’s rspec, is a great framework for making user stories executable within your IDE. Outside of your IDE, you’ve got things like Fitnesse, ZiBreve, and Twist - which are better if you want non technical people to be able to interactively define storys. On our project, however, we had technical people putting the acceptance tests into our Nunit project. Now, NBehave is written as an extension to NUnit, so i guess you could say they are compatible, but NBehave wasn’t compatible with the two NUnit runners that we were using all the time. Our developers used the superb Resharper test unit runner as they coded, and our build server (TeamCity, damn you JetBrains!) both wanted to run plain old NUnit.Framework.TestAttribute Tests.
So we set out to create a simple framework for running things that looked like story tests from within any test framework. StoryQ is what Todd & I came up with. The key points of difference from NBehave are:
- No dependency on any particular unit testing framework (although StoryQ does like to know what kind of Inconclusive / Pending exception your framework uses)
- StoryQ can use Lambda Expressions to make a sentence-like string out of a method call. This might not sound like much, but it actually takes away a lot of duplication pain. Thanks, LINQ!
- When you run a brand new story test, it will be marked as pending (not failed).
- By default, StoryQ output goes to Console.Out. You can also make it write a coloured html report to a file.
- There is a GUI in the project that can convert from plain text into test case code.
We’ve tried to keep it all very simple and lightweight. If you feel like your current acceptance testing framework is too clunky, or if any of the benefits above sound good to you, then please grab the code and check out the samples. There’s an explanation up on the project homepage. We are very keen for feedback: issues, comments, feature requests, contributors – please don’t hold back.