Smoke vs Sanity Testing: Key Differences
- Average speed
- km/h
- Result
- Finish time
- 50 min
- You entered
- Distance
- 10 km
- You entered
Smoke testing verifies that the most critical functions of a build work before deeper testing begins, while sanity testing checks whether a specific fix or feature works as expected after a change. Smoke tests are broad and shallow, run on every new build; sanity tests are narrow and focused, run only when a particular area was modified. Both are quick checks, but they answer different questions at different stages of the workflow.
Formula
The calculator works out your average pace and speed for a run, walk, or ride. Enter the total time taken and the distance covered, and it returns the average pace in minutes per kilometer and the average speed in kilometers per hour.
Pace is calculated as:
pace = time / distance
Speed is calculated as:
speed = distance / (time / 60)
Where:
- time is the total duration in minutes
- distance is the distance in kilometers
- pace is the average time per kilometer (min/km)
- speed is the average velocity (km/h)
Worked Example
Suppose you finish a 10 km run in 50 minutes. Using the default values from the calculator:
- Pace = 50 min ÷ 10 km = 5.00 min/km
- Speed = 10 km ÷ (50 ÷ 60) = 10 ÷ 0.8333 = 12.00 km/h
The calculator returns a pace of 5.00 min/km and a speed of 12.00 km/h.
What Smoke Testing Really Covers
Smoke testing gets its name from hardware testing: if a device powered on and produced smoke, it failed immediately. In software, a smoke test runs a small set of core scenarios to see if the build is stable enough for further testing. It typically covers the main user journeys—login, homepage load, basic navigation, and key transactions—without diving into edge cases.
For example, after a nightly build, a smoke test might verify that the application starts, the database connects, and a user can log in. If any of these fail, the build is rejected and sent back to developers. This prevents testers from wasting hours on a broken build.
What Sanity Testing Really Covers
Sanity testing is performed after a fix or a small change to confirm that the specific issue is resolved and that no obvious new problems were introduced. It is a subset of regression testing, but narrower. A sanity test might check that a payment form now accepts a corrected date format, without re-testing the entire checkout flow.
Sanity tests are often run when a build is already stable and the change is small. They are not a substitute for full regression testing, but they give quick confidence before more extensive testing proceeds.
Key Differences at a Glance
- Purpose: Smoke tests check build stability; sanity tests check specific fixes.
- Scope: Smoke tests are broad (core features); sanity tests are narrow (one area).
- When run: Smoke tests run on every new build; sanity tests run after a fix or change.
- Depth: Smoke tests are shallow; sanity tests are slightly deeper but still limited.
- Automation: Smoke tests are often automated; sanity tests are frequently manual, though they can be automated too.
- Documentation: Smoke tests usually have a written test suite; sanity tests are often ad hoc.
Common Misconceptions
One common confusion is thinking that sanity testing is just a smaller smoke test. Actually, they have different goals. A smoke test asks, “Is this build ready for testing?” A sanity test asks, “Did this fix work without breaking anything obvious?” Another misconception is that smoke testing replaces unit tests. Unit tests check individual code functions; smoke tests check the integrated system. Both are needed.
People also assume that sanity testing is always manual. While it is often performed manually for speed, automated sanity checks exist, especially in continuous integration pipelines. The key is that they are quick and targeted, not exhaustive.
How to Choose Between Them
In practice, you will likely use both. The decision comes down to the situation:
- Use smoke testing when you receive a new build, regardless of what changed. It is the first gate.
- Use sanity testing when you have a stable build and a developer says, “I fixed the login bug.” You test just that fix.
- If the build is brand new or has many changes, start with smoke testing, then do sanity testing on each specific fix.
- If the build is already stable and only one module changed, sanity testing alone may suffice.
Both are early checks, but they serve different gates in the testing process. Skipping smoke testing risks testing a broken build; skipping sanity testing risks missing a regression in a fixed area.
Common Problems and Pitfalls
A frequent mistake is making smoke tests too long. If a smoke test takes hours, it defeats its purpose. Keep it under 30 minutes, ideally under 10. Similarly, sanity tests should be focused; if you find yourself testing unrelated features, you are doing regression testing.
Another pitfall is not updating smoke tests as the application evolves. A smoke test that still checks a removed feature will fail for the wrong reason. Also, teams sometimes skip sanity testing because they trust the developer’s fix, only to discover a simple typo broke a related function. Always run a quick sanity check.
Finally, do not confuse these with smoke testing in the context of hardware or network security. In software, the term is exclusively about build verification.
Frequently Asked Questions
Is smoke testing the same as build verification testing?
Yes, smoke testing is often called build verification testing (BVT). Both terms refer to a quick set of tests that determine whether a build is stable enough for further testing. The goal is to catch obvious breakages early.
Can sanity testing be automated?
Yes, sanity tests can be automated, especially if they are repetitive. However, because they are often ad hoc and targeted at a specific fix, many teams perform them manually. Automated sanity tests are common in CI/CD pipelines for regression-prone areas.
Which comes first, smoke or sanity testing?
Smoke testing comes first. It is the initial check on a new build. Once the build passes smoke testing, sanity testing can be done for specific fixes. If a build fails smoke testing, there is no point in running sanity tests until it is fixed.
Do smoke tests replace regression tests?
No. Smoke tests are a subset of regression tests, but they are much less comprehensive. Regression testing covers all affected areas and can take hours or days. Smoke tests are a quick pass over core functionality to catch major issues early.
What happens if a smoke test fails?
If a smoke test fails, the build is rejected and sent back to the development team. Testing stops until the build is fixed and a new smoke test passes. This saves time by preventing testers from working on a fundamentally broken product.
Related
Formula used
in t | Finish time | min | 50 | 0 in d | Distance | km | 10 | 0 out pace | Average pace | min/km | t / d | 2 out speed | Average speed | km/h | d / (t / 60) | 2
Each line is one input (in, sel, list) or one result (out: label, unit, formula, decimals). How the calculators work
Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.