Regression optimization
Run the tests a change can affect, and keep the full regression for when it matters
A full regression for every change is safe and slow. Running only the tests that exercised the changed code is faster, and safe under conditions you can check. CoverOps supplies the evidence and the list; your team decides when a targeted run is enough.
By the CoverOps team · Last updated
When a targeted run is a reasonable choice
- The changed code is in services that run an agent, so the change can be matched to tests.
- Your tests have recent recorded runs, so their footprints reflect today's code paths.
- The change is code, not configuration, schema or infrastructure, which line matching cannot see.
- A full regression still runs on a schedule (nightly, or before a release) to refresh the records and catch what selection missed.
If any of these does not hold for a change, run the full suite for it. The point is to choose, per change, with evidence, not to stop running the regression.
How CoverOps supplies the list
- Agents record which code each test executed on its last run.
- For a pull request or a window of commits, CoverOps finds the changed lines.
coverageops select, the runner plugins or the API name the tests whose footprint misses the change: every changed file by default, every changed line at line granularity. Tests that failed recently, new tests and tests without a footprint are never on that list.- Your pipeline runs everything else with its usual runner, then the changed-code gate reports whether the change was exercised.
Tests that never ran with an agent are never on the skip list: a new test runs on every change until it has a record. Each answer names the merge base it measured the change from.
A careful way to adopt it
- Measure first. Run your full regression with agents attached for a few cycles so every test has a footprint.
- Shadow the selection. Turn on observation mode: CI records what selection would skip and still runs the full suite. The Test selection page then shows, from each run's own results, every failure the selection would have missed. Each one is a case to understand before you rely on it.
- Use it where it held. Start with pull request pipelines for services where the shadow period showed no misses; keep the full run nightly and before releases.
We do not publish a percentage of time saved: it depends entirely on how your tests map to your code. The shadow period measures it for your own suite, and once selection is on, the monthly savings report counts the measured time of every test it skipped.
Check whether targeted runs would hold for your suite
A demo shows how selection would look on your stack; a pilot measures it on one of your own services.