Sanity Testing

Sanity Testing

Last updated on

In this tutorial, we are going to study a very common software testing type – 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. In this article, we will try to address the different features, advantages, and examples of sanity testing.

Let’s start with its definition first.

Sanity Testing Meaning

Sanity testing is a subset of regression testing. It is performed to make sure that the new code changes are working fine. The new code changes are generally minor fixes and the aim is to validate the bug fixes as well as the critical features of the application.

Like regression testing, in the case of sanity testing, we check if a fix has not affected the working functionalities of the application. But in lesser time and with a lesser number of test cases, focussing on some critical parts only.

Sanity testing

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.

Sanity Testing Example

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. In case it works fine then we can consider the build fit for production. This can save a lot of time and hence used it is in case of time constraints.

Key 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 a defined set of test cases.

4. Not automated – Usually the sanity tests are not automated and are performed manually only.

Advantages of Sanity testing

  1. It helps in quickly identifying issues in the core functionality. So, the stability of the application can be validated quickly and any issues can be quickly reported and fixed.
  2. Since no documentation is required, these tests can be carried out in a lesser time as compared to other formal tests.
  3. In case issues are found during Sanity testing, the build is rejected. This saves a lot of time and resources that would otherwise be allotted for the execution of regression tests.

Recommended Reading

Leave a Comment