"Smoke testing is an initial, basic test executed to ensure that the software build is stable enough for further testing."
Smoke Testing
Smoke testing (also called build verification testing) is performed immediately after a new build is deployed. Its goal is simple: check that the critical paths work and the build isn't catastrophically broken.
Characteristics:
- Shallow and wide — covers many features at a surface level
- Fast — typically 15–30 minutes
- Automated — run on every CI build
- Done by the QA team (or CI pipeline) before handing off to wider testing
Example: Can a user log in, browse products, and add to cart? If yes, the build is stable enough to test further.
Sanity Testing
Sanity testing is a narrowly focused test performed after a specific bug fix or small change. It verifies that the particular issue is resolved without breaking adjacent functionality.
Characteristics:
- Deep and narrow — focuses on a specific area
- Quick — usually manual, spot-checking the fix
- Performed after regression or targeted fixes
- Does not require full test documentation
Example: A bug in the password reset flow was fixed. Sanity testing verifies the fix works and the login flow adjacent to it still works.
Side-by-Side Comparison
| Attribute | Smoke Testing | Sanity Testing |
|---|---|---|
| Purpose | Build stability check | Specific fix verification |
| Scope | Wide, shallow | Narrow, deep |
| When | After every new build | After a bug fix / small change |
| Documentation | Scripted test suite | Usually unscripted |
| Automation | Yes (CI/CD) | Usually manual |
Think of it this way: smoke testing asks "is the car driveable?" — sanity testing asks "did fixing the brakes break the steering?"