Smoke, sanity and regression testing

Three kinds of testing that answer three different questions after a new build: does it work at all, does the fix work, and did anything else break?

At a glance

Type Question Scope Time
Smoke Is this build stable enough to test? Wide and shallow Minutes
Sanity Does this fix or change work? Narrow and focused Minutes to an hour
Regression Did the change break anything that used to work? Wide and deep Hours to days

Smoke testing

A quick check of the most important paths on every new build. If smoke fails, stop and send the build back. There is no point running a full test pass on a build that can't sign in.

Automate itSmoke tests run on every build, so they are the first tests worth automating.

Sanity testing

A focused check of one fix or small change, plus the area right around it. It tells you whether the build is ready for deeper testing.

Fix: "Pay button stays disabled after entering a valid card"

Sanity:
1. Enter a valid card: Pay is enabled
2. Enter an expired card: Pay stays disabled, error shows
3. Edit the card number after a valid one: Pay updates correctly
4. Pay: the order goes through

Regression testing

Re-running tests on features that already worked, to make sure new code didn't break them. A bug that comes back, or a feature that stops working after a change, is a regression.

How to pick what to retest

Keep the suite healthy

When you report a regression, say so in the bug: see "Is it a regression?" in Bug reports.

How they fit together

  1. New build arrives: run the smoke test.
  2. Smoke passes: run sanity on the fixes in this build.
  3. Before release: run the regression suite.