Video in progress

Staff 🧪 Testing

What metrics do you use to watch the health of the test suite at the organization level?

The main four: PR feedback time (p50/p90), the share and number of flaky tests, incidents that reached prod because of regressions (escaped defects), and the share of bugs that tests caught. Coverage is supporting context, not a goal.

📖 Answer

I treat the test suite as an internal product whose customers are the developers. The metrics should answer two questions: how fast and reliably it answers the developer, and how well it protects prod.

Metric What it shows Signal
PR test time p90 feedback speed above 10-15 minutes, people switch context
Flaky rate (failures that passed on rerun / total) trust above 1-2%, people stop paying attention to a red build
Escaped defects protection bugs in prod marked "a test could have caught this"
Change failure rate (DORA) overall outcome how many releases needed a rollback/hotfix
Quarantines without an owner discipline the number of quarantines past their deadline

Data sources: CI's JUnit XML reports collected into one store (Develocity, Allure TestOps or your own plain table), and postmortem tags in the incident tracker.

A few warnings:

  • don't use the metrics to compare teams: a "game" starts immediately (deleting flaky tests to lower the rate);
  • the trend matters more than the absolute value: if CI time grows 8% every month, action is needed even if it's 9 minutes now;
  • classifying escaped defects is manual and subjective; I standardize it with a specific question in the postmortem template.

Every quarter, a 30-minute review with the teams: the 10 slowest tests, the 10 flakiest tests, the latest escaped defects. That alone often uncovers the biggest problems.