Smoke Testing vs Sanity Testing: Differences With Real Examples
Smoke testing asks “is this build worth testing?” Sanity testing asks “does this fix make sense?” Learn the difference, with examples and automation tips.
- Smoke testing checks that a new build is stable enough for deeper testing (broad and shallow).
- Sanity testing checks that a specific fix or change works (narrow and deep).
- Smoke runs first on every build; sanity runs after a small change.
- Both are quick and good candidates for automation.
You have just received a new build and the team asks whether it is ready for testing. Do you run the full regression suite, or a quick check first? This is where the smoke testing vs sanity testing question comes up.
The two terms are often mixed up, even in interviews, so this smoke testing vs sanity testing guide keeps it simple. Both act as quick filters, but they answer different questions at different moments.
What is smoke testing?
Smoke testing is a short set of tests that confirms the most critical functions of a build work. The name comes from hardware: switch the device on and see whether smoke comes out. If the app will not start or users cannot log in, there is no point running hundreds of detailed tests. It is also called build verification testing. The ISTQB glossary lists the standard definitions.
A real smoke test example
For an online shop, a smoke suite might open the home page, log in, search for a product, add it to the cart and reach the checkout page. It does not test every payment method or coupon rule; it only proves the main path is alive.
- Application starts and the home page loads
- Login and logout work
- Core search or navigation works
- One key transaction completes
- No critical errors appear in logs
What is sanity testing?
Sanity testing is a focused check after a minor change, such as a bug fix. It confirms that the change works as intended and that closely related functionality still behaves sensibly. It usually runs on a build that already passed smoke testing.
A real sanity test example
Developers fix a bug where the discount code field rejected valid codes. A sanity test applies several valid and invalid codes, confirms totals update correctly and checks that cart and checkout totals still match. You would not retest login or search.
Smoke testing vs sanity testing: comparison table
| Aspect | Smoke testing | Sanity testing |
|---|---|---|
| Goal | Is the build stable enough to test? | Does this fix or change work? |
| Scope | Broad, main features | Narrow, one area |
| Depth | Shallow | Deep in that area |
| When it runs | On every new build | After a minor change or fix |
| Done by | Developers or QA, often automated | Mostly QA, often manual |
| Scripted? | Usually | Often unscripted |
| If it fails | Reject the build | Send the change back |
This smoke testing vs sanity testing table is the quickest way to remember which test to run, and when.
Where they fit in the testing process
A common flow is: new build, smoke test, functional testing, sanity test on fixes, then regression testing before release. In any smoke testing vs sanity testing workflow, smoke protects your time and regression protects your product. For the bigger picture see our guide to end to end testing best practices.
Regression testing re-runs a wide set of existing tests to make sure nothing else broke. Think of smoke as the door check, sanity as the spot check and regression as the full inspection.
How to automate smoke tests
Most frameworks let you tag tests. With Playwright you can mark critical tests with a tag and run only those; see the docs on test annotations and tags.
import { test, expect } from '@playwright/test';
test('home page loads @smoke', async ({ page }) => {
await page.goto('/');
await expect(page).toHaveTitle(/Shop/);
});
test('user can log in @smoke', async ({ page }) => {
await page.goto('/login');
await page.getByLabel('Email').fill('user@example.com');
await page.getByLabel('Password').fill('Secret123');
await page.getByRole('button', { name: 'Log in' }).click();
await expect(page).toHaveURL(/dashboard/);
});
npx playwright test --grep @smoke
Run the smoke suite as the first job after deployment to a test environment, and stop the pipeline if it fails. Our GitHub Actions CI/CD guide shows how, and the best test automation tools for 2026 list helps you choose a framework.
Quick tip: A few API calls (health check, login, one read, one write) make a fast, stable smoke test. See our API testing with Postman guide.
Smoke and sanity testing checklist
- Keep the smoke suite under 10 minutes, ideally under 5.
- Cover only business-critical paths.
- Make the result binary: pass means proceed, fail means reject the build.
- Write a one-line goal for every sanity test before you start.
- Record what changed so you can pick related scenarios.
- Review both suites every sprint and remove checks that no longer matter.
Common mistakes to avoid
- Letting the smoke suite grow until it becomes a slow regression suite.
- Skipping sanity checks because the fix “looks small”.
- Using flaky tests in the gate, which teaches the team to ignore failures.
- Mixing up smoke testing vs sanity testing in reports, which causes confusion in stand-ups and interviews.
Final thoughts
Smoke testing asks “is this build worth testing?” and sanity testing asks “does this change make sense?” Understanding smoke testing vs sanity testing keeps regression time focused and releases safer. Tag five to ten critical tests as smoke, run them on every build and apply a short sanity checklist whenever a fix lands.
Frequently asked questions
What is the main difference between smoke and sanity testing?
Smoke testing is a broad, shallow check of a new build’s critical functions. Sanity testing is a narrow, deeper check of a specific fix or change.
Which comes first, smoke or sanity testing?
Smoke testing normally comes first on a fresh build. Sanity testing follows when a small change or bug fix is added to a build that already passed smoke testing.
Can smoke testing be automated?
Yes. Smoke tests are stable, repeatable and quick, which makes them ideal for automation and CI pipeline gates.
Is sanity testing a subset of regression testing?
Many teams treat it as a quick subset of regression testing focused on the changed area, though it is usually less formal and often unscripted.
How long should a smoke test take?
Aim for a few minutes at most. If it takes much longer, move the non-critical checks into your regression suite.
Keep learning
Need help with testing, WordPress or SEO?
We help teams ship better software and grow their sites. Tell us what you are working on and we will suggest a clear next step.