I don’t do TDD

It’s time to be honest. Hands up who truly writes tests before code all the time? I know I don’t and I bet you don’t either. Has the sky fallen? Nope. So why have I spent so many years attempting to live up to the expectations and ideals of community voices who make me feel somehow inadequate because I can’t quite achieve the standards they strongly advocate and appear to live by themselves? I don’t have an answer as to why, other than me falsely believing that “they” know it all whilst I’m a mere mortal who knows sweet F.A. Well, that time is gone. Anyone who preaches a point of view to the exclusion of all others is as of now deleted from my twitter and RSS feeds because I don’t want their dogmatic mantra negatively impacting my self belief. The job is hard enough without trying to live up to some meaningless ideal.

So, I don’t do TDD, but I do write tests when they add value for me. I also write integration tests, again, because they add value. I use my many years of experience to make a judgement call as to when I test and what I test and it hasn’t let me down yet. In fact, these last couple of years I’m happier than I’ve ever been with the code I’ve been writing and the architectural styles I’ve adopted and yet that has coincided with me backing off from the dogmatic TDD mantra. On the other hand, I gladly acknowledge the part that the TDD movement has played in my ability to write good clean, naturally testable code over the pre-TDD years that I was a developer. It certainly has value in as far as teaching people to think about the design of their code (and I know people who could certainly benefit from it in that way) but then, so do other principles and heuristics such as SOLID and design patterns but we only use these when appropriate and do not try and stuff them in wherever we can.

Although it looks like I’m attacking TDD here, what I’m really saying isn’t about TDD as such and whether or not it’s good or bad. It could apply to many other aspects of software development where certain “authorities” try and make us feel like we’re somehow inadequate if we don’t do it their way. I’d have more respect if they didn’t then try to sell us hours worth of video footage, milking all they can from their expertise. If it (whatever it happens to be) works for you then great. We all have favourite techniques that we’re more inclined to adopt but don’t become one of the religious zealots trying to shove it down everyone else’s throat. It leaves a bad taste and turns people into old cynics like me. More pragmatism, less dogma please.

I don’t do TDD