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.
- The app installs and launches.
- Sign in and sign out work.
- The main screens load with data.
- The primary flow completes end to end, for example search, add to cart, pay.
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
- Everything near the change: same screen, same API, same shared component.
- The flows that make money or that most users use.
- Areas that broke before. Bugs cluster.
- Anything touched by a library, SDK or OS update.
Keep the suite healthy
- Add a test for every bug you find, so it can't come back unnoticed.
- Remove tests for features that no longer exist.
- Automate the stable, repetitive parts and keep manual time for new features.
When you report a regression, say so in the bug: see "Is it a regression?" in Bug reports.
How they fit together
- New build arrives: run the smoke test.
- Smoke passes: run sanity on the fixes in this build.
- Before release: run the regression suite.