Any code change can quietly affect what used to work: fixing one bug breaks a neighbouring function, a new library version changes the behaviour of the whole application. Regression testing repeats checks that have already passed after such changes, and it is the main reason test suites are automated.
What is checked and when
| When it runs | What is checked |
|---|---|
| After a bug fix | the bug itself and the scenarios around it: a fix often affects neighbouring behaviour |
| Before a release | the key user scenarios that must work in every version |
| In CI on every commit | an automated suite: unit and integration tests and critical end-to-end checks |
| After an environment change | a new version of the database, a library, the browser or the operating system |
Choosing the scope
Running the full test suite for every change is often too slow, so it is split into tiers: a fast smoke run on every commit, then an extended suite, and a full run overnight or before a release. For example, if 4,000 automated tests take 50 minutes to run in full, run the 400 fastest and most important checks (6 minutes) on every commit and leave the full run to the nightly pipeline.
Why the word “regression”
Here the word “regression” means a step backwards, a return to a worse state: the program worked, and after a change it got worse. The same scenarios are repeated from release to release, and that volume cannot be run by hand, so the regression suite is automated and run on every build.
The ISTQB CTFL v4.0.1 syllabus distinguishes regression testing from confirmation testing (called retesting in older editions): confirmation testing checks that the original defect has been fixed, while regression testing checks that a change, including an already confirmed fix, has caused no side effects, either in the same component or in others.
Sources
the term is written from these pagesVerified 18 Nov