A joint post by Llewellyn Falco and Michael Kennedy
[Update: Get the videos and additional downloads for this webcast.]
As a follow-up to our “Avoiding 5 Common Pitfalls in Unit Testing” article we did a webcast where we took a problem from the audience and solved it live and unrehearsed on stage. These kinds of performances are always a risk but that’s part of what makes them fun.
Of course, the question is could we have done it better? Here’s your chance to try it for yourself (details below).
Our viewers chose to have us build the game Space Invaders. The first thing we had to do to sketch out a basic scenario we could implement. We started with a picture to remind what Space Invaders even was:
This was too big of a scenario for us to tackle in the allotted 40 minutes for programming. So then we started by creating a simpler scenario which we sketched out on the “whiteboard”:
This post describes a unit testing library for testing Windows Workflow Foundations.It is not a framework like HarnessIt, NUnit, or MsTest. Rather it’s a library that can be used in conjunction with any of these testing frameworks.
Download the library with sample test project here:
Kennedy.WorkflowTesting.zip (216 KB)
You can also just jump to the code.
First a Little History:
Last September I posted this teaser entitled Unit Testing Coming to a Workflow Near You. My intention was to post this article that you’re reading now shortly thereafter when I got some free time to polish things up. In that previous post, I highlighted what I could determine to be the current state-of-the-art with regard to unit testing workflows, circa September 2008.
So my buddies Dan Gilkerson and Llewellyn Falco have been doing some brilliant, ground breaking work on advancing the state of unit testing and TDD with a concept they call Approval Testing.
To highlight the transition from
unit testing -> TDD -> BDD -> Approval Testing
Dan wrote a parody of the song Let It Be.
The Music Video: Let it BBD
I’m pleased to announce that MSDN Magazine just published my Windows Workflow article entitled
“ASP.NET WORKFLOW: Web Apps That Support Long-Running Operations”
I hope you find it useful and interesting.
[Update: See the follow up post "Significant Advances in Unit Testing Windows Workflow"]
If you’ve been working with Windows Workflow, you’ll find it has some cool features for orchestration, long running operations, state machines, etc.
However you won’t find very much support for Test Driven Development (TDD) or unit testing in general. In fact the architecture that makes Windows Workflow powerful (strict separation of workflow, activities, and the host for example) really gets in the way of unit tests.
There has been some work done on unit testing Windows Workflows. Here’s some links:
These are all very creative solutions. But, personally I find all of them more complex than they need to be. So in the near future I’ll be putting together some libraries and samples on unit testing Windows Workflow. I think you’ll find them far more powerful and at the same time simpler than anything out there.
So until I get that finished, if you have any feedback or considerations on unit testing Windows Workflow I’d love to hear it. If there are other articles I’m missing, please post them in the comments.
I think you’re going to like this…