What is Regression Testing: A Complete Introduction
Table of content
Your team has just shipped a new feature for the company’s flagship application. The launch goes well and early feedback is positive. Then support tickets start arriving: an older core feature, the one your most loyal customers use every day, has stopped working. Sales take a hit, and developers are digging through code they have not touched in months. What is regression testing, and how does it stop this from happening? It is the routine re-checking of existing behavior after every change, so a break like this one fails in the pipeline instead of in front of a customer.
What is Regression Testing?
Regression testing means re-running tests that already passed to confirm that a recent code change has not broken existing features. The trigger can be a new feature, a bug fix, a dependency upgrade or a configuration change. The name explains the goal: catch a “regression”, a point where the software has gone backward to a less functional state. We apply it across all the technologies we work with, from back-end services to mobile apps.
A home renovation is a fair comparison. After a contractor fits a new kitchen, you still run the taps and flip the light switches in the rest of the house to check that the new plumbing and wiring did not disturb the old systems.
Small changes cause regressions as often as big releases do. A library upgrade changes how dates are parsed, and invoices start showing the wrong day. A padding tweak in a shared button component pushes the checkout button below the fold on phones. Neither change touched the feature that broke, which is why testing that looks only at the change misses them.
Regression testing also differs from new feature testing and from retesting. New feature tests confirm that the new code matches the specification. Retesting confirms that one specific bug is fixed. Regression testing looks at the existing functionality and asks a wider question: did the change break anything that already worked? Later in the cycle, business users run user acceptance testing to confirm the release fits their real work.
The Business Case: Why Regression Testing is Non-Negotiable
Skipping regression testing is a business risk before it is a technical one. The features customers already depend on are the ones that pay for the product, and a failure in them costs more trust than a new feature earns.
Cost follows the same logic. A defect caught by an automated test before a merge costs the developer a few minutes. The same defect found in production pulls in support, an emergency fix, a hotfix release and sometimes data repair. You will often read that a production bug costs 100 times more to fix, but nobody has been able to trace the study behind that figure. The direction holds anyway: the later a bug is found, the more people and systems it touches.
Delivery speed depends on it as well. Teams that practice continuous integration and continuous delivery (CI/CD) merge changes several times a day, and nobody can re-check an application by hand that often. An automated regression suite that runs on every pull request makes that pace safe, because developers get a clear pass or fail before their code reaches the main branch. Users, for their part, notice a broken familiar function far more than a new one, and that is the moment they start comparing alternatives.
Key Types and Approaches: How to Do Regression Testing
There is no single answer to how to do regression testing. The right strategy depends on the size of the application, the scope of the change and how much risk the business can accept. In every case the work comes down to choosing which existing test cases to run again.
The scope of the change decides between the main types of regression testing:
- Corrective Regression Testing: The simplest form, used when the product specification has not changed. You re-run existing test cases as they are to confirm the old functionality still behaves as intended.
- Retest-all Regression Testing: The entire suite runs again. It is the most thorough option and the slowest, so teams keep it for major releases and changes to the core architecture.
- Selective Regression Testing: The team runs a subset of tests chosen by analyzing which parts of the code the change can reach. This is the everyday default, and it depends on knowing the application’s dependencies well.
- Progressive Regression Testing: Used when the specification itself changes. New test cases cover the new behavior, and existing ones are updated so they do not contradict it.
A regression cycle usually runs in a fixed order. After a change lands, smoke testing checks that the build is stable enough to test at all. The team then looks at what changed, picks the matching tests from the regression suite and runs them, ideally through automation. Failures go back to the developer as defects with logs, screenshots or traces attached.
You will often hear smoke testing and sanity testing in the same conversation. Smoke testing is a quick, high-level check of the most important functions that answers one question: is this build stable enough to test? Sanity testing is narrower. After a small fix, it is a brief run through the affected functionality.
The difference in regression testing vs smoke testing is depth and purpose. Smoke testing is wide and shallow and checks basic stability. Regression testing goes deep into existing behavior. A typical flow: a new build is deployed, it passes the smoke test, new features pass their own tests, and then the regression test suite confirms that nothing old was broken.
Choosing Which Tests to Run
Running every test on every commit stops working once a suite takes longer than a coffee break. Teams combine several selection methods:
- Risk first: tests for payments, authentication and data exports run on every change, whatever it touched.
- Test impact analysis: tools run only the tests a change can affect. Playwright’s
--only-changedflag runs test files changed since a Git reference plus the files that import them, Jest has--changedSince, and monorepo tools such as Nx and Bazel test only the affected projects. - Tiers: a fast tier runs on every pull request, and the full retest-all suite runs nightly and before each release.
The Test Pyramid and Where Regression Tests Belong
Mike Cohn’s test pyramid, from his 2009 book Succeeding with Agile, is still the best guide to where regression tests should live (see Martin Fowler’s summary of the test pyramid). Most coverage belongs in fast unit tests written with JUnit, xUnit, pytest or Jest. A middle layer checks services through their APIs, and a thin top layer of end-to-end UI tests covers the journeys that bring in revenue, such as login and checkout. UI tests are slower and break more often, so a suite built mostly from them becomes expensive to keep green. One habit grows the suite in the right place: every bug fix ships with a test that reproduces the bug at the lowest level able to catch it.
Regression Testing in CI
In a CI pipeline such as GitHub Actions, GitLab CI or Jenkins, regression testing becomes a merge rule instead of a separate phase. Unit and API tests run on every pull request in a few minutes. End-to-end tests run in parallel shards (Playwright splits a suite with --shard=1/4), and branch protection blocks the merge while any required check fails. The pipeline keeps traces, screenshots and logs from each failure, so developers fix from the evidence instead of reproducing the problem locally.
Visual Regression Testing
Functional tests check that a button works. They do not notice that it moved 40 pixels or turned white on white. Visual regression testing compares screenshots of pages or components against approved baselines. Playwright has this built in: expect(page).toHaveScreenshot() saves a baseline on the first run and fails later runs when the difference exceeds your threshold. Rendering differs between operating systems and browsers, so generate baselines in the same environment that runs the tests and mask dynamic content such as dates. Hosted services such as Percy (part of BrowserStack), Chromatic (from the Storybook team) and Applitools add a review and approval workflow on top.
Flaky Tests
A flaky test passes and fails on the same code, and it does more damage than a missing test, because people stop trusting a failed build. Google reported that about 1.5% of its test runs returned a flaky result, almost 16% of its tests showed some flakiness, and about 84% of observed pass-to-fail transitions involved a flaky test (Google Testing Blog, 2016). The usual causes are fixed sleeps instead of waiting for a condition, tests that share data, and calls to real third-party services. Retries should expose flakiness, not hide it: Playwright marks a test that passes on retry as “flaky”, and its --fail-on-flaky-tests option fails the run when that happens. Quarantine a flaky test with a named owner and a deadline instead of deleting it.
Regression Testing Tools: Playwright, Cypress and Selenium
As of October 2026, three open-source frameworks cover most browser-based automated regression testing.
Playwright, maintained by Microsoft, drives Chromium, Firefox and WebKit through one API, with bindings for JavaScript and TypeScript, Python, Java and .NET. It waits for elements automatically, records traces you can step through after a CI failure, and since late 2025 ships test agents that work with an AI coding assistant to plan, write and repair tests.
Cypress runs tests inside the browser and is known for its interactive runner with time-travel debugging. It supports Chrome-family browsers, Edge and Firefox, while WebKit support is still experimental. The paid Cypress Cloud adds parallel runs, Test Replay and flaky-test analytics.
Selenium implements the W3C WebDriver standard and has the widest language support, from Java and C# to Python and Ruby. Selenium Grid spreads tests across browsers and machines, and Selenium Manager downloads the right browser drivers automatically.
A practical rule: Playwright suits new web projects that need several browsers, Selenium fits large existing suites and Java or C# test teams, and Cypress works well where a front-end team already knows it. Suite design matters more than the framework.
Partnering for Quality: Our Commitment to Stability
As an outsource development partner, we build regression testing into a project from the first sprint. Every bug fix comes with a test that reproduces it, and every pull request runs the relevant suite before a reviewer opens it. Diatom’s 80+ senior engineers work AI-first: AI tools help draft test cases and test data, and a senior engineer reviews every AI-generated test before it joins the suite, because a test that asserts the wrong thing gives false confidence.
This is how we run custom software development projects. You can ship new features often and still know that the ones your customers rely on keep working.
Conclusion
Regression testing is the practice of re-checking existing features after every change. It goes deeper than smoke testing and sanity testing, and the types of regression testing, from selective to retest-all, let a team match effort to risk. A good setup keeps most tests at the unit and API level, runs a selected tier on every pull request, adds visual checks for the UI and treats flaky tests as bugs.
Don’t let new features put the stable foundation you’ve already built at risk. If you’re looking for a development partner who builds quality in from day one, contact us. Let’s work together to build powerful software that grows with you, safely and reliably.