Sanity Testing

In this tutorial, we are going to study about sanity testing. Like smoke testing, sanity testing is also one of the most confusing terms in software testing. Hence, it is also one of the most frequently asked testing interview questions.

Sanity Testing Definition

Sanity testing is a subset of regression testing, performed to make sure that new code changes are working fine.

Like regression testing, in the case of sanity testing, we check if a fix has not affected the other working functionalities of the application but in lesser time and with a lesser number of test cases.

So, basically in case of sanity-

  • We perform testing after receiving a fix (usually a minor fix).
  • We check the limited but critical part of the functionality.
  • And then decide if the build can be deployed to production or not.


Let’s take an example of a simple web application. Suppose all the features of the application are working fine but the signup module has some issues with the captcha API. Now, if we receive the fix of this issue, it doesn’t make a lot of sense to carry out the complete testing of all the modules of the application.

Instead, we can just test the signup module and in case it works fine then consider the build fit for production. This can save a lot of time and hence used in case of time constraints.

Features of Sanity testing

  1. A subset of regression testing – It is a subset of regression testing and focuses on a smaller section of the application.
  2. Narrow and deep – It is a narrow and deep approach to testing, wherein we cover limited functionality deeply.
  3. Not documented – Most of the time sanity tests are undocumented. We don’t need to have defined test cases for performing sanity testing.
  4. Not automated – Usually the sanity tests are not automated and are performed manually.

Advantages of Sanity testing

  1. It helps in quickly identifying issues in the core functionality.
  2. Since no documentation is required for sanity testing, these can be carried out in lesser time.
  3. In case of issues found during Sanity testing build is rejected thus saving time for the execution of regression tests.

Recommended Reading

Leave a Comment