What is regression testing?
BeginnerConceptTesting in DevOps
Answer
In one line: Regression testing re-runs existing tests after a change to make sure that things which used to work still work — that the change didn't break something else.
Why it's needed: code is connected in ways that aren't always obvious. Fixing a bug in the discount logic might break invoice totals. Without regression tests, these breakages reach users.
How DevOps teams do regression testing:
- Automate it — the whole automated test suite (unit, integration, E2E) is the regression suite, running in CI on every change. Manual regression testing doesn't scale to daily releases.
- Add a test for every bug fixed — write a test that reproduces the bug first, then fix it. That bug can never silently return.
- Prioritise — run fast regression tests on every PR, the full suite after merge or nightly.
- Test impact analysis — some tools run only the tests affected by the changed code to save time.
- Visual regression testing — tools like Percy or Playwright screenshots catch unexpected UI changes.
- Performance regression — compare response times with the previous version; fail if they get much worse.
Example:
- Bug: the cart shows a negative total when a coupon is larger than the price.
- Developer writes
test_coupon_larger_than_price_gives_zero_total()— it fails. - Fixes the code — the test passes.
- From now on, every pipeline run checks this case.
Regression testing vs retesting:
- Retesting — checking that a specific bug is now fixed.
- Regression testing — checking that nothing else broke.
Tip for interviews: say "every bug fix comes with a test" — it's a simple habit that shows quality thinking.
More on Testing in DevOps
What is the testing pyramid?BeginnerWhat is the difference between unit, integration and end-to-end tests?BeginnerWhat are smoke tests and sanity tests?BeginnerWhat is test automation, and what should (and shouldn't) be automated?BeginnerWhat is shift-left testing, and how do you apply it in a pipeline?IntermediateWhat is contract testing, and why is it useful for microservices?Intermediate