A regression is a defect in which a feature that previously worked stops working as intended after an event, usually a code modification. Regression and software bug are interchangeable terms. section 1.2
Changes increase codebase disorder, so regressions can accumulate as features are added or code is refactored. Unit tests act as a safety net by checking that existing functionality continues to work. section 1.2 section 1.6
Regression prevention depends on the quality and value of the test suite:
- Good tests increase confidence during refactoring and feature development. section 1.6
- Bad tests or no tests can still lead to stagnation and repeated regressions. section 1.6
- Coverage can reveal trouble, but high coverage does not prove that regressions will be caught. section 1.6
After a refactoring change
A previously working feature behaves incorrectly after refactoring. Tests that verify the existing behavior expose the regression before the change reaches a later release. section 1.2 section 1.6
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.
The project-growth comparison illustrates why tests help prevent regressions from turning ongoing development into stagnation. section 1.2




