Introduction
Smoke Testing and Sanity Testing are important testing types performed after a new build is received. Although they are often confused, they serve different purposes in the testing lifecycle.
What is Smoke Testing?
Smoke Testing is a preliminary testing performed to verify whether the basic and critical functionalities of the application are working. It determines whether the build is stable for further testing.
- Performed on new build
- Covers major functionalities
- Broad and shallow testing
- Usually scripted
What is Sanity Testing?
Sanity Testing is performed after receiving a build with minor fixes. It verifies that specific issues are fixed and related functionalities are working correctly.
- Performed after bug fixes
- Focused and narrow testing
- Checks specific modules
- Usually unscripted
Smoke Testing vs Sanity Testing – Comparison Table
| Criteria | Smoke Testing | Sanity Testing |
|---|---|---|
| Purpose | Check build stability | Verify bug fixes |
| Scope | Broad | Narrow |
| Performed When | After new build | After minor fixes |
| Documentation | Usually documented | Often ad-hoc |
| Testing Depth | Shallow | Deep but limited |
Real-Time Example
Example: E-commerce Application
- Smoke Testing: Verify login, add to cart, and checkout functionalities after new deployment.
- Sanity Testing: Verify payment module after fixing a payment-related defect.
Advantages
Smoke Testing:
- Quick build validation
- Saves testing time
Sanity Testing:
- Ensures bug fixes are correct
- Prevents regression in related modules
Interview Questions
Difference between Smoke and Sanity Testing?
Smoke testing checks overall build stability, while sanity testing verifies specific bug fixes.
When is Smoke Testing performed?
After receiving a new build.
Is Sanity Testing part of Regression Testing?
Yes, it is often considered a subset of regression testing.
Frequently Asked Questions
Can Smoke Testing be automated?
Yes, smoke tests are often automated in CI/CD pipelines.
Which is done first, Smoke or Sanity?
Smoke testing is done first on a new build.