I’ve been reflecting more on the philosophy and practice of Test Driven Development lately. In truth, I’ve not been writing much code the last few months so I’m renewed in the difficulty of getting back into the mindset of writing tests before code. I’m also renewed in spirit of the importance of following such a practice.
Some things I’ve run across recently that has helped get the thought process going again:
1) Re-reading the book The Productive Programmer and his reference to Ocams Razor. The simplest explanation is usually the correct explanation: If testing is the rigor of software engineering then testing has a huge priority. If testing is the largest priority it means it should be addressed paramount. Hence, write tests first.
2) My favorite modern philosopher (whom, I know, I reference far to often) Nassim Nicholas Taleb of Black Swan fame posted on Facebook something to the effect of “If someone gives you more than one reason for something he doesn’t have a real reason…”
What does this have to do with TDD. Well, see my article from a couple years ago – Wrong About TDD – I have a bunch of reasons. Then I come up with more reasons in TDD: Facts and Fallacies. I’m blue in the face with reasons, hubris and general hot air. I have more reasons than fingers. But, according Taleb’s aphorism all of my reasons mean that I may not have a good one.
Taking into account these two findings about my own thinking I vow to rehash my approach to communicating TDD. Maybe not down to just one reason, but probably no more than two – the weary debater can stack the deck with opposing reasons all they like, a large balloon can still be deflated with one pin prick. The reasons are probably better utilized as excuses someone doesn’t want to change as opposed to why they should.
There is more then sufficient confluence in favor of TDD by now. One should learn and practice TDD if they are care about developing working software.
We all must change. This is what we as humans do – we are born to evolve.