Sanity testing is usually performed when any minor bug is fixed or when there is a small change in the functionality. It is a kind of software testing which is done by the testers to ensure that the functionality is working as expected.
Sanity testing is narrow and deep. Unlike Smoke testing, Sanity testing is focused on one or two functionalities whereas smoke testing is done to ensure that all the major features of the project is working fine.
After the changes or fixes are done in the code the software build is available to the testers. Post installation of the build the testers will do the Sanity testing of the changed functionality instead of doing the entire regression testing which will take more time.
If the bug fixes and the changed functionalities are not working as expected then the testers should not accept the build. This failure is caught early in the stage because of the sanity testing.
Few points about Sanity testing:
- It is a surface level testing which follows narrow and deep approach concentrating on the detailed testing of some limited features
- In sanity testing the testers verifies the commands and functions and all the menus in the product
- It is a subset of regression testing
- It is performed when we do not have enough time for detailed testing
- Sanity testing is usually not scripted
- Sanity testing is brief or quick testing in order to ensure that the changes are working as expected and as per the specification documents
- Sanity testing checks the minor bug fixes and the functionality changes are working at the same time it also ensures that the related functionality is intact.
Advantages of Sanity testing:
- It saves lots of time and effort because Sanity testing is focused on one or few areas of functionality
- There is no effort put in towards it’s documentation because it’s usually unscripted
- It helps in identifying the dependent missing objects.
- It is used to verify that a small functionality of the application is still working fine after a minor change.
Disadvantages of Sanity testing:
- Sanity testing focuses only on the commands and functions of the software
- It does not go to the design structure level so it’s very difficult for the developers to understand as how to fix the issues found during the sanity testing
- In sanity testing the testing is performed only for some limited features so if there is any issue in other functionalities then it will be difficult to catch them
- Sanity testing is usually unscripted so future references are not available
Difference between Smoke testing and Sanity testing:
|Smoke testing||Sanity testing|
|The main objective of Smoke testing is to verify the stability of the entire system||The main objective of Sanity testing is to verify the rationality of the system|
|Smoke testing is executed to ensure that the basic functionalities are working as expected||Sanity testing is executed to verify that the new functionality or the bug fixes are working as expected|
|Smoke testing is wide and shallow approach||Sanity testing is narrow and deep approach|
|Smoke testing is usually scripted or documented||Sanity testing is usually unscripted|
|Smoke testing is performed by the testers and it can also be performed by the developers||Sanity testing is usually performed by the testers|
|It is a subset of Regression testing||It is a subset of Acceptance testing|
|Smoke testing is like general health checkup of the software||Sanity testing is like a specialized health check up of the software|
|Smoke testing is performed earlier||Whereas sanity testing is performed after the Smoke testing|