Smoke testing
A smoke test is the small, fixed set of checks that decides whether a build is worth anyone's time — which is why it does not try to find bugs. It answers exactly one question, and it has to answer within a few minutes, or the answer arrives too late to change what happens next. That single purpose explains everything else about it: why the suite is small, why it never grows, why it runs after every deploy to every environment, and why a smoke suite that takes forty minutes has quietly stopped being a smoke suite.
- It answers
- One question
- Time budget
- Minutes, not tens
- Runs after
- Every deploy
It is a gate, not a level of testing
Unit, integration and end-to-end are levels: they describe how much of the system a test touches. Smoke is not one of those. It is a purpose, and it can be built out of tests at any level — an API call, a browser flow, a health probe, whatever answers the question fastest. The question is always the same one, and it is about the build rather than about the feature: has this deployment come up in a state where further work makes sense?
The name comes from hardware. You assemble a board, apply power, and look for smoke — you are not measuring anything, you are checking that the thing has not obviously destroyed itself before you invest in measuring it. Software borrowed the metaphor exactly. In continuous delivery the same suite is often called a build verification test, and the two names describe the same object: a small fixed set of checks that runs immediately after a build is deployed and produces one binary verdict.
What belongs in the suite, and the rule that keeps it small
There is one selection rule and it is worth stating as a sentence you can apply to any candidate check: include it only if a failure means nobody can do useful work on this build. Not "this is important". Not "this broke once". If the check fails and a tester could still spend a productive afternoon, the check belongs in the regression suite instead. Applied honestly, that rule usually produces between five and fifteen checks for a normal product.
| Candidate check | In the smoke suite? | Why |
|---|---|---|
| A user can sign in | Yes | Nothing behind the login can be tested if this fails, so the whole build is blocked by one check. |
| The main flow completes once, on the happy path | Yes | Proves the assembled system can do the thing it exists to do, which no health probe can tell you. |
| Every dependency responds — database, queue, payment provider sandbox | Yes | A missing connection string is the single most common reason a fresh environment is useless. |
| The version endpoint returns the commit you deployed | Yes | Cheap, and it catches the deploy that silently did nothing — the failure that wastes the most time. |
| Validation messages on the registration form | No | Real work, but a tester can carry on around it. Regression suite. |
| The bug from last release, re-checked | No | That is confirmation testing and then a permanent regression case — smoke is not where memory lives. |
| A slow report that takes four minutes to generate | No | One check would consume the entire time budget, which is what makes the gate useless. |
The time budget is not a nice-to-have; it is the mechanism. A gate only works if the answer arrives before the decision is made, and the decision here is "should the next person start". Under five minutes is a good target for most products and under ten is a defensible ceiling. Beyond that people stop waiting for the result, start work in parallel, and the gate becomes a report that arrives after the damage.
Where it runs — and it runs in more than one place
Most teams have one smoke suite and run it in one place, usually after deploying to a test environment. The suite is more useful than that, because the same set of checks answers a slightly different question in each environment it runs in, and the cost of running it again is minutes.
After a deploy to test
The classic position. Answers "is this build worth handing to QA", and its result should gate the handover rather than accompany it as a note.
After a deploy to staging
Answers a different question: is the ENVIRONMENT correctly configured. Most failures here are secrets, connection strings and DNS rather than code.
After a deploy to production
A read-only subset, plus one safe write if you have a test account. This is the check that decides whether an automated rollback fires, so it must be wired to the rollback.
On a schedule in production
The same checks every few minutes are synthetic monitoring: they find the breakage that no deploy caused — an expired certificate, a dependency that went down on its own.
Smoke before the merge
- Runs against a preview or ephemeral environment built from the branch.
- Answers "did this change break the basics" while the author is still there to fix it.
- Cheapest possible feedback, but it cannot see anything about the real environment.
- Fails for code reasons — a missing route, a broken build, a crash on startup.
Smoke after the deploy
- Runs against the environment that was actually deployed, with its real configuration.
- Answers "did this deployment succeed", which is a different question from "is the code correct".
- The only one of the two that can trigger a rollback, because only it knows what is live.
- Fails for environment reasons — a missing secret, a stale image, an unreachable dependency.
Both are worth having and they are not substitutes, because they fail for different reasons. The pre-merge run protects the main branch from obviously broken code; the post-deploy run protects the environment from a deployment that went wrong in a way the code could not predict. If you can only afford one, take the post-deploy run: a broken branch costs one developer an hour, a broken environment costs a team a day.
Smoke, sanity, confirmation — three names people use interchangeably
These terms get swapped freely in job interviews and in team chat, and the confusion is worth clearing up once because the three describe genuinely different moments. All three are small and fast; what differs is what triggers them and what their result licenses you to do.
Smoke
Triggered by a build or a deploy. A fixed set, the same every time. Its verdict decides whether anyone else starts work.
Sanity
Triggered by a specific change. Narrow and improvised — you look at the area that changed to decide whether deeper testing is worth booking.
Confirmation
Triggered by a fix. You re-run the exact steps from the bug report to prove the specific defect is gone. It then becomes a regression case.
What has to be true for the gate to actually work
A smoke suite is easy to write and easy to render meaningless. Four conditions decide which of the two you end up with, and each of them is an organisational choice rather than a technical one.
- It blocks. A red smoke run stops the handover, stops the promotion, or triggers the rollback automatically. A suite whose failure is discussed rather than obeyed is a dashboard.
- It is trusted, which means flakiness is an incident. One check that fails randomly twice a week teaches everyone to re-run the suite instead of reading it, and that habit costs you the real failure.
- It has an owner. Not "QA" as a department — a named person or rotation who is expected to fix a red smoke run today rather than file it.
- It is fast enough that people wait for it. Every minute added is a minute of someone standing still, which is exactly the pressure that makes teams start work before the result arrives.
Flakiness deserves the strongest of those four, because it is where smoke suites usually rot. A flaky check in a regression suite is annoying; a flaky check in a smoke suite is corrosive, since the whole mechanism depends on a red result being believed without discussion. The policy that works is blunt: a check that fails without a real cause is quarantined the same day — removed from the gate, kept running and reported separately — and either fixed within a fixed window or deleted outright. Leaving it in the gate "because it is usually right" is the decision that destroys the gate.
Anti-patterns worth naming
- A suite of HTTP 200 checks. A page that returns 200 with an error rendered inside it passes, which is the exact failure users would report first.
- Smoke run manually, when someone remembers. An unrun gate protects nothing, and the day it is skipped is the day it was needed.
- Results posted to a channel with no consequence attached, so a red run is information rather than an instruction.
- The same suite kept identical in production while it writes real data — one forgotten test order per deploy becomes a finance question by the end of the quarter.
- Treating a green smoke run as a quality statement. It says the build is testable, and nothing whatsoever about whether the feature is correct.
When to use it
Use it when
- Immediately after every deploy to every environment, including production, where a read-only subset is enough.
- As the gate on handing a build to anyone else — testers, a demo, a customer environment.
- Wired to an automatic rollback in production, so the answer produces an action rather than a notification.
- On a schedule against production as synthetic monitoring, to catch breakage that no deployment caused.
Avoid it when
- As a place to store cases about bugs that must not return — that is what the regression suite is for.
- For anything that takes minutes on its own, however valuable, because one such check consumes the whole budget.
- As evidence that a release is ready. A green smoke run says the build is testable, not that it is correct.
- With any check that has ever been flaky and was left in anyway, because the gate is only worth its credibility.
Found this useful?
Share it with someone who is working on the same problem.