The right rule for the job
I recently stumbled upon an article called “10 Reasons to Avoid Test Driven Development”, and reading that article made me sad. But probably not for the reason you think.
Test-driven development is nice, but I am not a TDD fanatic who scolds at the thought that TDD might not be the perfect solution to every problem. Instead, I am a neutrality fanatic who scolds whenever a methodology, any methodology, is presented as a miracle solution applicable to every situation.
Yet despite its title, this is exactly what the "10 Reasons to Avoid Test Driven Development" article presents.
To summarize, the author lists 10 situations in which TDD would not be beneficial. Those situations are intentionally silly, ranging from "when your QA team works faster than a regression suite" to "when your client likes bugs". While written tongue-in-cheek, the purpose of the article is clearly to show that the situations in which TDD would not be beneficial don't actually occur in the real world.
That some people believe that their favorite methodology works in every possible situation is nothing new, and I am not going to react to every single article expressing such an opinion. What makes me sad about this particular article is that in this satirical form, the author ends up writing down, word for word, "TDD is not a silver bullet", while meaning the exact opposite.
TDD at Spiria
TDD is not a silver bullet. Agile is not a silver bullet. Nothing is! At Spiria, we believe in both TDD and Agility, but not all of our projects follow those two methodologies.
I would love to tell you that this is because we figured out the circumstances which determine when TDD is beneficial and when it isn't, but that's not quite how it works here. Some Spiria employees believe in TDD, some don't, and each team has the freedom and the responsibility to decide, in collaboration with the client, how to best approach the problem at hand. Employees are trusted to make their own decisions, and it feels great!
The real Top 10 list
Personally, if I had as many clients and projects as Spiria does, I would experiment with different approaches, measure the results, and obtain a real list of "10 circumstances in which TDD won't work (with high probability)".
Unfortunately, I don't have the data required to present you with such a list, and I doubt I will have the opportunity to collect it anytime soon. I am sure I could come up with a clever-sounding list of circumstances for which TDD doesn't look like a great match, but will I waste your brain space with a list which isn't backed by hard data?
In a future post, sure, why not! :)