← Back to libraryQuestion 318 of 468

Smoke vs Sanity Testing

📌 Definition:

Smoke testing is a broad, shallow check that the critical functionalities of a build work and it's stable enough to test further; Sanity testing is a narrow, deeper check that a specific new feature or bug fix works after a minor change.

📖 Detailed Explanation:

SMOKE testing (a 'build verification test') runs after each new build to confirm core paths (login, key navigation) work — if smoke fails, the build is REJECTED and not tested further, saving effort. It's wide and shallow, often scripted/automated. SANITY testing is done after receiving a build with minor changes/fixes to verify THOSE specific areas work and reasoning is 'sane' before deeper testing — it's narrow and deep, usually unscripted. Mnemonic: smoke = wide+shallow (whole build stability), sanity = narrow+deep (specific change). Both are subsets of regression and frequently confused in interviews.

🔑 Key Points:
  • Smoke = wide + shallow: is the build stable enough to test?
  • Sanity = narrow + deep: does this specific fix/feature work?
  • Failed smoke → reject the build (don't test further)
  • Smoke often automated/scripted; sanity often unscripted
🌍 Real-World Example:

After a new build, a smoke test confirms login, search, and checkout all load (build accepted); a sanity test then focuses only on the just-fixed coupon logic before full regression begins.

🎯 Scenario-Based Interview Question:

A build arrives with a bug fix for the coupon module. Would you smoke or sanity test first, and how do they differ?