liveBook · Manning

Accuracy

As explained in Unit Testing Principles, Practices, and Patterns

A metric of how reliably a test suite indicates whether the tested functionality is correct or broken, accounting for false positives and false negatives.

Accuracy measures how reliably a test suite indicates whether functionality is correct or broken. It combines regression protection, which reduces missed bugs, with refactoring resistance, which reduces false alarms. section 4.2 section 4.6

Classify test outcomes by comparing the test result with the functionality’s actual state:

  • True negative: the test passes and the functionality works. section 4.2
  • True positive: the test fails and the functionality is broken. section 4.2
  • False negative: the test passes despite broken functionality; regression protection helps prevent it. section 4.2
  • False positive: the test fails despite correct functionality; implementation coupling often causes it. section 4.6

Prefer tests that verify the system’s observable result rather than its implementation steps. False alarms erode attention and trust, becoming increasingly costly as the project grows. section 4.6

How Unit Testing Principles, Practices, and Patterns covers it

How deep it goes
Defines four test outcomes and connects accuracy to false negatives, false positives, regression protection, and refactoring resistance.
Examples
Uses a four-quadrant test-result classification and a signal-versus-noise model.
What you can do after
Evaluate tests by their ability to find bugs without generating implementation-driven false alarms.
How it connects
Connects protection against regressions and resistance to refactoring with false negatives, false positives, and observable behavior.

Also explained in

Compare how 32 books explain accuracy →

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.