In this article, Mark Levison addresses the difficulties encountered by developers willing to adopt TDD, the reasons why many start using TDD but give up after a short period of time, and what could be done to help developers make TDD a habit.
Read: Making TDD Stick: Problems and Solutions for Adopters
By doing a survey among developers, Mark noticed that:
- People find it hard to TDD on their own, when they don't have much experience with it.
- TDD Education so far has focused too much on problems that are simpler than the real world.
- More time is needed to experiment and try without the usual pressure of releasing software at a specific date.
- Languages used in the real world, like Visual Basic and JavaScript, are never used as examples in unit test documentation or classroom exercises.
- The average code base is full of legacy code and no training was provided in how to improve this code.
- There is never enough time to learn – there is always (artificial) pressure to ship product soon, and so we can't take the time to improve.
After discussing the reasons behind his survey findings, Mark proposes several solutions:
- Classroom Training
- Online Training
- Patience
- Measure
- Instill Pride
- Management
- Pair Programming
- Community
- Coding Dojo
- Reading Workshops
- Periodic visits from a Coach
In order to make TDD a habit, Mark’s conclusion is that the developers need patience, practice, support from their management, a multipronged approach and their colleagues’ help.