What is Sanity Testing?
Introduction
In today’s era, for a Business to run successfully, there is a need to develop software that delivers a good end-user experience. Therefore, before the software is released in the market, it needs to be tested efficiently. While there are numerous phases to creating great software, testing is still the most important step before it is released. Software Development Lifecycle (SDLC) consists of a number of testing types, each testing type having a different purpose.
These testing types are broadly classified into two: Functional testing and Non-functional testing.
Functional testing involves unit testing, integration testing, system testing, smoke testing, sanity testing, etc. This article covers Sanity testing, which revolves around a software’s build. Sanity Testing helps the testing team to overcome the functional complexities in a program at the early stages of SDLC.
What is Sanity Testing?
Sanity Testing or Surface Level testing is a type of testing which is performed on the stable build of the software. It is a quick and basic test (or set of tests) to ensure that the code changes made are working properly without any bugs. It is a subset of Regression testing and is usually executed after the software product has passed the Smoke test.
Features of Sanity Testing
Some features of Sanity testing include,
Simple: Easily designed and performed.
Unscripted: It is not scripted most of the time.
Undocumented: Usually, it is not documented.
Deep testing: Limited functionalities are covered deeply.
Subset of Regression testing: Focusses on a smaller section of the application/software at a time.
Performed by testers: Testers are the ones who do the Sanity testing.
Comprehensive: Covers the basic assessment of how software behaves.
Objectives of Sanity
Testing The main objectives of Sanity testing are:
Defining the planned features works as expected.
Saving time, complexity, and costs in case the sanity test fails for a build.
Ensuring that the new updates don’t change the software’s existing functionalities.
Validating the accuracy of the newly added components and features.
What is the process of Sanity Testing?
The Sanity testing process has the following steps:
Identification
In this step, newly added features and components are detected. Also, the modification presented in the code is detected while bug fixing.
Evaluation
These newly implemented components and attributes are analyzed and modified to check whether they work as intended as per the given requirements.
Testing
A smaller section of the newly linked components is tested deeply. The test will fail if these newly introduced components do not fulfill their requirements. If it meets the need, the Sanity test is passed. Next, System testing is performed thoroughly to ensure that these functionalities do not interfere with the previously installed system and application components.
When should Sanity Testing be conducted?
Sanity Test should be performed in the following cases:
If there is a minor change in the code.
When the build is received after a number of regressions.
After bug fixes.
Before production deployment.
Let’s understand Sanity Testing through an example
Consider you developing an online Food ordering app, and you want to offer a 10% discount on New Year (1st January) for your members having an elite membership.
Sanity testing will verify the following:
Elite members get the discount on the 1st January.
Members, who add the elite membership to their food orders on the 1st, also get the discount.
Non-elite members do not get the discount on the 1st January .
No member receives that rebate before and after the 1st January.
Other discount coupons can not be clubbed together with this 10% discount.
Elite members, who opt for other deals, do not get the New Year deduction.
Sanity testing does not verify other areas of the app, like delivery tracking or restaurant reviews. That is done by Smoke testing and Regression testing, which happen before and after Sanity testing.
If Sanity testing fails, the app is sent back to the developer for troubleshooting. However, if it succeeds, the app is sent for thorough System testing.
Benefits of Sanity Testing
Some of the benefits of Sanity Testing are:
It helps in the rapid detection of problems in a Software’s core functionality.
It may be completed in less time due to no documentation.
If software issues are discovered during sanity testing, it is rejected, which saves time and effort for regression testing.
It is expensive compared to other testing types.
It helps to identify missing objects that are dependent.
It is used to verify a small functionality of the app, whether it works as expected or not.
It helps in focussing on validating the app’s functioning rather than thorough testing.
It is fruitful in scenarios where the testing time is limited.