liveBook · Manning

Fast feedback

As explained in Unit Testing Principles, Practices, and Patterns

Fast feedback is the speed with which a test communicates whether the tested software behavior meets expectations.

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

How Unit Testing Principles, Practices, and Patterns covers it

How deep it goes
Defines execution speed, explains its cost effects, and contrasts test layers without specifying timing thresholds or optimization procedures.
Examples
Uses unit, integration, and end-to-end test layers to illustrate different choices between execution speed and regression protection.
What it assumes
Assumes familiarity with automated test types and teaches their trade-off between execution speed and regression protection.
What you can do after
Evaluate test suites and choose faster test layers while balancing regression protection, refactoring resistance, and maintainability.
How it connects
Connects fast feedback with protection against regressions, resistance to refactoring, maintainability, test pyramids, and test value.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Unit Testing Principles, Practices, and Patterns. The section links point to the parts of the book it draws on.