Smoke testing vs sanity testing
Smoke testing asks whether a new build is stable enough to be tested at all, with a quick pass over its main paths. Sanity testing asks whether one change or fix behaves sensibly, with a narrow check of the affected area before deeper testing. Both are shallow gates, and they differ in breadth and in trigger.
The longer version
Both checks are brief, and both decide whether more testing is worth starting, which is why the names get exchanged. The difference lies in what sets each one off and how wide it reaches. A smoke test is set off by a new build and runs across the whole product: the application starts, a user can sign in, the central transaction completes. A sanity test is set off by one change and stays inside the area that changed. Take a release candidate for a ticketing site that carries a fix to the seat map. The smoke test opens the home page, signs in, searches for an event and buys a ticket, and it would run the same way if the build held no seat map fix at all. The sanity test goes to the seat map, picks seats in the block that used to be drawn wrongly, and checks that the map and the basket agree. The first is a fixed set of checks, the same for every build and usually automated. The second is usually unscripted, done by someone who knows what the change was meant to do.
Only one of the two names has an entry in the ISTQB glossary. That glossary defines smoke testing as "a test type to gain sufficient confidence that a test object is ready for planned testing", and the ISTQB Foundation Level syllabus, version 4.0.1, gives "all smoke tests have passed" as an example of an entry criterion. The glossary has no entry of its own for sanity testing. The broad and narrow line drawn here is therefore a working convention, and usage varies: some teams call the check on a new build a sanity check, and some use the two words for one activity. A build verification test is the automated form of the smoke test, bound to the pipeline that produces the build. Whatever the names, two separate questions are being asked, and it helps to say which one is meant. The first is whether this build can be tested. The second is whether this change did what it claimed.
Order follows from scope. The smoke test comes first, since a build that cannot start makes every narrower check pointless. Sanity testing follows on a build that has passed, once for each change that deserves a look. Neither takes the place of regression testing. A smoke test passes on a build whose rarely used paths are broken, and a sanity test looks only where somebody was working, while regression testing re-runs existing tests over the behaviour nobody meant to touch. A sanity test is also wider than a retest. Retesting repeats the exact steps of one reported defect, and a sanity test exercises the area around the change to see whether it is coherent enough for deeper testing. Passing either gate permits further testing and settles nothing about correctness.
Set side by side, the two differ on six points. Trigger: a smoke test runs on every new build, and a sanity test runs when a particular change or fix arrives. Scope: the smoke test is wide and shallow, and the sanity test is narrow and a little deeper. Script: the smoke test is a fixed set, usually automated, and the sanity test is often unscripted. Owner: the smoke test belongs to the pipeline or the build team, and the sanity test to whoever knows the change. Failure: a failed smoke test rejects the build, while a failed sanity test sends the change back and may leave the rest of the build in test. Order: smoke first, sanity after. When to use which follows from the trigger. Run the smoke test on every build that might be tested at all, every release candidate and every deployment to staging included. Run a sanity test when a fix or a small change lands and a full regression pass cannot be fitted in before the decision is due, as with a hotfix the day before a release.
Common questions
Smoke testing vs sanity testing: what is the difference?
Smoke testing checks a whole new build across its main paths to decide whether it is stable enough to test. Sanity testing checks one changed area to decide whether that change is worth testing in depth. The smoke test is broad and belongs to the build, and the sanity test is narrow and belongs to the change. Usage of the two names is not consistent from team to team.
Which comes first, smoke testing or sanity testing?
Smoke testing comes first. A build has to start, sign a user in and complete its central action before a narrower check of one change can mean anything. Sanity testing follows on a build that has passed its smoke test, and it is repeated for each change or fix that needs a quick look before deeper testing begins.
How does sanity testing differ from regression testing?
Sanity testing looks at the area a change was aimed at and asks whether the change behaves sensibly. Regression testing looks at everything else and asks whether behaviour that used to work still does. A sanity test takes minutes and is tied to one change, while a regression run covers the suite and is tied to the build. A change that passes its sanity test still needs the regression run.
Regression testing vs smoke testing: how do they differ?
A smoke test covers a few critical paths in minutes and answers whether the build is usable for testing. Regression testing re-runs a far larger body of existing tests to detect breakage in unchanged areas, and it takes as long as the suite takes. The smoke test acts as the gate: when it fails, the regression run is not started on that build.
Is sanity testing a standard term?
Sanity testing is a working term with no entry of its own in the ISTQB glossary. That glossary does define smoke testing, as a test type to gain sufficient confidence that a test object is ready for planned testing. Some teams use the two names for one check, so it is worth agreeing locally what each one covers.
What is another name for smoke testing?
Smoke testing is often called build verification testing, especially when the check is automated and runs in the pipeline that produces the build. Some teams also say sanity check for the same pass over a new build, which is the main reason the two names are confused. Whatever it is called, the question it answers is whether the build can be tested at all.
Can smoke tests and sanity tests be automated?
Smoke tests are usually automated, since they are the same for every build and run often enough to repay the effort. Sanity tests are usually manual, because each one is shaped by a particular change and is run once or twice. A sanity check that keeps being repeated for the same area is a sign that it belongs in the automated regression suite.
Bug reports that arrive ready to triage.
Collect replay, console, network and browser context with the Free plan.