Quality Metrics and Test Reporting Questions
Defining, computing, and communicating software quality. Covers choosing meaningful quality and test metrics (defect escape rate, defect detection effectiveness, defect density, MTTD/MTTR, pass rate, regression frequency, automation suite health and maintenance cost) versus vanity numbers; baselining, trend interpretation (real change versus normal variation), and alert thresholds; dashboards, weekly stability reports, and release-quality reports for engineering, product, and executive audiences, including composite go/no-go scores; framing unfavourable results; guarding against gamed metrics and reading what numbers such as code coverage or a high pass rate hide; investigating contradictory or shifting metrics and testing whether a quality signal really predicts customer outcomes; metric definitions, ownership, and governance; computing metrics from test-run and bug-tracker data (SQL and scripts); designing test-results reporting pipelines, storage schemas, real-time versus batch reporting, alerting, and failure fingerprinting and grouping for triage; and tying quality signals to product and business outcomes. Deciding what to automate and diagnosing individual flaky tests are covered elsewhere.
What quality and test metrics would you track for a delivery team, and for each one, what does it actually tell you and where can it mislead?
Sample Answer
Direct answer
Track a small balanced set: a few metrics about defects reaching users, a few about how fast and trustworthy the test signal is, and a couple about delivery health. For every metric, write down two things next to it: the decision it informs and the way it lies. A metric you cannot attach a decision to is decoration.
The set, what each tells you, and where it misleads
| Metric | What it tells you | Where it misleads |
|---|---|---|
| Defect escape rate (share of a release's defects found only after release) | How much the test effort is missing before users see it | Falls when customers stop reporting, or when defects get downgraded or never logged. Says nothing about severity unless you split it |
| Test pass rate | Whether the current build is healthy | Rises when tests are deleted, skipped, quarantined (parked outside the blocking set so their failures no longer count), or retried until green (rerun automatically until they happen to pass). A 100% pass rate on a weak suite is comfort, not safety |
| Flaky test rate (tests that pass and fail on the same code) | How much you can trust a red build | Hidden if retries are automatic. High flakiness makes teams ignore real failures |
| Feedback time (push to result) and per-test execution time | How long a developer waits | Averages hide the slow tail (see the worked example) |
| Change failure rate (deployments that cause a failure needing a fix, divided by all deployments) and recovery time (two of the DORA delivery metrics from the DevOps Research and Assessment programme; dora.dev now calls the recovery one failed deployment recovery time, the time to recover from a deployment that fails and needs immediate intervention, which replaced the older MTTR, mean time to restore service, and it also lists a fifth metric, deployment rework rate) | Whether fast delivery is coming at the cost of stability | Small deployments can make the rate look better while impact per failure grows. Averages hide one long outage |
| Open defects by severity and age | Release risk and neglected problems | A low count can mean nobody is looking. Severity labels are subjective |
| Customer-side signals (crash-free sessions, meaning the share of app sessions that end without a crash; support tickets per active user) | Product health as users experience it, the balance to engineering-side numbers | Lags by days or weeks and is affected by usage changes |
Code coverage (the share of code lines that tests execute) is a related signal that is deliberately left out of the table because it measures only whether code was executed, not whether any assertion checked the result (a test with no assertions still raises coverage). Use it as "where we definitely have no tests", never as proof of quality.
Quick numbers for the other rows (illustrative)
- Escape rate: a release has 40 defects logged in total, 30 found before release and 10 found by customers afterwards. Escape rate = 10 / 40 = 25%.
- Pass rate and quarantine: 1,000 tests run, 50 fail, so 950 / 1,000 = 95%. If 30 of the failures are quarantined and excluded, the report shows 950 / 970 = 97.9%. The number rose although nothing was fixed, which is why quarantined counts must be shown beside it.
- Flaky test rate: 12 of 400 tests both passed and failed on the same code this week, so 12 / 400 = 3%.
- Change failure rate: 6 of 40 deployments this month needed a fix or rollback, so 6 / 40 = 15%.
- Crash-free sessions: 9,900 of 10,000 sessions ended without a crash, so 99%. Note that 99% still means 100 crashed sessions.
Worked example: throughput and execution time under parallelism
A suite has 1,200 tests averaging 2 seconds each, so 2,400 seconds of compute. Split across 4 parallel machines (shards) the ideal wall-clock time is 2,400 / 4 = 600 seconds. In practice the shards are uneven: if the slowest takes 900 seconds, the run takes 900 seconds, not 600. Add 5 minutes (300 seconds) waiting in the queue for a free runner and a developer waits 1,200 seconds, 20 minutes, even though "average test time" is still 2 seconds. Retries also distort: if 3% of tests (36) are retried, that adds 36 x 2 = 72 seconds of compute, invisible in the average but visible as extra cost and hidden flakiness. So report feedback time end to end and its 95th percentile (the value 95% of runs come in under), plus retry count, not only average per-test time or tests per hour.
Thresholds and balance
There are no honest universal numbers. Set thresholds against your own baseline and act on direction: escape rate rising two releases in a row, flake rate creeping up, feedback time past what developers will wait for (they start skipping it). Read product and engineering metrics together: fast feedback with rising escapes means the fast tests are the wrong tests; falling escapes with falling customer usage proves nothing.
Gaming and pitfalls
Every row above can be gamed (delete tests, downgrade severity, retry to green). Prefer trends over targets, publish denominators, and never rank individuals with these numbers.
What is a quality metric, and how do you tell a meaningful one from a vanity one? Give examples of each in a release-readiness setting and say how you would validate that a metric is worth tracking.
Sample Answer
Direct answer
A release-readiness setting is the moment a team decides whether a build is fit to ship, and the metrics that feed that decision. A quality metric is a measurement of the product, or of the process that builds it, that helps someone make a decision about quality. A meaningful one changes a decision and is hard to improve without genuinely improving quality. A vanity metric looks impressive, can only trend upward, and nobody would act differently if it moved.
How to tell them apart (four questions)
- Decision test: if this went red, what would we do, and who does it? No answer means vanity.
- Outcome link: does it connect to something users or the business feel (incidents, escapes, churn), or only to activity?
- Gaming test: could a team move it a lot without improving the product?
- Definition test: is the numerator, denominator and time window fixed, so two people compute the same value?
Release-readiness examples
| Vanity | Why | Meaningful | Why |
|---|---|---|---|
| Total number of tests | More tests can be worse tests | Open Sev1 and Sev2 defects at release cut (the moment the release candidate is frozen; severity levels: Sev1 is an outage or data loss, Sev2 a major feature broken) | Directly gates the go or no-go call (the meeting where someone decides ship or hold) |
| Overall pass rate | Barely moves, hides which tests matter | Pass rate of critical-path tests (the tests for flows users must complete, such as sign-in and checkout), with flaky ones (tests that sometimes pass and sometimes fail on the same code) counted separately | Tied to revenue and safety flows |
| Bugs found per tester | Rewards logging, not quality | Defect escape rate per release (defects found after release divided by all defects for that release) | Measures what got past you |
| Test cases executed | Activity, not coverage of risk | Failed deployment recovery time, the time to recover from a release that fails and needs immediate intervention (dora.dev's current name for the metric older material calls time to restore service or MTTR, mean time to restore) | Shows real resilience |
How to validate that a metric is worth tracking
Back-test it (compare the metric's past values with how those releases actually turned out) before adopting it. Illustrative data for four past releases:
| Release | Open Sev1/Sev2 at cut | Pass rate | Incidents after release |
|---|---|---|---|
| R1 | 6 | 97% | 4 |
| R2 | 1 | 98% | 0 |
| R3 | 4 | 99% | 3 |
| R4 | 0 | 98% | 1 |
Pass rate stays between 97% and 99% while incidents range from 0 to 4, so it does not discriminate (it fails to separate good releases from bad ones). Open severe defects orders the releases almost the same way as incidents (ranked worst to best by open severe defects: R1 with 6, R3 with 4, R2 with 1, R4 with 0; ranked by incidents: R1 with 4, R3 with 3, R4 with 1, R2 with 0. Only R2 and R4 swap places), so it is worth keeping. Four points is a sanity check, not statistics, so keep watching it. Then pilot it for two or three releases, confirm the definition is written down, check whether it moved for a real reason when it moved, and retire it if it never changes a decision.
Pitfalls
A metric can be meaningful for one team and vanity for another. Do not add a metric because it is easy to collect, and do not set a target until you know how it behaves.
You must present an unfavourable quality report to stakeholders: escapes have doubled, automation is not improving, and time to fix has grown. How do you frame the conversation to drive action rather than blame, and what do you propose?
Sample Answer
Direct answer
I would open with the shared goal and the evidence, present the three findings as one connected story about how the system let this happen (not about a person), and close with a specific, prioritised plan and a clear request for what I need from the room. I avoid blame by asking what made this the easy outcome, and by never presenting a number without its context.
Terms. A quarantined test is a flaky (unreliable) test moved out of the pass/fail gate so it stops blocking builds, but it also stops protecting you, so a long quarantine list is hidden risk. A red build is a CI run that failed. Time to green is how long a build stays red before it passes again. A triage rota is a rotating duty roster of who investigates failing builds each week. Plateaued means the number has flattened, no longer improving. A release cohort means grouping bugs by the release they shipped in. A sprint is a team's fixed work cycle, often two weeks.
Before the meeting
- Validate the data. Escapes are bugs that reached production. "Escapes doubled" could mean 4 to 8 or 40 to 80, and it matters whether releases doubled too. Example: 4 escapes across 10 releases is 0.4 per release; 8 across 10 is 0.8, a real doubling; 8 across 20 is 0.4 per release, unchanged, so the story would be volume, not quality.
- Pre-wire the owners of the affected areas (talk to them privately beforehand so nobody is surprised in public), and bring one concrete customer-impact example.
The three-number slide (illustrative numbers)
| Measure | Last quarter | This quarter | Reading |
|---|---|---|---|
| Escapes per 10 releases | 4 | 8 | Doubled, same release volume |
| Automated test count | 1,200 | 1,230 | Flat, plateaued |
| Median time to fix (report to fix) | 3 days | 5 days | 67% slower (5 / 3 is about 1.67) |
Add one line of context: 35 tests are quarantined, up from 12, and 22 of them sit on the checkout and payment paths.
Opening (say it plainly)
"Escapes are up, our automation has plateaued, and fixes take longer. I want to show how these connect, agree what to do first, and decide how we will know it is working. This is about how our process behaves, not who is at fault."
The connected story
- Escapes are up because coverage gaps and quarantined tests let defects pass the stages that should catch them.
- Automation is not improving because the team's time goes to keeping existing tests alive, so new coverage is not added.
- Time to fix has grown because failures lack clear owners and take long to triage, so bugs sit longer.
Each link is a hypothesis with evidence I bring, and I say which parts I am unsure about.
Prioritised remediation plan
| Priority | Action | Why first |
|---|---|---|
| 1 | Review every severe escape to find which stage should have caught it, and add a regression test for each fix | Stops the same bug escaping twice; a regression test is one that guards against a specific past bug returning; cheap |
| 2 | Fix or delete quarantined tests on critical paths, with an owner and a deadline for each (target: the 22 critical-path ones resolved within 60 days, total under 15) | Restores trust in the signal |
| 3 | Assign clear owners and a triage rota for red builds (target: median time to green under 2 hours) | Shortens time to fix |
| 4 | Automate the highest-risk paths that currently rely on manual checks | Raises real coverage |
What I ask the room for: protected time for priority 1 to 3 (for example a fixed share of each team's sprint), and one named sponsor for owners of red builds.
How progress is measured
- Leading indicators (visible in weeks): number and age of quarantined tests, time to green after a red build, share of severe escapes with a regression test.
- Lagging indicators (visible in months): escapes per release, counted by release cohort, and time from report to fix.
- A 30, 60 and 90 day review, reported even when the numbers are bad. Expect escapes to lag the leading measures.
Handling pushback
If someone says "QA should catch this", I respond that testing is one stage of several, and show the escape review data. If someone wants a single culprit, I redirect to what change would prevent a repeat.
Trade-offs and pitfalls
- Overpromising a quick recovery destroys credibility. Promise the leading indicators and the review cadence.
- A plan with ten priorities is a plan with none. Lead with the first two, and keep the rest visible but not funded yet.
- If leaders will not protect any capacity, say so plainly and name what quality risk they are accepting.
Nightly build metrics show the estimated chance of a critical escape rising steadily. Draft the outline of a status update to engineering leaders and product managers: what you say, what evidence you show, and what you ask for.
Sample Answer
Direct answer
Lead with the decision, not the dashboard. The message is: "The estimated chance that a critical defect reaches customers has climbed for N nights running. Here is why it is moving, how much to trust the number, and what I need from you by which date." A critical escape means a defect serious enough to force a hotfix or hurt customers, found in production instead of before release. The two audiences want different things: engineering leaders want cause, cost and staffing, product managers want what it does to scope and date. One page, bottom line first.
Terms. A feature flag is a switch in the code that turns a feature on or off without redeploying, and off by default means customers do not see it until you flip it. Quarantining a flaky test means moving it out of the pass/fail gate so it stops blocking builds. Exploratory testing is a person testing freely, guided by judgment rather than a script. A release manager is the person who approves what ships and when. Drivers are the inputs that push the estimate up or down.
Outline of the update
- Headline and confidence. One sentence with the current estimate, the direction, and what the number is built from (for example: share of changed code with no automated test, failing nightly tests in areas touched this sprint, open high-severity defects and their age). Say plainly that it is an estimate.
- Evidence (three visuals at most, plus one line of text).
- The estimate over the last 2 to 3 weeks with the day it started rising marked.
- Which inputs moved (the drivers), so the trend is explained rather than just shown.
- Where the risk concentrates, by component, so the ask can be targeted.
- One line on what was ruled out: flaky tests (tests that pass and fail on identical code) or a broken test environment can fake a rise, so say you separated them.
- What it means for the release. Two or three options, each with its effect on scope and date.
- Asks. A decision (which option) and resources, each with an owner and a date.
- Timeline. When the next update lands and what would change the recommendation.
Worked example (illustrative numbers, not real data)
Subject: Release 5.4 risk: critical-escape estimate up from about 1 in 10 to about 1 in 4 in 12 nights
Bottom line. Risk of a critical escape in 5.4 has risen since the payments refactor merged. If nothing changes I recommend we do not commit to the 20th.
Why. Two drivers: (1) about a third of lines changed in the refactor have no automated test; (2) 3 high-severity defects in the checkout area are open and 2 are older than a week. Flaky tests were excluded: the rise holds after quarantining the 9 known-unstable tests.
Confidence. Moderate. The estimate is a simple weighted model calibrated on our last 6 releases; treat it as a direction and a ranking of components, not a probability to quote. (How the number is built: each nightly run adds weighted points for untested changed code, open severe defects and failing tests in touched areas, and the total is mapped to a rough likelihood band. "Calibrated on the last 6 releases" means the weights were tuned so that past scores matched which of those releases really had critical escapes. That is why "about 1 in 4" is fine as a headline band, but you would not quote "23.7%".)
Options. A) Hold the date, cut the refund flow from 5.4 (lowest risk, PM decision). B) Hold scope, slip to the 27th. C) Ship on the 20th behind a feature flag, off by default (needs release-manager sign-off).
Asks. By Thursday: a scope decision from Product. Two engineers for 5 working days to add tests around the refactored payment code, and half of one QA engineer for exploratory testing of checkout. Next update Monday 9:00, or sooner if a critical defect is found.
Why it is shaped this way
- The timeline and resource asks are concrete (people, days, decision dates) because "we need more testing time" gets a nod and no action.
- Options carry a recommendation. A status update that only alarms makes leaders ask "so what do you want?" in the meeting instead of deciding.
- Honest confidence keeps trust when the number wobbles next week.
Pitfalls
- Dumping raw nightly charts and letting readers find the story.
- Quoting a percentage as if it were precise. It is a model output, so give a direction and range.
- Asking for headcount with no date, or no alternative if the answer is no.
- Blaming a team. Frame the driver as a gap in safety nets (untested code), not people.
You report the same quality numbers to team leads, product managers and executives. How do you change what you show, the level of detail and the form of visualisation for each audience? Use one metric as a worked example.
Sample Answer
Direct answer
Keep one source of truth and one definition, and change only the zoom: team leads get detail they can act on this week, product managers get impact and trend tied to their plan, executives get one number, its direction and the decision needed. I will use defect escape rate (the share of a release's defects found only after release) as the worked metric.
Worked example data (illustrative)
Last four releases: escaped defects out of all defects found: R1 18 of 60 (30%), R2 15 of 50 (30%), R3 9 of 45 (20%), R4 6 of 40 (15%). In R4, the 6 escapes were checkout 4, search 1, profile 1.
What each audience sees
| Audience | Detail level | Form of visualisation | What it says |
|---|---|---|---|
| Team lead | Per component and per defect, with root-cause tag and link | Table of the 6 R4 escapes; bar chart by component | "Checkout has 4 of 6; three lacked a test for the refund path, so add these tests this sprint" |
| Product manager | Per feature area and severity, per release | Trend line over R1 to R4 plus a stacked bar by severity | "Escapes fell from 30% to 15%; the remaining ones sit on the checkout flow, a revenue path, so scope and dates need test time there" |
| Executive | One metric, direction, target, one sentence, one ask | Small trend line with the four points labelled, one status colour plus a text label | "Escape rate halved over four releases (30% to 15%). One area still drives most escapes. We ask for two weeks of test investment there before the next major launch" |
Principles
- Same numbers, different zoom: never change values between audiences, only how much detail sits under them.
- Every view answers "so what?": leads see what to fix, product managers see what it means for the plan, executives see what decision is needed.
- Show denominators for small samples: R4's 15% is 6 of 40; one more escape moves it by 2.5 points, so avoid over-precise claims.
- Choose forms deliberately: tables for action, line charts for trend, stacked bars for composition. Avoid pie charts and 3D, and never rely on red and green alone (add a text label so colour-blind readers get the status).
- Fewer metrics upward: an executive page with 20 metrics is not read; keep to three or four and link down for detail.
Pitfalls
Do not simplify to the point of hiding severity (15% of trivial defects versus 15% of critical ones), and do not present a single good-looking figure without the context that would let a non-technical reader challenge it.
Unlock Full Question Bank
Get access to all 16 Quality Metrics and Test Reporting interview questions and detailed answers.
Sign in to ContinueJoin thousands of developers preparing for their dream job.