Manual Testing • Quick Validation • Interview Important

Sanity Testing in Software Testing
Complete Guide with Real Examples

✔ Focused Testing ✔ Bug Fix Validation ✔ Interview Ready

Introduction

Sanity testing is a focused testing approach performed after receiving a build with minor changes or bug fixes. It ensures that specific functionalities are working correctly.

What is Sanity Testing?

Sanity testing is a subset of regression testing that verifies particular functionality after minor code changes. It checks whether the specific defect has been fixed and no new issues are introduced in related areas.

Unlike smoke testing, sanity testing is narrow and deep.

Why Sanity Testing is Important

  • Validates bug fixes quickly
  • Saves time by avoiding full regression
  • Ensures specific module stability
  • Prevents repeated defect issues

Sanity Testing Process

  1. Receive updated build
  2. Identify affected modules
  3. Execute relevant test cases
  4. Validate bug fix
  5. Confirm system stability

Real-World Examples

Example 1: Login Bug Fix

  • Developer fixes password validation issue
  • Tester verifies login with valid credentials
  • Tester verifies error message for invalid password

Example 2: Payment Gateway Update

  • Bug in payment confirmation fixed
  • Tester validates payment success flow
  • Tester checks order confirmation page

Sanity Testing vs Smoke Testing

  • Smoke Testing: Checks entire build stability.
  • Sanity Testing: Checks specific bug fixes or functionality.
  • Scope: Smoke is broad; Sanity is narrow.

Advantages of Sanity Testing

  • Quick defect validation
  • Efficient for minor updates
  • Reduces unnecessary regression effort
  • Improves release confidence

Sanity Testing Interview Questions

What is sanity testing?
Sanity testing verifies specific bug fixes after minor code changes.

Is sanity testing part of regression testing?
Yes, it is a subset of regression testing.

When is sanity testing performed?
After receiving a build with small updates or bug fixes.

Frequently Asked Questions

Can sanity testing be automated?
Yes, it can be automated if repetitive bug validation is required.

Who performs sanity testing?
Usually QA testers or automation engineers.