One of the most common question I encounter is how to start with TDD. Usually the questions is formed as how do I get my team to pick up TDD.
There are many answers to this, and in fact it really depends on the specific context (more on this later) but one thing I do know.
You don’t need the entire team
A popular mistake is to think that a lone developer can’t do TDD and you need entire team do it together. This contradict the fact that TDD is a solitary practice i.e. you can do it all by yourself. Think about it, don’t you write code alone? TDD is a development methodology, its an exercise in producing high quality code, in that aspect its not different then doing low level design or writing clean code.
Do you need the rest of your team to design properly in order to produce good design (of your parts)?
Naturally the effect a single developer has is limited and will probably won’t go beyond his code, however doing TDD even if done alone will allow for his code to be better (and most likely faster). Of course its better to have the entire team do TDD. It’s usually easier and will increase quality of the entire product, but there is no reason to wait for everyone to realize that, is there?
So where to we start?
like always the answer is, “It depends…"
but more on this later