DEV Community

Discussion on: Does Test Driven Development Work?

Collapse
 
hamsterasesino profile image
Gabriel • Edited

The problem of TDD is that it requires a lot of mental strength and a solid development process to keep alive.

Developers will throw it out of the board as soon as their managers start breathing at their necks.

On top of this, it takes one dev getting away with poor testing for the whole team to cheat around the unit testing part as well, making it useless (actually, worse than useless, because they need to be maintained).

Edit - disclaimer: I do like TDD, although I think that the usefulness of it is not in having those unit tests in the first place but in forcing you to design your code better so it is testable, understandable, and with less redundant / complex parts.

Collapse
 
ruarfff profile image
Ruairí O'Brien

That is all true. I find working in that scenario really taxing.

I have found developing a culture of automated testing can be really difficult but also really beneficial to a team though. I have seen teams that don't write tests at all, exhibiting much of the symptoms you mentioned, then transform into a team that really love testing.

I absolutely agree on the point of TDD leading to better design. I found when a team embraces TDD or at least good automated testing, pull request become a much more rewarding process and things like mob and pair programming become a lot more pleasurable and less exhausting. The conversation becomes about the best design and other real concerns.

It's a huge challenge to transform a team that does not embrace testing into one that does but if it can be done, it seems to be worth it.