Fast feedback measures how quickly a test executes and reports whether the tested behavior meets expectations. Faster tests shorten the feedback loop, allowing developers to run more tests more often and notice broken behavior soon after introducing it. section 4.3 section 4.6
Speed affects cost as well as convenience. Slow tests discourage frequent execution, prolong the time bugs remain unnoticed, and increase the cost of correcting work built on a wrong direction. section 4.3
Treat fast feedback as one dimension of test value, not as an isolated target:
- Balance execution speed against protection against regressions; maximizing both is impossible. section 4.4
- Preserve maintainability while pursuing speed, including readable tests and few operational out-of-process dependencies. section 4.3 section 4.6
- Keep every attribute above zero because test value depends on the combination of regression protection, refactoring resistance, speed, and maintainability. section 4.4
- Prefer a test pyramid in which unit tests are the majority, integration tests occupy the middle, and end-to-end tests remain a minority. section 4.5
Choosing the faster layer
Use unit tests for broad, frequent feedback when their behavior-based checks provide sufficient protection. Reserve end-to-end tests for critical functionality that cannot receive the same protection from unit or integration tests, because end-to-end tests execute slowly and require more maintenance. section 4.5
Figure 4.12. Different types of tests in the pyramid make different choices between fast feedback and protection against regressions. End-to-end tests favor protection against regressions, unit tests emphasize fast feedback, and integration tests lie in the middle.
Compare how unit, integration, and end-to-end tests trade fast feedback against protection against regressions. section 4.5
