Skip to content
>devspeak
← glossary
level 6Testing & Reliability

Regression test

also: regression tests, regression testing

A test that makes sure something that already worked still works after a change. It's often written right after fixing a bug, so the bug can't quietly return.

a bit more technical

Any test whose job is to catch regressions: correct behavior breaking after a change. In practice, it's often a test added alongside a bug fix that reproduces the original bug, so the suite fails if the bug ever returns.

picture it

A pilot's pre-flight checklist grows every time something goes wrong. Each item exists because of a past problem, and it gets checked on every flight from then on.

why it matters

Agents change lots of code quickly. A bug fixed last month can return when an agent rewrites nearby code. A regression test makes the fix stick: the suite fails loudly if the bug comes back.

what your agent might say
agent
Fixed the double-charge bug. I added a regression test that submits the payment form twice quickly and checks that only one charge is created.
how you might use it
you → your agent
Before you fix the time zone bug, write a regression test that fails because of it. Then fix the bug and show me the same test passing.
common mistake

Thinking regression tests are a special tool. They're ordinary tests; what makes them regression tests is their job: guarding behavior that already works.