Javatpoint Logo
Javatpoint Logo

Sanity Testing

In this section, we are going to understand the working of sanity testing, which is used to check whether the bugs have been fixed after the build or not.

And we also learn about its process, why we need to perform the sanity testing, the objective of sanity testing, real-time examples, various attributes of sanity testing, advantages, and disadvantages.

What is Sanity Testing?

Generally, Sanity testing is performed on stable builds and it is also known as a variant of regression testing.

Sanity testing was performed when we are receiving software build (with minor code changes) from the development team. It is a checkpoint to assess if testing for the build can proceed or not.

In other words, we can say that sanity testing is performed to make sure that all the defects have been solved and no added issues come into the presence because of these modifications.

Sanity testing also ensures that the modification in the code or functions does not affect the associated modules. Consequently, it can be applied only on connected modules that can be impacted.

The Objective of Sanity Testing

The key objective of implementing sanity testing is to fulfill the following aspects:

Sanity Testing
  • The primary aim of executing the sanity testing is to define that the planned features work unevenly as expected. If the sanity test fails, the build is refused to save the costs and time complexity in more severe testing.
  • The execution of sanity testing makes sure that new modifications don't change the software's current functionalities.
  • It also validates the accuracy of the newly added features and components.

Attributes of Sanity Testing

For understanding the fundamental of the sanity testing techniques, we have to learn their attribute and several other components. Hence, following are some of the important features of Sanity testing:

  • Narrow and deep
  • A Subset of Regression Testing
  • Unscripted
  • Not documented
  • Performed by testers
Sanity Testing

Narrow and deep

In software testing, sanity testing is a narrow and deep method where limited components are protected deeply.

Subcategory of Regression Testing

It is a subdivision of regression testing, which mainly emphases on the less important unit of the application.

It is used to test the application efficiency under the requirements of the modification or new features that have been executed.


Generally, sanity testing is unscripted.

Not documented

Typically, sanity testing cannot be documented.

Performed by test engineers

Usually, Sanity testing is done by the test engineers.

Sanity Testing Process

The main purpose of performing sanity testing is to check the incorrect outcomes or defects which are not existing in component procedures. And also, ensure that the newly added features may not affect the functionalities of current features.

Therefore, we need to follow the below steps to implement the sanity testing process gradually:

  • Identification
  • Evaluation
  • Testing
Sanity Testing

Step1: Identification

The first step in the sanity testing process is Identification, where we detect the newly added components and features as well as the modification presented in the code while fixing the bug.

Step2: Evaluation

After completing the identification step, we will analyze newly implemented components, attributes and modify them to check their intended and appropriate working as per the given requirements.

Step3: Testing

Once the identification and evaluation step are successfully processed, we will move to the next step, which is testing.

In this step, we inspect and assess all the linked parameters, components, and essentials of the above analyzed attributed and modified them to make sure that they are working fine.

If all the above steps are working fine, the build can be subjected to more detailed and exhausting testing, and the release can be passed for thorough testing.

Who executes the Sanity testing?

Generally, a sanity test case is executed by the test engineers.

When do we need to perform Sanity testing?

There are no such hard and fast software testing rules to execute the sanity tests process.

It is a quick process of testing the application as it does not include the scripting any of the test cases.

A Sanity testing is a narrow regression test that emphasizes specific areas of the component. And if we encounter the below two conditions, we needed to execute one round of sanity testing, and those conditions are as follows:


We go for sanity testing whenever there is an improvement in the functionality of the specified software.


Whenever the bugs have been fixed, or a new feature added, we need to perform sanity testing in order to check whether the application is still working fine or not.

Examples of Sanity Testing

For our better understanding of sanity testing, we will see the below example:

Example 1

Suppose we have an e-commerce application, which contains several modules, but here, we mainly concentrate only a few modules such as the login page, the home page, the new user creation page, the user profile page, etc.

  • While a new user tries to login into the application, he/she is not able to log in, as there is a bug in the login page.
  • Because the password field in the login module accepts less than four alpha-numeric characters and based on the specification, the password field should not be accepted below 7-8 characters.
  • Thus, it is considered as bug, which is reported by the testing team to the development team to fix it.
  • Once the development team fixes the specified bug and reports back to the testing team, the testing team tests the same feature to verify that the modification that happens in the code is working fine or not.
  • And the testing team also verifies that the particular modification does not impact other related functionalities.
  • To modify the password on the user profile page there is a process.
  • As part of the sanity testing process, we must authenticate the login page and the profile page to confirm that the changes are working fine at both the places.

Advantages and Disadvantages of Sanity Testing

Below are some of the vital benefits and drawbacks of Sanity testing.

Advantages of Sanity Testing

Some of the dynamic benefits of performing sanity testing are as follows:

Sanity testing is easy to understand and implement.

  • It helps us to find any deployment or compilation issues.
  • It is less expensive as compared to other types of software testing.
  • It helps in rapidly finding the bugs in the core functionality.
  • There is no documentation mandatory for sanity testing, that's why it can be executed in lesser time.
  • The execution of sanity testing will help us save unnecessary testing effort and time because it only focused on one or a few functionality areas.
  • Sanity testing helps in detecting the missing dependent objects.

Disadvantages of Sanity testing

Following are the drawbacks of sanity testing:

  • It's become a very complex process for the developers to understand how to fix the defects acknowledged throughout the sanity testing if they do not follow the design structure level.
  • All the test cases are not covered under sanity testing.
  • It is emphasized only on the statement and functions of the application.
  • We do not have future references since the sanity testing is unscripted.
  • It became a complex process to find any other components as sanity testing is executed only for some limited features.


In this tutorial, we learned that the execution of the sanity testing, real-time examples, benefits, and drawbacks.

Sanity testing is implemented when a new functionality, modification request, or bug fix is executed in the program.

It is a narrow and deep testing process that is intensive only on those components where the modification has impacted.

Sanity testing is beneficial as it provides various advantages like, it offers a quick assessment of the quality of software release.

Sanity testing allows us to check the application's small functionality if a minor change occurs in the software.

Next TopicStatic Testing

Youtube For Videos Join Our Youtube Channel: Join Now


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Trending Technologies

B.Tech / MCA