Blog

Smoke testing in software: what it is, with examples

A smoke test is a short check that a new build works at all before anyone tests it in depth. What it covers, when it runs, an example and smoke vs sanity.

Smoke testing is a short, shallow run through the most important parts of a new build to find out whether it works well enough to be worth testing properly. It does not try to find every bug. It asks one question: does the software start, and do its main paths work end to end? If the answer is no, the build goes back to the developers and nobody spends a day testing something that was broken from the first click.

If you pay for or run a software project and your team reports that a build “passed smoke”, this guide explains what that does and does not tell you. It covers where the name comes from, what a smoke test should and should not check, when it runs, a worked example, and how it differs from sanity testing, regression testing and user acceptance testing. What software testing is covers the rest of the field.

The example is an invented plant nursery that sells plants online and delivers them locally. Neither the business nor its figures are real.

What is smoke testing?

The name is usually traced to hardware, where the crudest first check of a new circuit board is to switch it on and see whether it starts smoking. Steve McConnell’s 1996 article Daily build and smoke test, which described the practice at Microsoft and other packaged-software companies, called it “a relatively simple check to see whether the product ‘smokes’ when it runs.” It is also called build verification testing.

McConnell set out three properties that still describe a good smoke test. It should “exercise the entire system from end to end”, so every major part is touched at least once. It “does not have to be exhaustive”, because its job is to expose major problems quickly. And it should be thorough enough that a build which passes “is stable enough to be tested more thoroughly.”

That last point is how the testing profession uses smoke tests today. The ISTQB’s syllabus for the Foundation Level exam, in section 5.1.3 of version 4.0.1, lists “all smoke tests have passed” among its examples of entry criteria: the conditions that have to be true before a round of testing begins. Passing smoke does not mean the build is good. It means the build has earned the right to be tested.

You may also see smoke testing in plumbing and sewer work, where crews blow harmless artificial smoke into pipes to find leaks. That is a different trade with the same name, and nothing in this guide applies to it.

What a smoke test checks, and what it leaves out

A smoke test goes wide and stays shallow. It follows the paths that make the software worth having, one check per path, and a single failure is enough to reject the build. In a web application those paths are usually:

  • It starts. The application loads, the server answers and the pages render without errors.
  • People can get in. A test account can sign in, and an administrator can reach the admin area.
  • The core task works. Whatever the software is for, one person can do it from start to finish: place an order, book a slot, submit a form, publish a record.
  • Data moves. Something written in one place can be read back in another, which proves the database and the main connections are up.
  • The outside services answer. Payment, email and any other service the software depends on respond, using their test or sandbox modes.

A smoke test does not try invalid input, unusual browsers, edge cases, permissions for every role or performance under load. Those belong to the full test cycle that follows. A smoke suite that tries to cover them stops being quick, and a slow smoke test gets skipped.

When smoke tests run

Smoke tests run at the points where a broken build would otherwise waste somebody’s time.

  • On every new build. Microsoft’s Well-Architected guidance on testing recommends creating “fast smoke tests that run on every commit, and broader regression tests that run nightly or before release.” A failed smoke run stops the pipeline before the slower stages start.
  • Before a test cycle begins. When a build is handed to testers, the smoke test is the entry check from the syllabus. If it fails, the testers reject the build instead of logging fifty defects that all have the same cause.
  • After every deployment. A build that passed in one environment can still fail in the next because of a missing setting, a database that is not reachable or an expired certificate. The same guidance notes that “a simple smoke test against a health endpoint” catches the gap between infrastructure that was set up correctly and an application that cannot use it.
  • After a production release. A short, careful version of the smoke test confirms that real users can do the main things. That one needs its own rules, covered below.

Where a smoke test sits, as five linked steps. 1, a new build is compiled and deployed to a test environment. 2, the smoke test runs for a few minutes on the main paths only; if it fails, the build goes back to the developers. 3, if it passes, full testing follows: functional checks and regression. 4, after each deployment, the same smoke test runs again on the new environment. Last, the release goes ahead once full testing has passed and every smoke run is green.

A smoke testing example

The nursery sells about four hundred kinds of plant through its own website. Customers search, add plants to a cart, enter a zip code to see the delivery days, and pay by card. Staff use an admin area to see each day’s orders and print delivery sheets. A developer has just finished a change to the delivery-day calculation, and a new build is ready for the test environment.

Before anyone tests the delivery change itself, the build gets the nursery’s smoke suite. It has eight checks and takes about four minutes:

Check Passes when A failure usually means
1. Health check The status address answers and reports the database as reachable The server, the settings or the database connection is broken
2. Home page It loads with no errors and shows at least one plant Pages fail to build, or the catalog is empty
3. Search Searching "fern" returns results The search index is missing or out of date
4. Product page A plant's page shows a price and an add button Prices or stock are not loading
5. Cart Adding one plant shows one item in the cart Sessions or the cart service are broken
6. Delivery days A local zip code returns at least one delivery day The changed calculation, or its data, fails outright
7. Checkout An order goes through with the payment provider's test card The payment keys or the order step are broken
8. Admin A staff test account signs in and sees the order from check 7 Sign-in, roles or order saving are broken

On this build, check 6 fails: every zip code returns no delivery days at all. The build goes straight back to the developer with the failing check attached. Nobody has spent time on the detailed delivery tests, which would all have failed for the same reason, and nobody has tried the build’s other changes on a version that could not take an order.

Two things about the example are worth copying. Check 6 tests the area that changed, but only at the level of “does it work at all”; whether Saturday deliveries are offered correctly is a job for the detailed tests. And check 8 reads back the order made in check 7, so the suite proves that data travels from the shop to the staff.

Smoke testing vs sanity testing

This is where the vocabulary gets loose. The ISTQB Foundation syllabus does not use the term sanity testing at all, and teams use it in two different ways:

  • As a narrow check after a change. A fix or a small change arrives, and someone confirms that the changed area behaves sensibly before deciding whether it needs more testing. This is the meaning most testing guides give.
  • As another name for smoke testing. Some teams say “sanity check” for exactly the wide, shallow run described above.

Where a team uses the first meaning, the two differ like this:

Question Smoke testing Sanity testing
What it asks Does the build work at all? Does the changed part behave sensibly?
How far it reaches Every main path, one check each The changed area and what touches it
When it runs On each new build and each deployment When a fix or small change arrives
Usually written down Yes, as a fixed suite, often automated Often not; frequently a quick manual look

In the nursery example, the smoke suite runs on the whole build. A sanity check would be a tester trying a handful of zip codes after the developer’s fix, to see that delivery days look plausible before the detailed delivery tests start. Because the word means different things in different teams, ask what it means on your project before you rely on a report that says “sanity passed”.

Smoke testing vs regression testing

Both run again and again, which is why they get confused. They differ in depth and purpose. A smoke test asks whether the build can be tested at all. Regression testing asks whether a change has broken something that used to work, and to answer that it has to go much deeper than one check per path.

Smoke testingRegression testing
PurposeReject a broken build earlyCatch side effects of a change
SizeA handful of checksOften hundreds or thousands of tests
Run timeMinutesMinutes to hours, depending on the suite
OrderFirstAfter smoke has passed
A failure meansStop: the build is not testableInvestigate: something that worked has changed

A smoke suite is often a small slice of the regression suite: the few tests that touch every main path, tagged so they can run on their own. That is fine, as long as it stays a slice and does not grow into a second full suite.

Smoke testing vs user acceptance testing

They sit at opposite ends of the testing. A smoke test is one of the first checks a build meets, usually run by developers or the pipeline, and it asks whether the build is fit to be tested. User acceptance testing is one of the last, carried out by the software’s future users, and it asks whether they will accept it for their work. A build that fails smoke never reaches acceptance. Many teams also run a quick smoke test on the acceptance environment before users start, so they do not lose a morning to a broken deployment.

Smoke testing in production

Running smoke tests against the live system right after a release is common and sensible, because some failures only appear there. Microsoft’s guidance on testing in production is to plan, isolate and monitor every production test, with safeguards that limit the effect on users. For a smoke test, that comes down to a few rules:

  • Prefer checks that only read. Loading pages, searching and calling a health address change nothing.
  • Use dedicated test accounts. A production smoke test signs in as an account that exists for testing, never as a real customer or member of staff.
  • Do not create real business. An order placed in production must not reach the warehouse or a real card. Use the payment provider’s own test arrangements where it offers them, or stop the check before payment.
  • Clean up after it. Anything the test does create is marked as a test and removed.
  • Know what happens on failure. Decide in advance who is told and whether the release is rolled back, so a failure at 6 p.m. leads to action.

Manual or automated smoke tests

A smoke test can be run by hand from a short written checklist, and on a new project that is often where it starts. It becomes most useful once it is automated, because it can then run on every build without anyone remembering to do it.

Automated smoke tests need no special tool. They are usually ordinary tests, written in the same framework as the rest, and marked so they can run on their own. Playwright, for example, lets a team tag tests and run only the tagged ones from the command line. What matters is that the smoke suite has a fixed list of checks and a place in the pipeline where a failure stops everything after it.

How to write a smoke test suite

  1. List the paths that make the software worth having. Ask what would make users give up on it entirely if it stopped working. For many applications that is a short list, often fewer than ten paths.
  2. Write one check per path. Each check follows the path from start to finish and confirms only that it completes. Leave the variations to the detailed tests.
  3. Chain checks where you can. A check that reads back what another check created proves the connection between them, as the nursery’s admin check does with the test order.
  4. Keep it fast and stable. Set a time limit for the whole suite and keep to it. McConnell noted that a smoke test can grow from seconds to “30 minutes, an hour, or more” as a system grows; a suite meant to run on every build has to stay within minutes. A check that fails at random teaches people to ignore red results, so fix it or remove it at once.
  5. Make a failure stop the line. Agree that a failed smoke test means the build is rejected, and that fixing it comes before other work. McConnell’s article made fixing a broken build the team’s top priority.
  6. Review it as the software changes. When a new main path appears, add a check; when a feature is retired, remove its check. In McConnell’s words, the smoke test “must evolve as the system evolves.”

Common mistakes with smoke tests

  • Letting it grow into a full suite. Every check someone adds “just to be safe” makes it slower, until it no longer runs on every build.
  • Checking that pages open, not that they work. A page that loads but cannot save anything passes a shallow check and fails every user.
  • Ignoring failures. If a failed smoke run is overridden to keep a deadline, the gate means nothing.
  • Never running it after deployment. A build that passed on a developer’s machine has not proved anything about production settings.
  • Not owning it. A suite nobody is responsible for drifts out of date, and its checks start testing features that no longer exist.

Questions people ask

Is smoke testing functional testing?

Mostly, yes. A smoke test checks that the main functions work, so its checks are functional. The ISTQB syllabus files them a little differently: its testing quadrants (section 5.1.7) put smoke tests in the technology-facing quadrant that critiques the product, next to non-functional tests, and note that the tests there are often automated. Some teams add a quick non-functional check, such as a page loading within a time limit, which fits as long as the suite stays fast.

Who performs smoke testing?

Whoever receives the build first. In a team with an automated pipeline, the pipeline runs it on every build and developers fix what it finds. Where builds are handed to a separate testing team, the testers run it before accepting the build. After a release, it is usually whoever carried out the deployment.

How long should a smoke test take?

Short enough that nobody is tempted to skip it. Microsoft’s guidance asks for “fast” smoke tests on every commit; in practice that means minutes rather than hours. If yours has grown so long that it only runs overnight, it has become a regression suite under another name.

What happens when a smoke test fails?

The build is rejected and goes back to the developers with the failing check, and deeper testing waits until a new build passes. After a production release, the team follows the plan it agreed beforehand, which is often to roll the release back.

Where the smoke suite comes from

A smoke suite is easiest to write from the scope document. The main paths are already listed there, and each one becomes a check. Two questions are worth putting to whoever builds your web application: what runs on every new build, and what happens when it fails?

To talk through a web application you have in mind, read how our custom web development work runs, or send us a few lines about it. We answer within one business day.

The full service behind this post: Custom Web Development Services.

Ready to scope your project?

Send us two sentences about what you need. We reply within one business day with the next step and any questions we need answered first.

Get a Quote