Open the trace viewer and step through a failing test action by action. A test suite is only valuable if the team trusts it. The moment people start re-running failures without reading them, the suite has stopped protecting anyone.
Sample footage: Big Buck Bunny, an open movie by the Blender Foundation, released under a Creative Commons licence.
Tests as documentation
Reliable tests control everything outside the code under test: time, randomness, network, and fonts. Once those are fixed, a failure means something changed in the code, which is exactly what we want to know.
- Freeze time and seed randomness in tests.
- Quarantine flaky tests with an owner and a deadline.
- Keep end-to-end tests for critical journeys.
- Read every failure before re-running.
We track three numbers for the suite: total duration, flaky failure rate, and time from failure to fix. Coverage is useful for finding untested areas, but it is not a goal on its own.
Questions, corrections, and war stories are welcome in the comments. Several of our best follow-up posts started as a reader pointing out something we had missed.
We will revisit this in six months with fresh numbers. If the results change, we will update the post and note what changed at the end.
If you try this on your own project, start with one page or one service rather than the whole codebase. A small experiment gives you real numbers to argue with, and it is easy to roll back if the idea does not fit.
Premature optimization is the root of all evil.
Donald Knuth, Structured Programming with go to Statements, 1974
This is exactly the write-up I needed this week. We hit the same wall last sprint.
Safari 16.4 and newer are fine in our testing; older versions need the fallback line.
Bookmarked. The code sample alone saved me an afternoon.