15 January, 2025

Sanity Testing: A Real-World Example for Testers

Sanity testing is a type of software testing performed after receiving a software build to ensure that the critical functionalities or bug fixes are working as intended. It acts as a checkpoint to determine whether the build is stable enough for further detailed testing. Sanity testing is usually narrow and focused, covering only specific functionalities or areas impacted by recent changes.


Key Characteristics:

  1. Performed After Bug Fixes or Minor Changes: Ensures that the new code or fixes didn’t break existing functionality.
  2. Narrow and Focused: Only specific areas or modules are tested.

Real-Time Example:

Scenario:

Imagine you're working on a web-based e-commerce application, and a critical issue was reported in the checkout functionality: customers couldn't apply a discount code to their orders.

Steps:

  1. Bug Fix: The development team fixes the discount code issue and deploys a new build for testing.

  2. Sanity Testing:

    • As a tester, you focus only on the checkout page and the discount code functionality.
    • You verify:
      • If the discount code field accepts valid codes.
      • If an invalid code displays the correct error message.
      • If the discount is correctly applied to the total amount.
  3. Result:

    • If all tests pass, you confirm that the build is stable and ready for more extensive testing (regression testing, system testing, etc.).
    • If any test fails, you send the build back to the developers for further fixes.

Example in Practice:

You don’t test unrelated features like the user profile page or search functionality during sanity testing because the issue and fix were specific to the checkout module.

2 comments:

Sikha Soni said...

Good work, thanks you always

Anonymous said...

Very very helpful thank