What is Sanity Testing?
There are various types of software testing performed on any software application and each testing type has its own purpose. Sanity testing is a type of software testing that is performed to verify the software build for any code changes made in the software is working fine or not. The main purpose of Sanity testing is not detailed testing around the application instead it is narrow and deep and checks for the particular functionality and bug fixes (testing that no new bugs were introduced due to code changes) of the application. Unlike smoke testing which checks the functionality of an overall application, and it focuses on the planned functionality and bug fixes.
Why do we Need Sanity Testing?
Consider a scenario of testing the payment module of a web application, but during the testing, the payment page is not loading properly or the OTP field is not displayed to the user. The testers file a bug and report it to the developers. Developers then fix the bug of the page loading and OTP field of the payment page and submitted back to the testers for testing. There is no reason to do the more rigorous testing around the Payment page if the main bugfixes are not resolved. In this case, testers will now perform the Sanity testing around the Payment page in order to check the bug fixes, i.e. basic issues are resolved or not. It is also important to test if no other issues or bugs are raised in the related functionality because of the fixing of the previous issues.
In order to reduce the future time and effort in advance, it is performed before the deep, regression testing of the module. It tests the basic “rationality” of an application before the testing of the entire system.
How does Sanity Testing Work?
As we know that Sanity testing is a quick and speedy testing, so there is a quick check performed around the application for the bug fixes, new functionality and any other changes made in the application. It is usually unscripted so no documentation and test case creation is done in the Sanity test of an application. The main objective of Sanity testing is not the exhaustive testing of an application instead it focuses on the testing of a specific component.
When an application is a hand over to the testers for the Sanity test, no deep testing is performed around the whole application. Testers first test the bug fixes, new functionality of the application. It is basically a quick check done by the team of testers in order to pass/ fail the application to verify if it is ready for further in – detail testing. That is why Sanity testing is also referred to as ‘Tester Acceptance Testing’. Sanity test usually saves time and money by failing the application after the quick check if the build is not good enough to go through further testing. After the testing of bug fixes and new functionality, related modules or interrelated functionality of an application is tested in order to verify that no new bugs were introduced because of the code changes or the fixing of previous issues.
For example, if in an application there are 2 modules, module 1 and module 2. Module 1 is related to module 2 as the data is transferred from module 1 to module 2. Previously if the bugs were found in module 2 and after fixing those issues by the developers, a new build is released for testing. Then testers will perform the basic Sanity test of an application of the newly deployed build, module 2 is tested first for the verification of fixed bugs in the new build and if module 2 is working fine, then the module 1 is also tested as both are related to each other in order to check if that fix has impacted the module 1 or not.
4.5 (1,622 ratings)
Advantages and Disadvantages
Some of the advantages and disadvantages are given below:
Some of the advantages are given below:
- Sanity testing is narrow and deep. Before testing the entire application, it helps in the testing of a particular component having bug fixes.
- Since no detailed documentation is required for Sanity testing of an application, no extra time is wasted and testers mainly focus on the testing of bug fixes and affected areas of application.
- It is very helpful since the efforts are not wasted in the regression testing if the defects are found during the Sanity test and the project is rejected at the early stages.
- Sometimes, sanity testing is very helpful in the early identification of compilation and deployment issues. If the basic functionality of an application is not working fine, or the previous bugs still exist but done from the developer’s end, there would be some merging or compilation issues.
Some of the disadvantages are given below:
- Sanity testing has only a narrow scope. It is not used for the detailed testing of the whole application. It is only used to test the basic functionality of a part of a module of the application.
- It is used to test the “rationality” of application, unlike smoke testing which checks the “stability” of an application.
- In case of small size applications, Sanity testing is not that much helpful as it would consume extra time to verify the functionality of specific component instead of the whole application can be tested at that time.
- Sanity testing is generally unscripted and sometimes consumes more time and indirectly increases the overall budget of the project.
The above description clearly explains Sanity testing and the importance of Sanity testing while testing any software application. Some testers always have confusion regarding the Smoke and Sanity test but both are very much different and used for their specific scenarios. Smoke testing is done to verify that the critical functionalities of the whole application are working fine or not. Being a tester, it is very important to understand the difference between the two.
This is a guide to Sanity Testing. Here we discuss the introduction and How does Sanity Testing Work? along with advantages and disadvantages. You can also go through our other suggested articles to learn more –