September 30, 2008

...Learn TDD with Codemanship

New XP Practice: "Actually Doing It"

Project after project, team after team. There's one constant factor that I come across over and over again when I work with teams who are doing Agile Software Development.

Which is: they're not. Not really.

No more prevelant is this than with the hugley popular, but - it transpires - rarely actually practiced, Test-driven Development.

Shockingly, even experienced Agile coaches have a tendency to let things slip when they're doing TDD. This is perhaps that infamous "do as I say, not as I do" school of coaching that I keep hearing about.

There are, actually, no excuses. Yes, web applications are harder to unit test, but all you need is a handy facade for your HTTP context and a bit of dependency injection here and there. (But, folks, not everywhere, please - accessing the context should be localised in as few places as possible: ideally just the one.)

XML files (because what else do we put in files these days?) can be hardwired into executables. Inputn and output streams can be faked. And so on.

It is entirely do-able without a huge amount of extra effort to unit test 95%+ of your code. And it's almost as do-able to write all those tests first.

999 times out of a thousand, it's simply a matter of resolving to do it.

So I'm adding an extra Extreme Programming practice called Actually Doing It to remind myself that it's a choice I can make.

No excuses!

Posted 9 years, 9 months ago on September 30, 2008