Skip to content

What it is

A regression is a defect that breaks functionality that used to work, or reintroduces a bug that had been fixed, after a change to the codebase.

A regression is not a bug in new code. It is a bug in old code, caused by new code. The feature worked before the change, and does not work after. The cause is often an unexpected coupling: a shared utility that was modified, a global that was reassigned, a database index that was dropped during a migration, a dependency that was upgraded.

The word also has a non-defect sense: a regression test is a test whose purpose is to detect such defects. The test asserts that a specific behaviour continues to hold after changes. It is written once, ideally before the code it protects, and runs forever.