How I’m Growing Object-Oriented Software, Guided by Tests
Posted by Graeme | Posted in Development | Posted on 08-02-2010
6
Growing Object-Oriented Software, Guided by Tests (that’s #goos on Twitter) by Steve Freeman and Nat Pryce is a book about test-driven development. Here are a few notes on my experiences of following its methods.
The Story So Far
I was fortunate enough to start work on a new desktop application in the middle of last year, around the time I read through the freely-available online version of the book before it was finally published in November. This was an ideal opportunity to put TDD into practice so I started by building a “walking skeleton” using Prism, CruiseControl.NET, WiX, Gallio, MbUnit, NCover and White as a wrapper around UI Automation for the acceptance tests, and took it from there.
I’ll admit that there was a slow start (WPF/Prism and White/UI Automation were new to me too) but development speed has been steadily increasing ever since, and now I’m able to get what feels like a lot done each day. And that’s pretty much every day; it’s been a long time since I’ve had to halt progress for a significant amount of time in order to squash a bug or redo a chunk of work.
Where am I now?
I’m still learning. It’s easy to slip back into changing code then updating the tests to match, and I do find myself doing that sometimes. I’m also finding it hard to perform only one refactoring step at a time (oh, let me just rename that class while I’m here…), and the acceptance tests can be brittle and sometimes feel like a burden to write. But what doesn’t kill you makes you stronger, right? It’s getting noticeably easier as I learn and improve, and every bit of pain along the way has been worth it.
Does it work?
For me, yes. Test-driven development feels so right that I don’t think I could ever go back to hacking stuff together without building the safety net of tests to fall back on as I go. I am sure that my design is much better than anything I have produced before, and that I have far fewer bugs than usual, too
So this experience has been nothing short of (professional) life-changing. I have read similar stuff before, but GOOS was the one that finally made me “get it.”

I’m reading GOOS at the moment, and really loving it. Nice to hear a positive story from someone in the Real World trying this stuff out. Thanks for sharing.
Thanks for the comments. Things do tend to go slowly at the beginning because writing the test flushes out so many issues, but then everything’s in place to make progress.
Spread the word
I’ve been meaning to buy this book after seeing a few people enthuse about it on twitter. Thanks for the review.
Also, never heard of White before. It looks pretty slick and it might solve some problems we have at work
I soon moved away from White because it was incomplete at the time, which meant that I had to use the AutomationElements directly in some cases. This turned out to be just as easy as using White
Nifty!
I would be interested in your experience writing acceptance tests with White such as patterns you have developed. Specifically, I may be writing a bunch of acceptance tests in the near future for Gallio’s Visual Studio and ReSharper extensions.
@Jeff – Great idea! As I said, I soon stopped using White and used the UI Automation stuff directly which turned out to be just as easy, and far more complete. I don’t know if White has improved since then.
As for specific patterns, my tests are still very much a work in progress but I suppose a couple are starting to appear. Maybe I should do a blog post on that, but I’m getting a backlog already…