Defect prevention is an important principle for sustainable development. Practices must be used to catch defects as early as possible, especially via automated means, so that the burden of testing is not placed on people, whether they are QA, a testing group, or customers. One of the most critical practices for sustainable development, ruthless testing, is described in this chapter. Ruthless testing is a challenge to teams to go beyond test-driven development and to build testability into their software. When software has testability built in, then everyone, from developers to QA to customers, benefits. Another critical practice is that of ensuring that someone else looks at your work before it is added to the product. This can either be done via pair programming or code reviews, though pair programming is preferred because problems are caught immediately.
The other principles described in this book reinforce defect prevention. A focus on a working product is important to ensure that the team does not spend all its time fixing broken tests. Likewise, an emphasis on design helps defect prevention because one of the design goals should be building in testability. Also, well-designed software is easier to test because it is well structured with clean interfaces that can be easily identified and tested. Finally, continual refinement supports defect prevention by giving the team a process where it can regularly and frequently review and refine their automated testing coverage and processes.