Regression

Definition
A regression is when a change breaks something that used to work, often somewhere that looks unrelated to what was actually changed.

Why it matters

Regressions are damaging because the broken part rarely looks connected to the change. The person who made the change has no reason to check it, so a customer notices instead. The risk rises with speed. When an AI coding agent writes much of the code, it can touch many files in one go, which multiplies the places a small change can reach. A product that regresses often teaches customers not to trust updates.

What it is

A regression is a step backwards. A feature worked yesterday, someone changed something else today, and now the feature is broken. The name comes from the product moving back to an earlier, worse state. The cause is usually hidden connections: two parts of the software share a piece of logic, so a change in one quietly alters the other.

Common mistakes

  • Testing only the feature that was just built.
  • Fixing a bug without adding a test, so it comes back months later.
  • Letting tests fail and ignoring them, until nobody trusts the suite.

How to prevent them

  • Keep automated tests that re-check old behaviour every time the code changes. These are called regression tests.
  • Cover the paths that would hurt most first: taking payment, logging in and the core workflow. Do not wait for full coverage.
  • Add a test the moment a bug is found, so that exact bug cannot return unnoticed.
  • Run the whole suite before each release, not only the tests near the changed code.
  • Check changes in a staging environment before real users see them.
Worked example

Suppose a small SaaS team changes how its invoice export rounds VAT. The change passes review, but two days later a customer notices that the monthly summary report is a few cents out. The rounding function is shared with that report, and nobody checked it. The team adds a test for the report and a second test for the exact bug, so neither can return unnoticed. GitHub runs those builds and tests on every change before the code ships. The next time someone edits the rounding logic, the report test fails within minutes, and the fix happens before any customer sees it.

Tools in the example

Some links are affiliate links: we may earn a commission at no cost to you. It never decides a ranking. How we work with partners

  1. Article

    Test coverage

    How much of the code the tests exercise.

  2. Article

    Code review

    A human check for what automated tests miss.

  3. Article

    Staging environment

    A last place for a regression to show up.

  4. Article

    Rollback

    The way back when one still reaches users.

Where it shows up

  • Writing copy that feels like conversation instead of marketing. How to sound like yourself.
    12 chapters