TDD and legacy code

· January 14, 2010

I have been doing some presentations on TDD and one thing that always happens is that you get some tricky questions in the beginning of the presentation.

As you’re introducing a new concept, it of course starts very small and easy, but most people directly try to put it into their context, their normal situation.

And let’s admit it – there are not very often cases where we start off in a void, aka. a green field project. No – it’s mostly brown field – there is always code that exists that needs to be handled. What’s worse – that code is not written to be tested – Not Designed for Testability.

I think this is a very interesting subject and it touches on other subjects that I’m interested in surrounding why it’s worth “clean up your room” (as Uncle Bob would have put it…)

There’s a lot written on this subject, most notably and my next read, Michael Feathers Working Effectively with Legacy Code.

But from my good friend Calle Lindelöf, I’ve got a tip for two great articles by David Laribee. Here you go, thank you Calle:

Twitter, Facebook