How do smoke, sanity and regression testing differ?
Smoke quickly checks the key paths of a new build to see if it merits further testing, while regression looks for what changes broke in existing behaviour. Smoke runs on every build, often automatically after deploy, and a red result blocks testing. Checking a specific fix is called confirmation testing (a retest). The word sanity is used differently across teams, so clarify its meaning.
QA Fundamentals · Types of testing
A new build arrived at 10:00. Run the full regression or first check that it is alive?
The build is installed, the tester starts on a new feature and two hours later finds that login returns 500, so the two hours went into a build that does not work. This is what smoke is for: to check in a few minutes whether the build is worth further testing. The lesson covers smoke and regression, their place in the process and the word "sanity", which causes the most arguments in teams.
How it works and why. Testing has a cost, and testing a broken build deeply means paying for results that will be thrown away. So the cheapest check goes first, the one that filters out obvious junk: a smoke test is a small set of checks of the most important paths (the app starts, login works, the main operation completes). It is fast, wide and shallow, runs on every new build, often automatically after deployment. The result is binary: the build is accepted for testing or sent back.
Where smoke sits in the process
Regression testing has a different goal: to find unintended consequences of changes, that is, something that worked and suddenly broke. It repeats existing checks in a chosen scope (by risk, see the lesson on regression scope) and runs before a release and after significant changes. There is also a separate action that ISTQB calls confirmation testing: checking that a specific bug is fixed. All three answer different questions.
| Kind | Question | Scope and moment |
|---|---|---|
| Smoke | Is this build worth testing? | A few key paths, every build |
| Regression | Did the changes break existing behaviour? | A broad selection of existing checks, before a release |
| Confirmation (retest) | Is the specific bug fixed? | The steps from the report, after a fix |
What about "sanity". The word is used inconsistently. Some teams use it for a narrow check of a specific change or fix after a small update, others for a quick check of a build (a synonym of smoke), others simply for a "reasonableness check" of results. The ISTQB CTFL 4.0 syllabus does not single out sanity as a separate kind: checking a fix is described there as confirmation testing, and earlier glossary versions listed sanity test as a synonym of smoke test. So there is no crisp textbook distinction to "learn". In an interview it is more effective not to guess but to ask: "What do you call sanity?" and name your own terms and what they mean.
Example: a smoke set that works and one that has grown. The typical degradation: after every missed bug another case is added to smoke, and a year later there are sixty.
Contents of a smoke set
A smoke set of 60 cases
It takes two hours, so it runs once a day instead of on every build. Nobody treats a red result as a stop. The gate function is lost.
A smoke set of 6-10 cases
Ten minutes, every build, automatically after deployment. A failure means a blocker, and testing of the build stops until a new one arrives.
For a banking app a small list looks like this:
Smoke, build 2.14 (about 10 minutes)
[ ] the app starts, the footer shows version 2.14
[ ] login with a test account works
[ ] the account list loads
[ ] a 1 UAH transfer between own accounts succeeds
[ ] the statement opens
[ ] logout works
Criteria for a smoke case: it is critical for the product to work, stable, fast, independent of other cases, and its failure really means "the build is unusable". Validation of every form field or rare scenarios do not belong here.
Limits and alternatives. Smoke does not find deep bugs and does not prove quality: green only says the build is not broken in the main things. Regression does not guarantee absence of bugs either, it only repeats known checks. Automate smoke first (stable, repeatable, needed on every build) and the core of regression, while new functionality is still explored by hand. In CI smoke usually is the first stage after deployment to a stand.
Common mistakes.
- Continuing to test a build that failed smoke: time goes into bugs that disappear with the next build.
- Inflating smoke into regression: it stops being a fast signal.
- Running smoke but not blocking the build on red: then the check is a formality.
- Calling regression "everything again": without scope and risks it is not a strategy but wasted time.
- Arguing about the "right" definition of sanity instead of agreeing on terms within the team.
Check yourself
Smoke stopped at login: the server returns 500. You have 40 cases ready for a new reports feature. What do you do?
Answer
I stop testing this build: the reports feature is unreachable without login, and results on a broken build cannot be trusted. I file a blocker with the request example, tell the team and wait for a new build, after which I repeat smoke.
The interviewer asks: "How does sanity differ from smoke?" How do you answer?
Answer
First clarify what is meant, because the term is used in different ways and ISTQB does not single it out as a type. Then name your own: a quick check of a build I call smoke, a check of a specific fix confirmation testing (retest), and a broad check that existing behaviour is intact regression.