What Is Regression Testing?

Regression testing re-runs existing tests after a code change to confirm that previously working functionality hasn't broken as a side effect.

Published November 16, 2026

Regression testing re-runs existing tests after a change to make sure previously working features still work. It catches bugs that new code accidentally introduces.

The concept

Every bug fix and feature adds a test; the growing suite acts as a safety net. Automated suites run on each commit in CI.

When a bug is reported, first write a test that reproduces it, then fix it, so it can never silently return.

Change then verify

  1. Developer changes code
  2. CI runs the full test suite
  3. Old tests still pass → safe
  4. A failing old test → a regression to fix

Practical examples

Bug-first test

test('does not crash on empty cart (bug #412)', () => {
  expect(total([])).toBe(0)
})

Run on every push

on: [push, pull_request]
jobs: { test: { runs-on: ubuntu-latest, steps: [{ uses: actions/checkout@v4 }, { run: 'npm ci && npm test' }] } }

Smoke subset for speed

npx jest --changedSince=origin/main

Common mistakes

  • Letting the suite rot with skipped tests.
  • Slow suites that people stop running.
  • Fixing bugs without a regression test.

Key takeaways

  • Re-test after every change.
  • Turn each bug into a test.
  • Automate in CI.

FAQ

Regression vs retesting?

Retesting verifies a specific fix; regression checks everything else still works.

How often?

On every commit or pull request.

More General articles