Course contentsShow
← Software Engineering
Lesson 423 of 1,93312. Testing FundamentalsFree lesson

Smoke and Sanity Tests: Quick Health Checks

Explore smoke tests for basic functionality checks and sanity tests that verify critical paths work before running the full test suite.

Smoke and Sanity Tests: Quick Health Checks

You'll learn how smoke and sanity tests act as fast gatekeepers to catch major problems before running your full test suite.

What Are Smoke and Sanity Tests?

Think of smoke tests like flipping light switches when you first walk into a house—you're checking if the basic electrical system works before worrying about dimmer settings. Smoke tests verify that the most critical, fundamental functionality of your software works: Does it start? Can it connect to the database? Do core features respond?

The term comes from hardware testing: plug it in and see if smoke comes out. In software, you're checking if anything is "on fire" before investing time in deeper testing.

Sanity tests are similar but slightly different—they verify that a specific area or recent change makes logical sense before proceeding. After fixing a login bug, a sanity test checks that users can actually log in now. It's a rational "does this make sense?" check.

Why Use Them?

Running your entire test suite might take 20 minutes. If the application won't even start, why wait that long to find out? Smoke and sanity tests typically run in seconds or minutes and give you quick feedback.

When to run them:

  • After deploying to a new environment
  • Before running the full test suite
  • After a critical bug fix (sanity)
  • As the first stage in your CI pipeline

The Difference

  • Smoke test: Broad but shallow—touches many areas lightly
  • Sanity test: Narrow but focused—verifies specific functionality deeply

Key Takeaway: Smoke and sanity tests are fast, targeted health checks that catch show-stopping issues early, saving time by failing fast when something fundamental is broken.