Smoke testing vs sanity testing
Smoke testing vs sanity testing explained with examples: what each checks, when to run it, who runs it, and how both relate to regression testing.
Smoke testing is a quick, broad check that a new build works well enough to test at all. Sanity testing is a quick, narrow check that one specific change or fix works. Both are short; the difference is breadth. Smoke testing touches many features lightly, sanity testing looks at one area closely.
The differences at a glance
| Smoke testing | Sanity testing | |
|---|---|---|
| Question | Is this build stable enough to test? | Does this change or fix work? |
| Breadth | Wide: the most important features | Narrow: one area |
| Depth | Shallow | A bit deeper in that area |
| When | On every new build, first | After a small change or bug fix |
| Scripted? | Usually a fixed, automated list | Often unscripted or a short list |
| If it fails | The build is rejected; no further testing | The change goes back to the developer |
Examples
Take an online shop that just got a new build with a fix for discount codes.
- Smoke test: the home page loads, a user can sign in, search returns products, an item can be added to the cart and checkout opens. Five minutes, every build.
- Sanity test: apply a valid discount code, an expired one and an invalid one; check the totals and the error messages. Ten minutes, only because the discount code logic changed.
- Regression test: afterwards, the full regression suite checks that nothing else broke, from sign-up to order history.
Smoke vs sanity vs regression testing
The three often run in this order. Smoke testing decides whether the build is worth testing. Sanity testing confirms the specific change works. Regression testing then checks that the change did not break anything else. Smoke and sanity tests are small enough to run many times a day; a full regression suite usually runs before release.
| Smoke | Sanity | Regression | |
|---|---|---|---|
| Covers | Critical features, lightly | One changed area | Everything that worked before |
| Time | Minutes | Minutes | Minutes to hours |
| Runs | Every build | After a change | Before release, or on every merge for critical tests |
Should you automate them?
- Smoke tests: yes. They are the same every time and run on every build, so automation pays back quickly.
- Sanity tests: partly. Many are quick manual checks of a fresh change; the useful ones can join the regression suite afterwards.
- Keep smoke tests few and stable. A flaky smoke test blocks every build. See flaky tests.
Tebugging runs tests automatically with real-time monitoring, so a smoke run on each new build shows results as they happen. Its AI-powered reporting and analysis summarize the results. Definitions of both terms are in the QA glossary.
Frequently asked questions
Is sanity testing a subset of regression testing?+
It is often described that way: a small, focused part of regression testing around a recent change. In practice it is a quick check run before the wider regression suite.
Who performs smoke and sanity testing?+
Smoke tests are usually automated and run by the CI system, or by QA on each new build. Sanity tests are usually done by QA or by the developer who made the change.
Can a test be both a smoke test and a sanity test?+
Yes. Checking that sign-in works is part of the smoke test, and it is also the sanity test after a fix to sign-in. What changes is why and when you run it.
Keep reading
New to a term? See the QA and AI testing glossary.
Plan, run and analyze your web tests with AI.
Start on the free plan. No credit card required.
Start Testing Free