{"id":4947,"date":"2022-12-07T13:20:10","date_gmt":"2022-12-07T11:20:10","guid":{"rendered":"https:\/\/betterqa.co\/?p=4947"},"modified":"2026-09-14T11:56:18","modified_gmt":"2026-09-14T09:56:18","slug":"regression-testing-guide","status":"publish","type":"post","link":"https:\/\/betterqa.co\/regression-testing-guide\/","title":{"rendered":"Regression testing: how to choose what to run"},"content":{"rendered":"\t\t<div data-elementor-type=\"wp-post\" data-elementor-id=\"4947\" class=\"elementor elementor-4947\" data-elementor-post-type=\"post\">\n\t\t\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-840c106 elementor-section-full_width elementor-section-height-default elementor-section-height-default\" data-id=\"840c106\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-752825e\" data-id=\"752825e\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-79f7791 elementor-widget elementor-widget-html\" data-id=\"79f7791\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"html.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<style>\n.bqa-art{max-width:780px;margin:0 auto;padding:8px 0 24px;font-family:'Roboto',-apple-system,'Segoe UI',Arial,sans-serif;color:#2b2b3a;font-size:17px;line-height:1.75}\n.bqa-art h2{font-family:'Jost','Roboto',Arial,sans-serif;font-weight:600;font-size:1.7rem;color:#1a1a1a;margin:2.2em 0 .6em;line-height:1.3}\n.bqa-art h3{font-family:'Jost','Roboto',Arial,sans-serif;font-weight:600;font-size:1.3rem;color:#1a1a1a;margin:1.8em 0 .5em;line-height:1.35}\n.bqa-art p,.bqa-art ul,.bqa-art ol{margin:0 0 1.1em}\n.bqa-art li{margin:0 0 .4em}\n.bqa-art a{color:#5F29A1;text-decoration:underline}\n.bqa-art .bqa-tbl{overflow-x:auto;margin:1.2em 0 1.6em}\n.bqa-art table{width:100%;border-collapse:collapse;font-size:.95rem}\n.bqa-art th,.bqa-art td{border:1px solid #e2dcef;padding:.6em .8em;text-align:left;vertical-align:top}\n.bqa-art th{background:#f4effc;font-weight:600}\n.bqa-art pre{background:#1e1b2e;color:#ecebf5;padding:1em 1.2em;border-radius:6px;overflow-x:auto;font-size:.85rem;line-height:1.55;margin:1.2em 0 1.6em;white-space:pre}\n.bqa-art code{font-family:'JetBrains Mono',ui-monospace,Menlo,Consolas,monospace;font-size:.9em}\n.bqa-art :not(pre)>code{background:#f4effc;padding:.1em .35em;border-radius:3px}\n.bqa-art pre code{background:none;padding:0;color:inherit}\n.bqa-art blockquote{border-left:4px solid #9152DE;margin:1.2em 0;padding:.4em 1.1em;background:#faf8fe}\n.bqa-art hr{border:0;border-top:1px solid #e2dcef;margin:2em 0}\n<\/style>\n<div class=\"bqa-art\">\n<p>Regression testing is re-running tests over software that has changed, to confirm the change did not break something that used to work. The <a href=\"https:\/\/glossary.istqb.org\/en\/term\/regression-testing-3\" rel=\"nofollow noopener\" target=\"_blank\">ISTQB glossary<\/a> puts it as testing a previously tested program after modification, to make sure defects have not been introduced in unchanged areas.<\/p>\n<p>That definition is not the hard part, and it is not why anyone is still reading. The hard part arrives about eighteen months into a product's life, when the suite takes four hours, the release window is forty minutes, and somebody has to decide which tests do not run. Every team reaches that point. Most handle it by quietly running whatever finishes in time, which is a decision nobody made and nobody can defend.<\/p>\n<p>This is about making that decision deliberately.<\/p>\n<h2>Why the suite always outgrows the window<\/h2>\n<p>Regression suites grow monotonically and nothing removes from them. Each escaped defect adds a test. Each new feature adds its own coverage plus a few cases guarding its interaction with older features. Nobody is ever assigned to delete tests, and deleting one feels like removing a safety net even when the test has not failed in three years.<\/p>\n<p>So runtime rises, and two things happen. Teams start running the suite less often, usually nightly instead of per-merge, which means a regression now sits undetected for up to a day and lands on top of other changes that make it harder to isolate. And flaky tests accumulate, because a longer suite has more chances to be flaky, until a red run stops meaning anything and people rerun it until it goes green.<\/p>\n<p>A suite in that state is worse than a smaller one. It costs the full four hours and provides almost no signal, because nobody believes its failures.<\/p>\n<h2>What belongs in a regression suite<\/h2>\n<p>The useful question is not \"does this test add coverage\" but \"if this broke in production, what would happen\". Four properties decide it, and they can be assessed by anyone who knows the product.<\/p>\n<p><strong>Blast radius.<\/strong> What is the worst outcome if this path silently breaks? Money moving incorrectly, data loss, a security or access-control failure, or anything a user cannot undo sits at the top and stays in every run, regardless of runtime budget. A misaligned icon does not.<\/p>\n<p><strong>Reach.<\/strong> How many users touch this, and can they route around it? Login is on every session's path and has no workaround. An export button used by nine admins a month has both lower reach and an obvious manual fallback.<\/p>\n<p><strong>Change frequency.<\/strong> Code that changes often breaks often. Your version control already knows which files those are, and the answer is frequently not where people assume:<\/p>\n<pre><code class=\"language-bash\">git log --since='12 months ago' --name-only --pretty=format: -- src\/ \\\n  | sort | uniq -c | sort -rn | head -20\n<\/code><\/pre>\n<p>Run that, then ask which tests cover the top of the list. In most repositories a handful of files carry a disproportionate share of the churn, and they are the ones worth guarding hardest.<\/p>\n<p><strong>Defect history.<\/strong> Areas that have broken before break again. If you have a defect tracker with components on the tickets, the count of production defects per area over the last year is the single best predictor you own, and it is one query away.<\/p>\n<p>A test that scores low on all four is a candidate for deletion, not for a slower pipeline. That sentence is the one most teams need permission to act on.<\/p>\n<h2>Four selection strategies<\/h2>\n<p>Once selection is deliberate, there are four recognised ways to do it, and most working teams end up combining the last two.<\/p>\n<div class=\"bqa-tbl\"><table>\n<thead>\n<tr>\n<th>Strategy<\/th>\n<th>What it means<\/th>\n<th>When it fits<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>Retest all<\/td>\n<td>Run the entire suite every time<\/td>\n<td>While the suite still fits the window; the safest and the first to become impossible<\/td>\n<\/tr>\n<tr>\n<td>Regression test selection<\/td>\n<td>Run only the tests that reach the changed code<\/td>\n<td>Where you can map tests to code with reasonable confidence<\/td>\n<\/tr>\n<tr>\n<td>Test case prioritisation<\/td>\n<td>Run everything, but in risk order, and cut from the bottom when time runs out<\/td>\n<td>Almost always useful, and cheap to adopt<\/td>\n<\/tr>\n<tr>\n<td>Hybrid<\/td>\n<td>Change-based selection per merge, prioritised full suite nightly, everything before release<\/td>\n<td>The arrangement most teams land on<\/td>\n<\/tr>\n<\/tbody>\n<\/table><\/div>\n<p>Prioritisation deserves the emphasis because it is the cheapest to adopt and it degrades gracefully. If your suite is ordered by risk, then a run that is cut short has still executed the most valuable tests, and you can say exactly which ones did not run. An unordered suite cut short has tested an arbitrary subset and you can say nothing.<\/p>\n<p>Tagging is usually enough to implement it. Most runners support it directly:<\/p>\n<pre><code class=\"language-bash\"># per merge: critical paths plus anything touching what changed\npytest -m &quot;critical or payments&quot; --maxfail=1\n\n# nightly: everything, highest risk first so a timeout still means something\npytest -m &quot;critical&quot; &amp;&amp; pytest -m &quot;not critical&quot;\n<\/code><\/pre>\n<p>Change-based selection can be approximated without specialist tooling by mapping directories to tags, and an approximation is worth having:<\/p>\n<pre><code class=\"language-bash\">CHANGED=$(git diff --name-only origin\/main...HEAD)\nTAGS=&quot;critical&quot;\necho &quot;$CHANGED&quot; | grep -q '^src\/payments\/'  &amp;&amp; TAGS=&quot;$TAGS or payments&quot;\necho &quot;$CHANGED&quot; | grep -q '^src\/auth\/'      &amp;&amp; TAGS=&quot;$TAGS or auth&quot;\npytest -m &quot;$TAGS&quot;\n<\/code><\/pre>\n<p>One caution that is easy to get wrong. Selection based on changed files is blind to indirect coupling, which is precisely where regressions live: a change in a shared utility can break a feature whose directory was not touched. Treat change-based selection as what runs per merge, never as what runs before a release. The full prioritised suite still has to run at some scheduled point, or the strategy has simply stopped testing the interactions.<\/p>\n<h2>A worked prioritisation<\/h2>\n<p>Take an e-commerce product with a 340-case suite that now runs for three hours against a forty-minute window. Scoring by the four properties above produces something like this.<\/p>\n<div class=\"bqa-tbl\"><table>\n<thead>\n<tr>\n<th>Tier<\/th>\n<th>Content<\/th>\n<th>When it runs<\/th>\n<th>Runtime<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>1<\/td>\n<td>Checkout and payment, login and session, order creation, price and tax calculation, access control between accounts<\/td>\n<td>Every merge, always<\/td>\n<td>8 min<\/td>\n<\/tr>\n<tr>\n<td>2<\/td>\n<td>Cart operations, search and filters, account management, email triggers, stock handling<\/td>\n<td>Every merge, plus anything change-selected<\/td>\n<td>14 min<\/td>\n<\/tr>\n<tr>\n<td>3<\/td>\n<td>Admin reporting, bulk import, historical order views, preference screens<\/td>\n<td>Nightly, and before every release<\/td>\n<td>90 min<\/td>\n<\/tr>\n<tr>\n<td>4<\/td>\n<td>Cosmetic checks, legacy flows behind a disabled flag, duplicated coverage<\/td>\n<td>Deleted<\/td>\n<td>68 min saved<\/td>\n<\/tr>\n<\/tbody>\n<\/table><\/div>\n<p>Tier 4 is the point of the exercise. Roughly a third of a mature suite is usually redundant, dead or cosmetic, and removing it is what makes the rest affordable. Delete it in version control where it can be recovered, rather than leaving it skipped, because a permanently skipped test is a comment pretending to be a safety net.<\/p>\n<p>The resulting arrangement runs 22 minutes per merge inside a 40-minute window, everything nightly, and the whole suite before a release. Nothing in tier 1 or 2 is ever cut.<\/p>\n<h2>Keeping the suite from rotting<\/h2>\n<p>Selection solves today's runtime. Keeping it solved takes a few standing habits.<\/p>\n<p><strong>Treat flakiness as a defect with an owner.<\/strong> A test that fails intermittently is not a minor annoyance, it is an attack on the credibility of every other test in the run. Track the flake rate, and quarantine anything above a small threshold into a separate non-blocking job with a ticket and a name against it. A quarantine with no exit date is just a slower delete, so give it one.<\/p>\n<p><strong>Budget the runtime, and enforce it.<\/strong> Decide the per-merge ceiling, put it in CI, and fail the build when it is exceeded. Without a ceiling the suite grows until it hits whatever people will tolerate, which is always more than what is useful.<\/p>\n<p><strong>Review the suite on a schedule.<\/strong> Once a quarter, list the tests that have not failed in a year and ask whether each still guards something real. Some do, because they cover a path that genuinely never breaks and would be catastrophic if it did. Many do not.<\/p>\n<p>The numbers worth watching are few. Suite runtime and its trend. Flake rate. Escaped defects, meaning production defects in areas the suite claims to cover, which is the only measure of whether the suite is doing its job. Coverage percentage is not on that list, because a suite can cover every line and assert nothing useful.<\/p>\n<h2>Manual and automated<\/h2>\n<p>Regression testing is the strongest case for automation in testing, because it is repetitive, unchanging and frequent, which is exactly the profile humans handle badly. A regression suite that is manual will be cut under deadline pressure every time.<\/p>\n<p>It does not follow that everything should be automated. Automation is worth its maintenance cost where the behaviour is stable; on a screen being redesigned every sprint, an automated test is a recurring bill for a result you already expect to change. Exploratory regression around a redesigned area, done by a person, finds things a scripted test cannot, because the scripted test only asserts what someone thought of in advance.<\/p>\n<p>The practical split is to automate tiers 1 and 2 completely, automate tier 3 where it is stable, and keep a short exploratory pass on whatever changed most this release.<\/p>\n<h2>Where it sits in the process<\/h2>\n<p>Regression testing runs during the execution phase of the <a href=\"https:\/\/betterqa.co\/stlc-software-testing-life-cycle\/\">software testing life cycle<\/a>, after a build has passed its <a href=\"https:\/\/betterqa.co\/smoke-testing-sanity-acceptance-testing-qa-guide\/\">smoke test<\/a> and after the targeted sanity check on whatever changed. Those two are fast checks on one build and one change; the regression suite is the broad net, and it is the one that catches damage nobody predicted.<\/p>\n<p>Which is the thing worth ending on. The whole reason regression testing is hard to prioritise is that its value is invisible when it works. A suite that has caught nothing this quarter looks like an expense, right up until the quarter it does not run.<\/p>\n<h2>Sources<\/h2>\n<p>The <a href=\"https:\/\/glossary.istqb.org\/en\/term\/regression-testing-3\" rel=\"nofollow noopener\" target=\"_blank\">ISTQB glossary<\/a> defines the term, and <a href=\"https:\/\/www.iso.org\/standard\/81291.html\" rel=\"nofollow noopener\" target=\"_blank\">ISO\/IEC\/IEEE 29119<\/a> covers test selection and documentation.<\/p>\n<p>If the practical blocker is that nobody owns the suite, that is the usual shape of a <a href=\"https:\/\/betterqa.co\/software-testing-services\/regression-testing\/\">regression testing<\/a> engagement with <a href=\"https:\/\/betterqa.co\">BetterQA<\/a>: score the existing suite against the four properties above, delete the third of it that earns nothing, and get the rest running on every merge.<\/p>\n<p>Built by <a href=\"https:\/\/betterqa.co\">BetterQA<\/a><\/p>\n<\/div>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-75b1319 elementor-section-full_width elementor-section-height-default elementor-section-height-default\" data-id=\"75b1319\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-e9aef42\" data-id=\"e9aef42\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-e0408a9 elementor-widget-divider--view-line elementor-widget elementor-widget-global elementor-global-5706 elementor-widget-divider\" data-id=\"e0408a9\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"divider.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<div class=\"elementor-divider\">\n\t\t\t<span class=\"elementor-divider-separator\">\n\t\t\t\t\t\t<\/span>\n\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-befb1a2 elementor-widget-tablet__width-initial elementor-widget elementor-widget-global elementor-global-5702 elementor-widget-text-editor\" data-id=\"befb1a2\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p><strong>Stay Updated with the Latest in QA<\/strong><\/p>\n<p>The world of software testing and quality assurance is ever-evolving. To stay abreast of the latest methodologies, tools, and best practices, bookmark our blog. We\u2019re committed to providing in-depth insights, expert opinions, and trend analysis that can help you refine your software quality processes.<\/p>\n<p><a href=\"https:\/\/betterqa.co\/blog\/\" target=\"_new\">Visit our Blog<\/a><\/p>\n<p>Delve deeper into a range of specialized services we offer, tailored to meet the diverse needs of modern businesses. As well, hear what our clients have to say about us on <a href=\"https:\/\/clutch.co\/profile\/betterqa\" rel=\"nofollow noopener\" target=\"_blank\">Clutch!<\/a><\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-bbe7b9f elementor-align-left elementor-widget elementor-widget-global elementor-global-5701 elementor-widget-button\" data-id=\"bbe7b9f\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"button.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<div class=\"elementor-button-wrapper\">\n\t\t\t\t\t<a class=\"elementor-button elementor-button-link elementor-size-sm elementor-animation-grow\" href=\"https:\/\/betterqa.co\/software-testing-services\/#\">\n\t\t\t\t\t\t<span class=\"elementor-button-content-wrapper\">\n\t\t\t\t\t\t<span class=\"elementor-button-icon\">\n\t\t\t\t<svg aria-hidden=\"true\" class=\"e-font-icon-svg e-far-arrow-alt-circle-left\" viewBox=\"0 0 512 512\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\"><path d=\"M8 256c0 137 111 248 248 248s248-111 248-248S393 8 256 8 8 119 8 256zm448 0c0 110.5-89.5 200-200 200S56 366.5 56 256 145.5 56 256 56s200 89.5 200 200zm-72-20v40c0 6.6-5.4 12-12 12H256v67c0 10.7-12.9 16-20.5 8.5l-99-99c-4.7-4.7-4.7-12.3 0-17l99-99c7.6-7.6 20.5-2.2 20.5 8.5v67h116c6.6 0 12 5.4 12 12z\"><\/path><\/svg>\t\t\t<\/span>\n\t\t\t\t\t\t\t\t\t<span class=\"elementor-button-text\">See the other Services we provide<\/span>\n\t\t\t\t\t<\/span>\n\t\t\t\t\t<\/a>\n\t\t\t\t<\/div>\n\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<\/div>\n\t\t","protected":false},"excerpt":{"rendered":"<p>Every regression suite eventually takes longer to run than the release can wait for. How to decide what runs, what gets cut, and how to stop the suite rotting.<\/p>\n","protected":false},"author":33,"featured_media":4948,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[792,914,1012,1009],"tags":[901,742],"class_list":["post-4947","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-stlc-software-testing-life-cycle","category-performance-testing","category-performance-testing-techniques-and-methodologies","category-stcl-techniques-and-practices","tag-regression-testing","tag-softwaretesting"],"acf":[],"_links":{"self":[{"href":"https:\/\/betterqa.co\/wp-json\/wp\/v2\/posts\/4947","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/betterqa.co\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/betterqa.co\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/betterqa.co\/wp-json\/wp\/v2\/users\/33"}],"replies":[{"embeddable":true,"href":"https:\/\/betterqa.co\/wp-json\/wp\/v2\/comments?post=4947"}],"version-history":[{"count":1,"href":"https:\/\/betterqa.co\/wp-json\/wp\/v2\/posts\/4947\/revisions"}],"predecessor-version":[{"id":10441,"href":"https:\/\/betterqa.co\/wp-json\/wp\/v2\/posts\/4947\/revisions\/10441"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/betterqa.co\/wp-json\/wp\/v2\/media\/4948"}],"wp:attachment":[{"href":"https:\/\/betterqa.co\/wp-json\/wp\/v2\/media?parent=4947"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/betterqa.co\/wp-json\/wp\/v2\/categories?post=4947"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/betterqa.co\/wp-json\/wp\/v2\/tags?post=4947"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}