Show me your tests

Cedric has a good post about Agilists ( is that a word? ) over at his blog.

I am often troubled at how “pure” TDD’ers are when it comes to examples and explanations of TDD. Not that I dislike TDD, in fact, I’m a huge proponent of it. It’s just that people get tired of hearing “Well, if you started with TDD, you wouldn’t have problem X”.

Using TDD is an interesting Catch-22: It stands for Test-DRIVEN-Development, but how to you apply it an existing code base. Something that can only be used on greenfield projects is next to useless.

At previous co-worker once asked me if I was doing TDD at my current job. I responded with what I consider is the only route to TDD within an existing organization: “First come the unit tests, then comes TDD”. Since TDD is such a huge leap in thinking for many people, I think it makes sense to start with aggressive unit testing. Then, and only then, will people see the value of tests and be willing to embrace TDD. If you start out hating anything that isn’t done with TDD, you’ll make few friends and you won’t get much done.

It reminds me of the old SNL skit with Mike Meyers, who’s character runs the Scottish store. After all, “If it’s not Scottish, IT’S CRAP!”

Somehow, if they’re not careful, people who expouse “If it’s not TDD, it’s USELESS” will find themselves a curmudgeon just like the scottish store owner.