Skip to content

Smoke test

A smoke test is a fast, shallow check that the essential functions of a system work before investing in deeper testing; the name comes from powering up hardware and checking that nothing smokes.

Definition

What it is

A smoke test answers one question: is this build alive? It does not verify correctness in depth. It verifies that the application starts, that the database answers, that the main route responds, and that nothing obvious is on fire. If the smoke test fails, deeper testing is wasted; if it passes, the expensive suite can run.

Why it matters

The cost of a broken build grows with every step it survives. A smoke test that runs in seconds can stop a broken build before it reaches staging, before it pings a reviewer, before it reaches a user. The economics are simple: spend seconds to save minutes, spend minutes to save hours.

How to do it well

Designing a smoke suite

  1. Pick the critical path

    The routes, jobs or queries whose failure makes the product unusable.

  2. Keep it fast

    If the smoke suite takes longer than a coffee break, it will be skipped.

  3. Fail loudly

    A smoke failure must block the pipeline, not warn and continue.

  4. Do not duplicate

    Smoke tests gate; unit and integration tests verify. Do not turn smoke into a second integration suite.

Common failures

Origin

The plumbing industry used smoke in 1875 to detect leaks in closed pipe systems. Electronics adopted the image: power up a new circuit and see if it smokes. Software borrowed it through Steve McConnell and Microsoft's build process in the 1990s. The image is visceral and survives translation: no smoke means the build is alive.

The phrase smoke test comes from electronic hardware testing. You plug in a new board and turn on the power. If you see smoke coming off the board, you turn off the power and prepare for the next step.

— Cem Kaner, James Bach and Brett Pettichord, *Lessons Learned in Software Testing*
Why smoke tests should always be your first test

Evidence

FAQ

Smoke vs sanity: what is the difference?

A smoke test checks that the build is alive; a sanity test checks that a specific fix behaves as expected. Smoke is broader and shallower.

How many smoke tests?

Enough to cover the critical path, no more. Five to twenty checks is typical.

When should they run?

On every build, before the deeper suite. They are the gate, not the destination.

Can a smoke test be manual?

Yes, but automated smoke tests are cheaper and more consistent.

Connections

Etymology

Origin: metaphor

  • smoke (noun): visible suspension of carbon particles, from Old English smoca
  • test (noun): a trial or proof, from Latin testum, "earthen pot"

Semantic network

Smoke testsoftware-tquality-assanity-tesregressionContinuousBuildcanary-dep

● broader ● narrower ● related

Broader

  • software-testing
  • quality-assurance

Related

Used in the garden

Sources