0
0
Testing Fundamentalstesting~6 mins

Smoke testing and sanity testing in Testing Fundamentals - Full Explanation

Choose your learning style9 modes available
Introduction
Imagine you just fixed a few parts of a big machine. Before using it fully, you want to quickly check if the main parts still work and if the recent fixes did not break anything. This is where smoke testing and sanity testing help in software testing.
Explanation
Smoke Testing
Smoke testing is a quick check to see if the basic and important functions of a software application work after a new build or update. It covers the main features to ensure the software is stable enough for further detailed testing. If smoke testing fails, the software is sent back for fixes before any deeper testing happens.
Smoke testing quickly verifies the core functions of software to decide if it is ready for detailed testing.
Sanity Testing
Sanity testing is a focused check done after receiving a software build with minor changes or bug fixes. It ensures that the specific parts fixed or changed work correctly and that no new problems appeared in those areas. Sanity testing is narrower than smoke testing and is done to confirm the correctness of particular functionalities.
Sanity testing confirms that recent changes or fixes in the software work as expected without new issues.
Real World Analogy

Imagine you have a car that just had some repairs. Before driving it on a long trip, you first check if the engine starts and the brakes work (smoke testing). Then, after fixing a small issue with the headlights, you check only the headlights to make sure they work properly (sanity testing).

Smoke Testing → Checking if the car's engine starts and brakes work before a trip
Sanity Testing → Checking if the headlights work properly after a small repair
Diagram
Diagram
┌─────────────────────┐
│    Software Build    │
└─────────┬───────────┘
          │
          ▼
  ┌─────────────────┐       ┌─────────────────┐
  │   Smoke Testing │──────▶│ Pass?           │
  └─────────────────┘       └───────┬─────────┘
          │                          │
          │Yes                       │No
          ▼                          ▼
  ┌─────────────────┐       ┌─────────────────┐
  │  Sanity Testing │       │ Return for Fixes│
  └─────────────────┘       └─────────────────┘
This diagram shows the flow from a software build through smoke testing, deciding if it passes, then moving to sanity testing or returning for fixes.
Key Facts
Smoke TestingA quick test of core software functions to check stability after a new build.
Sanity TestingA focused test on specific changes or fixes to verify correctness.
Purpose of Smoke TestingTo decide if software is stable enough for detailed testing.
Purpose of Sanity TestingTo confirm recent changes work and did not break related parts.
Common Confusions
Smoke testing and sanity testing are the same.
Smoke testing and sanity testing are the same. Smoke testing checks the whole software's basic functions quickly, while sanity testing focuses only on specific changes or fixes.
Sanity testing is done before smoke testing.
Sanity testing is done before smoke testing. Smoke testing is done first to check overall stability; sanity testing follows to verify particular fixes.
Summary
Smoke testing quickly checks if the main features of software work after a new build.
Sanity testing verifies that recent fixes or changes function correctly without new issues.
Smoke testing covers broad basic checks; sanity testing is narrow and focused on specific areas.