Echoes from the Stone Age
Anyone who continues to think that TDD slows you down is living in the stone age. Sorry, that’s just the truth. TDD does not slow you down, it speeds you up.
…
I completely and utterly reject the notion that ignorance is the best defense. I reject that lack of skill can ever be an advantage.
…
Em TDD Derangement Syndrome, a parte mais interessante é quando ele aponta algumas pesquisas feitas sobre TDD:
We found that test-first students on average wrote more tests and, in turn, students who wrote more tests tended to be more productive. We also observed that the minimum quality increased linearly with the number of programmer tests, independent of the development strategy employed.
…
* 87.5% of developers reported better requirements understanding.
* 95.8% of developers reported reduced debugging efforts.
* 78% of developers reported TDD improved overall productivity.
* 50% of developers found that it decreased overall development time.
* 92% of developers felt that TDD yielded high-quality code.
* 79% of developers believed TDD promoted simpler design.
Em TDD Triage, ele estrutura o artigo na forma de questões:
- Is TDD a replacement for architecture?
- Is TDD a replacement for design?
- Should TDD be used for every line of code?
- Well, if you are going to write some tests afterwards, why not write all tests afterwards?
- Given that we accept the need for tests, why the resistance to test-first?
- Wouldn’t it be faster without such high test coverage?
Mais: “TDD does not slow you down, it speeds you up”
Verdade, e isto deve ser sempre buscado. Se você pede mais tempo para escrever os testes, verifique se você está usando as técnicas direito, pois o oposto deveria ocorrer: você terminou seu trabalho mais cedo porque usou TDD. E lembrando que terminar é deixar o negócio funcionando direito, e não de qualquer jeito! Ou como ironiza o Kent Beck: “If it doesn’t have to work, I can get it done a lot faster!”
Só de não ter que ficar fazendo deploy e entrando com dados num navegador… putz! Ajuda demais! Fora respostas rápidas para o “será que eu quebrei algo?”
Mas verifique o contexto: não é sempre que TDD ou mesmo testes automatizados se aplicam bem. Ou, pelo menos, selecione cuidadosamente quais técnicas são apropriadas para cada situação. Avaliar isso é difícil antes e fácil depois: ajudou ou não?