What Is Regression Testing, and When Should You Run It?
Regression testing re-runs existing tests after a change to prove nothing that used to work is now broken. Learn what to include and when to run it.
On this page
Short answer
Regression testing is the practice of re-running a set of existing tests after a code change, such as a bug fix, a new feature or a library update, to check that features that worked before still work. It catches side effects early, before a small change breaks an unrelated part of the product.
What is regression testing?
Regression testing is the practice of re-running a set of existing tests after a change, to check that features that worked before still work. The change can be a bug fix, a new feature, a refactor, or an update to a library or platform.
A regression is a fault that appears in a part of the product that used to work. It usually happens because a change in one place affects behaviour somewhere else, often through shared code, shared data or an interface that was not updated in both places.
The regression suite is the collection of tests chosen for this job. It is usually a subset of the full test suite, picked because the tests cover the most-used features, the riskiest areas and the parts of the product that changed recently.
Regression testing is not the same as testing a new feature. New-feature tests ask whether the new behaviour works as designed. Regression tests ask whether everything else still works as it did before the change.
Why does regression testing matter?
Regression testing matters because most software breaks in places nobody touched. A fix for one bug can change a shared function, and a new feature can change the data that an older feature depends on. Without a check, those breaks reach users.
The cost of a missed regression grows the later it is found. A bug caught by a test in the same week costs a short fix and a re-run. The same bug found by a customer after release costs support time, a hotfix, and trust that is hard to win back.
Regression tests also make teams faster, not slower. When the suite runs after every change, developers get a clear signal within minutes and can fix a break while the change is still fresh in their mind.
Teams that skip regression testing often slow down over time instead. Each release carries more risk, so releases get smaller, slower and more stressful, and the team spends more time firefighting than building.
Regression testing vs smoke testing
Regression testing and smoke testing are both run after a change, but they answer different questions. Smoke testing asks whether the build works at all. Regression testing asks whether the parts that used to work still work.
| Check | Smoke testing | Regression testing |
|---|---|---|
| Question | Does the build start and do the basics work? | Did the change break anything that worked before? |
| Scope | A small set of critical paths | A broad set of existing features |
| Run time | Minutes | Minutes to hours, depending on the suite |
| When it runs | After every build | After a change, before a release |
| What it catches | Broken builds and major failures | Side effects in untouched areas |
| Typical owner | Build pipeline | Test suite or QA team |
The two work best together. Smoke tests give a fast go or no-go signal, and regression tests give the deeper check that the release is safe. A team that only runs smoke tests can ship a build that starts fine and still breaks a core feature.
For the differences in more detail, the comparison in smoke testing vs regression testing sets out where each check belongs.
What should a regression suite cover?
A regression suite should cover the features users rely on most, the areas with the most defects, and the parts of the product that changed recently. Covering everything is rarely practical, so the suite is a deliberate choice about risk.
A good starting point is the core user journeys: sign up, sign in, the main transaction, payment, and the most-used settings. If any of these break, most users notice within hours.
Next come the areas with a history of defects. If the search, the checkout or the reporting screen has broken three times this year, it deserves tests even if it is not the most-used feature.
The suite should also cover integrations and shared code. A change to a shared date function, a permissions check or a pricing rule can affect many screens at once, so tests that exercise those shared paths catch more than tests that stay inside one screen.
Finally, include a test for every bug that reached production. Each one is proof that the area can break, and the test makes sure the same bug cannot return silently. This is how a suite grows in the right places instead of growing everywhere at once.
How do you run regression testing?
You run regression testing by choosing the tests, running them in a clean environment, and treating any failure as a release blocker until it is explained. The routine matters more than the tooling.
- Pick the suite. Start with core journeys, defect-prone areas and recent changes, and keep the list written down so it can be reviewed.
- Automate the repeatable tests. Manual checks are fine for new or visual work, but the suite should run without a person so it can run often.
- Run it after every change. Trigger the suite on each merge or pull request, not only before a release, so a break is linked to one small change.
- Use a clean environment. Run against fresh test data and a known build, so a failure means the code broke, not the environment.
- Fix or explain every failure. A failing test is either a real bug or a test that needs updating. Never ignore a failure and ship anyway.
- Prune the suite regularly. Remove tests that are flaky, duplicated or no longer relevant, and add a test for each production bug.
Most teams start with a small suite and grow it. A suite of 100 reliable tests that runs in ten minutes is worth more than 1,000 tests that take two hours and fail for reasons nobody trusts.
The routine sits inside the wider testing approach described in software testing methodologies, which covers how regression work fits with unit, integration and acceptance testing.
Example (hypothetical): a team cuts release bugs
Example (hypothetical): a six-person team ships a booking product and releases twice a week. Before regression testing, each release brings about four customer-reported bugs, and each one takes around six hours to fix, test and hotfix.
The team builds a suite of 320 automated tests covering bookings, payments, cancellations and the admin screens. A full run takes 25 minutes. The suite runs after every merge, about 20 times a week, which is 500 minutes of machine time, or just over eight hours a week.
After two months, customer-reported bugs fall from four per release to one. That is six fewer bugs a week, and at six hours each, about 36 hours of fix and hotfix work saved each week. The eight hours of machine time is a small price for that.
The team also adds a test for each bug that still reaches production. After three months the suite has 380 tests and runs in 30 minutes, and the team trusts it enough to release on a Friday.
What are the common mistakes?
The most common regression testing mistakes are running the suite too rarely, letting it grow stale, and treating failures as noise. Each one quietly removes the protection the suite is meant to give.
- Running it only before release. A failure found at release time could come from any change in the last two weeks, which makes it slow to find and fix.
- Keeping flaky tests. A test that fails randomly teaches the team to ignore failures, and a real bug hides behind the noise.
- Testing everything equally. A suite that tries to cover every screen takes hours, so it runs rarely. Prioritise by risk instead.
- No test for production bugs. If a bug that reached users has no test, it can return in a later release without anyone noticing.
- Manual-only suites. A suite that needs a person to run it will be skipped when the team is busy, which is exactly when it is needed most.
Key takeaways
- Regression testing re-runs existing tests after a change to check that old features still work
- It catches side effects in parts of the product nobody touched
- Prioritise core journeys, defect-prone areas and recent changes
- Run the suite after every merge, not only before a release
- Add a test for each bug that reaches production, and prune flaky tests
Frequently asked questions
What is the difference between regression testing and retesting?
Retesting checks that a specific bug fix works, by re-running the test for that bug. Regression testing checks that the fix did not break anything else, by re-running a wider set of existing tests. Both are useful, and they are usually done together after a fix.
How often should regression testing run?
After every code change if possible, and at least before every release. Running the suite on each merge ties a failure to one small change, which makes it fast to find and fix. Waiting until release time makes the same failure much harder to trace.
Can regression testing be fully automated?
The repeatable checks can be, and usually should be, since automation lets the suite run after every change without a person. Exploratory checks and visual judgement still need a human. Most teams automate the core suite and keep manual testing for new or visual work.
How big should a regression suite be?
Big enough to cover core journeys, defect-prone areas and recent changes, and small enough to run in the time the team will wait for. A suite of a few hundred reliable tests that runs in under half an hour is a good target for most teams.
What causes flaky regression tests?
The usual causes are timing, shared state and environment differences: tests that depend on the clock, on data left by another test, or on a service that is sometimes slow. Fixing the cause is better than re-running the test, since a flaky test teaches the team to ignore failures.
Does regression testing replace manual testing?
No. Regression tests check known behaviour, while manual testing finds new problems a script would not think to look for. The two work together: automation guards what already works, and manual testing explores what is new or changed.