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
- A subset of regression testing – It is a subset of regression testing and focuses on a smaller section of the application.
- Narrow and deep – It is a narrow and deep approach to testing, wherein we cover limited functionality deeply.
- Not documented – Most of the time sanity tests are undocumented. We don’t need to have defined test cases for performing sanity testing.
- Not automated – Usually the sanity tests are not automated and are performed manually.
Advantages of Sanity testing
- It helps in quickly identifying issues in the core functionality.
- Since no documentation is required for sanity testing, these can be carried out in lesser time.
- In case of issues found during Sanity testing build is rejected thus saving time for the execution of regression tests.
- Smoke testing – its features and advantages
- Difference between Smoke and Sanity
- Software Testing Tutorial – Complete Guide
Kuldeep is the founder and lead author of ArtOfTesting. He is skilled in test automation, performance testing, big data, and CI-CD. He brings his decade of experience to his current role where he is dedicated to educating the QA professionals. You can find him on LinkedIn.