Regression testing reruns existing checks after a change to confirm that what worked before still works. The best practices that pay take work out of the suite: rerun only the checks a change can reach, retire any check whose failure nobody could explain, and add a check for every regression that escapes.
A list of best practices makes the suite bigger
The usual list of regression testing best practices runs to ten items or more. Automate the suite, widen coverage, add visual checks, test more browsers, run everything on every commit. Each item is sound alone, each adds something to write, run or maintain, and nothing on the list says what to take away.
A suite grows without help. The ISTQB Foundation Level syllabus (v4.0.1) notes that “generally the number of regression test cases will increase with each iteration or release.” Writing a check is the small part of its cost. The larger part is paid on every run, in the wait for a result and in the attention each failure takes from whoever reads it.
Regression testing in software testing sets out the types of run and which changes call for each. This post takes a suite that already exists and asks which habits are worth their price. The ones that pay are decisions on what a change does not need rerun, which checks have stopped earning their place, and what evidence justifies a new one.
Five practices pay, and each one has a price
The table ranks five practices for a team that already runs a regression testing suite, by how much each changes the cost of a run and the trust placed in its result.
| Rank | Practice | What it costs | What it buys |
|---|---|---|---|
| 1 | Rerun what the change can reach | A code-to-check map kept current, and a full run kept on a schedule | A result while the change is fresh in its author’s mind |
| 2 | Retire a check whose failure nobody could explain | Review hours, and an owner to sign each removal | Failures that get read |
| 3 | Add a check for every escaped regression | One reproduction per escape, from a report good enough to reproduce | Reach that follows where the product has failed |
| 4 | Run the likeliest failures first | A failure history kept clean of false alarms | A shorter wait for the first failure |
| 5 | Send a person where the scripts do not go | A scoped session in each release | Regressions no check was written for, caught before release |
Ranks one and two take work out, and rank three is the one addition that comes with evidence of a gap. Rank four, test case prioritisation, changes the order of a run and nothing else. Rank five is exploratory testing pointed at what the release changed, and its findings feed rank three.
Automating more and raising coverage are missing on purpose, since both invest in the size of the suite, and risk-based testing decides upstream which areas deserve checks at all. Running everything on every commit stays sound while the whole suite finishes in a few minutes, and on a suite that short the list starts at rank two.
The advice every list repeats, and where it fits
The best-practice lists that rank for this search share most of their items. Each has a place in the five above, as a condition one of them needs or as a smaller version of one.
| Common advice | Where it fits |
|---|---|
| Automate the regression suite | Automate a check once the behaviour it guards has settled. A check rewritten every sprint costs more as a script than as a manual check, and manual vs automated testing sets out the trade |
| Prioritise by risk and criticality | Risk decides which areas get checks at all, and rank four decides their order in a run |
| Run smoke tests first | The first tier of the pipeline below, a few minutes of checks on the paths that must work |
| Keep test data restorable and the environment stable | A condition for rank two. When data or the test environment drifts between runs, a failure cannot be told apart from noise, so test data management comes before any pruning |
| Run tests in parallel | Shortens the wait without removing anything, and pairs with rank one |
| Test end-to-end journeys and integrations | Keep a few journey checks on the paths that earn money, and push everything else down to the fastest level that asserts it, the fourth row of the retirement table below |
| Watch performance between releases | A slowdown is a regression too, and it needs a recorded baseline to compare against, so a timing budget is written and owned like any other check |
| Maintain the suite | Rank two, given a question that ends each review with a decision |
| Integrate with the CI/CD pipeline | The tiers below, each with a different trigger and a different power to block |
A change should rerun only the checks it can reach
The syllabus puts the instruction in one line: “It is advisable first to perform an impact analysis to recognize the extent of the regression testing.” Done for each change by a tool, that is test impact analysis. Paul Hammant’s 2017 article The Rise of Test Impact Analysis states the idea it rests on, that “not all tests exercise every production source file”, and describes a map built from code coverage or instrumentation recorded while the tests run.
Reach comes in three kinds, and a file map answers only the first, the checks that execute the changed files. A migration, a changed default or an environment setting reaches through data and configuration, where no file map links a change to a check. A stylesheet, a font or a shared component reaches every page that loads it, the ground visual regression testing works on.
One rule keeps selection safe. When the reach of a change is unknown, nothing is selected out and the whole suite runs, because the worst answer a selector can give is an empty list followed by a green build.
Selection deletes nothing. Every check still runs on a schedule and against the release candidate, away from the path that blocks a merge, and a failure there that selection missed is fixed as a defect in the map.
In a pipeline that gives four tiers, each with its own trigger.
| Trigger | What runs | What a failure blocks |
|---|---|---|
| Every push | Smoke tests on the paths that must work | The rest of the run |
| Pull request | The checks the change can reach, chosen by selection | The merge |
| Nightly | The full suite | Nothing directly. A failure opens a defect in the product or in the map |
| Release candidate | The full suite, plus a scoped exploratory session on what the release changed | The release, through the go/no-go decision |
A check whose failure nobody could explain should be retired
Selection decides when a check runs. Retirement decides whether it should exist, and one question settles it. If this check failed tomorrow, which defect would it be reporting, and who would act on it? The check’s own history usually holds the answer.
| What the history shows | What to do with the check |
|---|---|
| It failed for a defect that was then fixed | Keep it, because the ticket is its reason |
| It has never failed, and it guards a fixed bug or a costly path | Keep it |
| It has never failed, and nobody can say what it protects | Rewrite it against the requirement, or retire it |
| It fails only together with a faster check of the same behaviour | Retire the slower copy |
| It passes and fails on the same code | Quarantine it with a named owner, then repair or retire it |
| Its expected result is edited each time it fails | Retire it, because it records the build and checks nothing |
The fourth row is a question of level, which regression vs integration testing sets out. The fifth decides whether failures get read at all. In 2016 John Micco wrote on the Google Testing Blog that “about 84% of the transitions we observe from pass to fail involve a flaky test”, and added: “It is human nature to ignore alarms when there is a history of false signals coming from a system.” That figure is one company’s measurement of its own pipeline and no benchmark for another team. The mechanism travels, since people who keep reading false alarms learn to dismiss the real one. The same post warns that quarantining a flaky test “could easily mask a real race condition or some other bug in the code being tested”, which is why a quarantined check needs a named owner.
Two reasons are never enough for retirement. A slow run is answered by selection and by running in parallel, because the suite is the record of failures the team has already met. A long run of passes is no evidence either. The syllabus says that “repeating the same tests can have a beneficial outcome, e.g., in automated regression testing”, and a check written from a fixed bug can pass for years with its reason still on the ticket.
Every escaped regression is a check the suite was missing
A regression bug that reaches a user is an escaped defect, and it is the best evidence a team gets about where its suite does not reach. An escape has one of three causes. Where no check covered the behaviour, one is added. Where a check covered it and selection left it out, the map is repaired. Where a check failed and was waved through, its record of false alarms is the thing to fix.
The fix gets a retest, which the syllabus calls confirmation testing, and one way it lists to do that is “adding new tests to cover any changes that were needed to fix the defect.” Kept in the suite, that test is the new regression check. The fix is unfinished until a check fails on the broken build and passes on the fixed one.
Escapes also answer the principle the syllabus names “Tests wear out”, long called the pesticide paradox. Its remedy is that “new tests may need to be written”, and an escape says where.
Writing the check needs the conditions the failure happened under, and a regression reported by a user tends to arrive as one sentence. With the Notarus widget on the page, the widget captures the page the reporter is looking at, and console logs, network activity, page URL, viewport and browser travel with the report as captured evidence. A failed request or a thrown error in that record is something the new check can assert on. Capture settings, browser support and performance budgets decide what is available, so some reports carry less.
Three numbers show whether the practices are working
A suite run this way can be judged on three figures a team already has. They belong together, since any one of them alone can be improved by making the suite worse, a warning testing metrics makes at length.
- Escaped regressions per release, sorted by the three causes above. A falling count with most escapes in the “no check” column means selection and pruning are safe.
- Time from a push to the first failing check. Ranks one and four shorten it, and a rise points at a map that selects too much or an order that has gone stale.
- The share of failures closed as false alarms. Rank two and the flaky-test quarantine lower it, and while it stays high, real failures are being dismissed with the rest.
A suite kept this way has a shorter daily run and fewer checks nobody can account for, and each addition traces to a regression that got out.