Archive for July, 2008

StoryQ: BDD / Acceptance Testing with a little help from LINQ

24 Jul
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.

Posted in StoryQ


All about me

11 Jul
Hello, world! My name is Robert Fonseca-Ensor. I'm a software developer at Datacom Systems Limited, in Auckland, New Zealand. I'm planning to use this blog to post technical tips & tricks as I come across them. I love learning about the neat & new ways you can get software to do stuff. I like to see elegant code, and I like to see clever hacks. My own approach to building good code is that the less lines you have to read, the easier it will be to pick up what's going on. I can think of a few exceptions to this rule, but I try to stay away from the really gnarly one liners (when I can help it). Technology wise, I do most of my work with Microsoft .NET. I've traditionally spent a lot of time building simple aspx websites and winforms clients, but now I'm really interesting in WPF, Silverlight and REST. Time for some interesting links: Martin Fowler talks about how to make http caching work for you in the case where you have a page with a little bit of dynamic content. I'm surprised at how many websites simply can't be cached - people could save a lot of money, not to mention making their websites faster! Speaking of faster websites, it's interesting to hear what Rowan Simpson has to say: "In other words, people would use Trade Me more if it was faster still." When I was playing with Deep Zoom and Ben's iPhone, it really hit me that I enjoyed the user interfaces because of how reactive they were. I thought the couple who run the sparkling client podcast were a bit nuts when they talked about how our caveman instincts demand instant animations from user interfaces - but maybe they've got a point. Hence my interest in all things RIA! If you want a deep dive on WPF, I recommend looking at Scott's BabySmash. It's an app that started out pretty naive, and lots of WPF gods have improved it, with comments & reasons all over the internet.

Posted in Me