Sanity Testing
Sanity Testing is a type of software testing that focuses on verifying the basic functionality of an application after changes, such as bug fixes, new features, or updates, have been implemented. The purpose of sanity testing is to ensure that the critical components of the software are working as expected and that the changes introduced have not caused any major issues. It is a shallow and quick type of testing that is typically performed to confirm that the most essential parts of the software are functioning properly before proceeding with more extensive testing, such as regression or system testing.
When Sanity Testing is Performed:
- Post-Development Changes: After developers make minor code changes, bug fixes, or feature enhancements, sanity testing is performed to ensure that the changes do not break the basic functionality of the system.
- After Software Updates or Patches: When a software update or patch is applied, sanity testing helps confirm that the patch works correctly and does not negatively impact the overall application.
- Pre-Regression Testing: Before running full regression testing, sanity testing is performed to verify that the application is stable enough to undergo the more exhaustive testing phases.
Characteristics of Sanity Testing:
- Quick and Shallow: Sanity testing is usually a short and focused activity, where the primary goal is to confirm that the basic functionality is intact.
- Targeted: It is not a comprehensive test of the entire system. Sanity testing is targeted at the areas most impacted by the changes made.
- Non-Regression: Unlike regression testing, which verifies the entire application for any unintended side effects of code changes, sanity testing is more focused on confirming that the application’s core functions work properly.
- Unscripted or Minimal Scripts: Sanity tests are often informal or based on minimal scripts, as they focus on verifying critical workflows rather than executing detailed test cases.
Examples of Sanity Testing:
- Example 1: After fixing a bug related to the user login process, a sanity test may involve verifying that the login functionality works correctly and that no other basic functions of the application (e.g., password reset, user registration) are broken.
- Example 2: After adding a new feature, such as a search bar in an e-commerce application, sanity testing may involve verifying that the search functionality works as expected, that users can perform searches, and that the results are displayed correctly. At the same time, the tester ensures that other features, like the checkout process, still work fine.
- Example 3: After deploying a patch to fix a performance issue, sanity testing could involve running the application to check whether the issue is resolved and whether critical functionalities, like user authentication and transaction processing, are still functional.





