TDD Invades Space Invaders

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).

The Problem:

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”:

Continue reading

Article: Avoiding 5 Common Pitfalls in Unit Testing

Llewellyn Falco and I recently wrote an article for DevelopMentor’s Developments newsletter entitled Avoiding 5 Common Pitfalls in Unit Testing.

You can read it at the DevelopMentor website:

I’ve republished here for my readers. Enjoy!

[Update: We have also done a webcast demonstrating some of these ideas, which we wrote up here:]

Avoiding 5 Common Pitfalls in Unit Testing

by Llewellyn Falco and Michael Kennedy

When I started out with unit tests, I was enthralled with the promise of ease and security that they would bring to my projects. In practice, however, the theory of sustainable software through unit tests started to break down. This difficulty continued to build up, until I finally threw my head back in anger and declared that

“Unit Tests have become more trouble than they are worth.”

So we stopped. Not all once, but over the months our unit tests died a quiet death. When tests would stop working, we just ignored them. When new features were reported, they were developed without unit testing. At first, it seemed great. We were able to move without the baggage of maintaining the old tests! But soon all the original problems of having a system without tests came back to us. Things keep breaking, deadlines were increasingly pushed back. Releases came with an extraordinary amount of stress, late nights & weekends. The final straw came when we were forced to rush out an immediate update, and ended up taking down the company for 2 days straight. Our new motto became:

“Unit Testing: you’re damned if you do, you’re damned if you don’t.”

In the end, we decided that despite the hardship caused by maintaining unit tests, it just wasn’t feasible to operate without them. So we started down the road to re-incorporate testing into our software development process. As the months went by, however, we discovered that the hardships we remembered had not returned. Looking back, we realized that we had made many mistakes the first time around. The second time around we were smarter. So you, too, can enjoy the benefits of unit tests here are the 5 major pitfalls we encountered the first time around, and how you can avoid them.

Continue reading

Significant Advances in Unit Testing Windows Workflow

This post describes a unit testing library for testing Windows Workflow Foundations.It is not a framework like HarnessItNUnit, 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:
(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.
Continue reading

Test Driven Development, Approval Testing, and a Song – Oh Boy!

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

MSDN Magainze: Web Apps That Support Long-Running Operations

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.

Unit Testing Coming to a Workflow Near You

[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…