A Frontend Team Cut Its Unit Tests by 78% and Production Defects Didn't Budge
Coverage gates in CI push teams into writing tests that assert internal calls and snapshot DOM structure, and the failures become a tax on every merge in exchange for nothing. This team's six-month numbers show unit tests earn their cost only on pure logic with financial or access consequences; presentation and interaction layers are better served by runtime contract checks, type strictness, E2E smoke tests, and monitoring.
Coverage mandated at 75% in an OKR produced a test suite that looked great on a curve and did nothing else. This team's data review of 312 CI failures showed 86.9% were resolved by rewriting the test to fit the new code, 7% were flaky reruns, and only 19 caught actual bugs. Seventeen of those 19 were in price calculation, permission checks, and date handling; the 1,800 tests covering UI rendering, hooks, and page flows caught exactly zero.
The team deleted implementation-detail tests, 400+ snapshot files, and integration tests that mocked away the entire environment. What remained: edge-case-heavy unit tests for pure money and permission logic, zod schema checks that validate API response contracts at runtime, and five Playwright smoke paths for login, order, payment, refund, and listing. Six months later production defects were 41 vs 39, P0/P1 counts barely moved, and CI dropped from 14 minutes to 2:40.
The process matters as much as the cuts: a git churn script identified test files that co-change with their source 90% of the time, strict TypeScript flags were enabled to replace tests that were really checking types, and Sentry monitoring plus a 10% canary release replaced the safety net the deleted tests pretended to offer.
Coverage as an OKR target creates tests written to move a number, then maintained to keep that number moving; the 86.9% test-modification rate is the evidence of that incentive.
A test suite where every failure leads to updating the test rather than the product code trains the team to ignore red lights, which is worse than no tests at all.
The zero real bugs caught by UI and hook tests is a strong signal that React component behavior is better guarded by the type system and E2E checks than by unit tests that mock the environment.
Replacing mock-heavy integration tests with runtime contract validation in zod catches backend field changes, a class of bugs that mocked tests structurally cannot see.
Dropping from 78% to 31% coverage without a defect increase suggests coverage percentage alone is a poor proxy for test value; value comes from the expected cost of a bug in that module.
Every snapshot failure just gets a direct -u update; that line had me shaking my head. Once coverage gets written into OKRs, tests turn from a defense line into a report.
[watching]