Code design structures production code so valuable unit tests remain possible and software can grow sustainably. Testability is a useful warning signal, but not proof of quality. section 7.0 section 1.2
Judge design through two different signals:
- Treat difficult unit testing as a negative indicator: it often reveals tight coupling and insufficient decoupling. section 1.2
- Do not treat easy unit testing as a positive guarantee: highly decoupled code can still be poor quality. section 1.2
- Prefer changes that protect against regressions, resist refactoring, provide fast feedback, and remain maintainable. section 7.0
Refactoring code design supports output-based testing and valuable tests across applications, including systems that cannot use a functional architecture. section 7.0
Figure 1.1. The difference in growth dynamics between projects with and without tests. A project without tests has a head start but quickly slows down to the point that it’s hard to make any progress.
Compare growth dynamics: projects without tests gain speed early but can slow into stagnation as software entropy increases. section 1.2
