smoke test

term

programmingops culture

Kept in this browser · My desk

A quick, shallow check that a newly built or newly deployed system starts and does its most basic things without failing badly, run before any deeper testing. It does not prove that the system works; it proves that testing it further is worth the time. In plumbing and electronics, where the name began, it meant blowing smoke through pipes or switching on a new circuit.

Steve McConnell's essay Daily Build and Smoke Test (1996) made the software sense standard: every file compiled and linked into the product every day, then the product put through a simple check of whether it smokes when it runs, a practice he described at Microsoft and other shrink-wrap software companies. The same idea now closes a deployment: once a release is live, a smoke test asks for its key pages or endpoints and confirms which version answered.

Four senses, one idea. Wiktionary records the word's senses in an order that reads like its history. In plumbing, a smoke test finds leaks by blowing smoke into a pipe and watching where it comes out. In electronics, it is the first application of power to newly built equipment, to make sure no gross wiring error makes the circuit smoke, catch fire or explode. By extension, it is the same kind of first check on any other system, a computer program among them: not an exhaustive test of what it does, only a test that it will not fail catastrophically when switched on. And in theatre, it checks that stage smoke will not set off the building's alarms. The thread through all four is the same: cheap, early, and aimed at the failures so gross that nothing else is worth testing until they are ruled out.

The daily build. Steve McConnell's essay Daily Build and Smoke Test, from 1996, explains why software adopted the word. On a team project with dozens, hundreds or thousands of files, building the program from its parts is itself a task, and integrating the work of many people is one of its greatest risks. His remedy, which he describes as common at Microsoft and some other shrink-wrap software companies, was to compile, link and combine every file into an executable every day, and then put the result through a smoke test, a relatively simple check of whether the product smokes when it runs. He set three requirements. The test should exercise the entire system from end to end; it does not have to be exhaustive, but it must be able to expose major problems; and it should be thorough enough that a build that passes can be assumed stable enough to be tested more thoroughly. Without it, he wrote, the daily build becomes a time-wasting exercise in getting a clean compile.

A test that grows. McConnell's smoke test is not fixed. It starts by checking something simple, such as whether the system can say Hello, World, and grows with the system, from seconds to 30 minutes or an hour or more. Keeping it current becomes work in its own right: on large projects he describes a build group whose job is the daily build and its smoke test, and Windows NT 3.0 had four people on it full time. The lesson that outlived the daily build is that a smoke test is part of the product, maintained like code, and that a smoke test which no longer reaches the new parts of a system gives a false sense of safety.

What it is not. A smoke test is not a regression test, which checks that what used to work still works, case by case, and it is not a full test suite. Its verdict has two values: go on testing, or stop. Usage around it varies. Wiktionary lists sniff test, smell test, sanity check, sanity test and reality check among its coordinate terms, and teams draw the line between a smoke test and a sanity test in different places. The testing profession's reference vocabulary does not settle it either: the current ISTQB glossary, version 4.8.2, has no entry under smoke test or under confidence testing. The term lives in engineering practice more than in the certification syllabus.

In deployment. The idea moved from the build to the release. After a deployment goes live, a smoke test requests a handful of key addresses, expects them to answer successfully, and confirms that the version the service reports is the one just deployed; a failure is the signal to stop or to roll back. It differs from its neighbours in when it runs and what it sees. A health check runs continuously, so that a load balancer can stop sending traffic to a member that fails it. A canary release sends a small share of real traffic to the new version and watches what happens. A smoke test runs once, right after a change, with requests of its own.

Writing a good one. The practice that McConnell described still holds. Make it fast, so that it runs on every build and every deployment, not only when someone remembers. Make it walk one real path through the system from end to end, not a list of isolated pings. Make it deterministic, so that a failure means a fault and not bad luck. Make it fail loudly and stop what comes next. And let it grow as the system grows, so that the newest part of the product is never the part the smoke test cannot see.

Also known as: smoke testing, smoke check, build verification test, teste de fumaça

← Back to S Back to the glossary