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:

  1. 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.
  2. Add a test for every bug fixed — write a test that reproduces the bug first, then fix it. That bug can never silently return.
  3. Prioritise — run fast regression tests on every PR, the full suite after merge or nightly.
  4. Test impact analysis — some tools run only the tests affected by the changed code to save time.
  5. Visual regression testing — tools like Percy or Playwright screenshots catch unexpected UI changes.
  6. 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.

All DevOps Fundamentals questions

More on Testing in DevOps