What happens if there are some changes in the application and the newer code has messed up your previous functionalities?
What happens if the newer release results in crashing down at every other action?
Is it wise to undergo such a release through the full testing cycle?
Obviously No! because the testing effort would be wasted and the tester has to re-test all those functionalities again.
Sanity testing is the solution to this problem, in this article we’ll get to know how sanity testing can help us in such situations.
What is Sanity Testing?
Sanity Testing is the method by which we determine whether the software is feasible, stable and sensible to proceed with the software testing process.
The purpose of sanity testing is to check the stability of the application, in layman’s terms checking the health of the software.
Sanity Testing is the basic step that we should follow before starting the actual testing process.
Mostly, it is an unscripted form of testing where the team performs basic tests which focus on the new functionality or change and its impacts.
The objective of sanity testing is to check whether the application works after the changes.
Examples of Sanity Testing
Let’s consider an example of a simple web application, here all the features of the application are working fine but there seems to be an issue in the signup module.
We got a new build with the fix for this issue, it doesn’t make sense to perform complete testing for all the modules in the application. We can focus on testing the login module.
When validating the login credentials, functionality the application has to ensure that only a registered user is allowed to log in with an authorised username and password.
To perform sanity testing in this scenario, we have to do the following steps:
Step 1: Launch the application
Step 2: Navigating to the login page
Step 3: Enter a valid username
Step 4: Enter the corresponding password
Step 5: Click on the login button
Here the expected result is the application logs in successfully, else the test results fail.
Features of Sanity Testing
- Sanity Testing is a subset of Regression testing where it focuses on a smaller section of the application.
- It follows a narrow and deep approach to testing where we cover limited functionality deeply.
- Usually, the sanity tests are performed manually, they are not always automated.
- Sanity Testing offers good speed as it has a very narrow focus for functionalities to be tested, it doesn’t require many scripts or documents the findings.
- It allows us to plan our next step in testing ahead. Let’s say if the sanity test fails, we can report the issue to the development team to fix the issue and keep aside the rest of the tasks
- It can capture configuration and deployment issues in the early stages of testing. Sanity Testing will help us to find such errors that can be quickly resolved and allow others to continue testing.
- It makes work simple and fast at times when there’s a short deadline where regression is not possible.
- It can also function as Adhoc testing where we check the module in which defect is fixed or the area in which new functionality is added
Advantages of Sanity Testing
- Sanity Testing saves a lot of time and effort as it only focuses on a few functionalities.
- It doesn’t require us to document the testing, we can save documentation effort through sanity testing.
- Dependent Missing objects can be identified through sanity Testing.
- It will help us in finding unnecessary defects, testing efforts, and time because its major focus is on the new functionalities only.
Disadvantages of Sanity Testing
- It only focuses on the commands and functions.
- It doesn’t go to the design level of the application.
- It tests only a few features.
- As it’s not scripted, there’s no scope for future reference.
Sanity Testing Process
In sanity testing, there is no hard and fast rule to perform the test unlike other types of testing. Sanity testing mostly doesn’t require any scripting of the test cases, this ensures that the tests are quick and simple.
The purpose of sanity testing is to make sure that false results or bugs are not present in component processes. It also checks that the new features haven’t affected the functionalities of existing features in the application.
To perform Sanity testing we need to follow three simple steps listed down below:
Step #1: Identification
Here we have to identify the new functionalities and features that are added to the software along with the modification or changes introduced in the code while fixing bugs.
Step #2: Evaluating:
Here we check if the newly implemented features and functionalities in the application works as intended and are implemented according to specifications.
Step #3: Testing
Following that we start randomly checking all the related parameters, associated functionalities and elements of the above-evaluated features and changes to ensure they are working as expected.
Who executes the Sanity testing?
Sanity testing is executed by the Quality Assurance team. Unlike other types of testing where other stakeholders can perform the testing, in sanity testing, only the testing team performs the testing.
As it is a narrow deep test that needs to be done quickly, they are almost unscripted i.e automation scripts are not created for sanity testing. Thus manual testers who have good knowledge about the functionality of the application perform Sanity testing.
Automated Sanity Tests
Let’s see whether sanity testing method should be automated.
We need to differentiate between first-time, initial tests and those that are performed regularly as part of making consistent changes. The latter would be considered a light touch regression test approach. Performing sanity tests regularly is a lighter touch regression test technique.
It’s very unlikely to automate first-time, ad hoc sanity testing. Automating a test takes significantly more time than carrying out the test just once manually.
It takes much longer to develop automation for a test than it does to carry out one manual test run.
If you are repeating the tests again and again then you should create automated scripts for sanity tests.
Automating Sanity tests might help you save time and get faster results for the development team to act on.
When do we need to perform Sanity testing?
Usually, we perform Sanity testing after receiving a stable software build or even when a software build might have undergone minor changes in the code or functionality. Sanity testing helps us decide if an end to end testing of a software product shall be carried out further or not.
Sanity Testing is usually executed after adding new functionality to the application. This type of testing is completely useless when there is no functionality in the application. It is usually carried out once new functionality is implemented within a software application.
Sanity testing will be performed in the problematic/ critical areas just in case before deploying the build to the production environment.
Sanity Testing Checklist
Before starting Sanity testing, we have to go through the below checklist:
- Does the testing team have a clear understanding of the newly implemented functionality in the application?
- Does the testing team know what expected behaviour of the function?
- Does the testing need to store and repeat the sanity test?
- Is there any tool that the team needs that helps them to store, organize, perform and report sanity tests?
- Is there a way the team can informally keep track of the tests, perhaps for future use?
- Is there any plan to procure the required tools to perform Sanity testing?
- Will there be any involvement from the development team to perform Sanity testing?
- Does the testing team have a way to repeat your sanity tests, if needed?
- Does the testing team know what should be contained in a sanity test definition in your context?
- Does the testing team have a way to report sanity test results quickly to developers?
- Does the testing team have criteria for informal vs. formal sanity tests?
- Does the testing team know what should be contained in your sanity test definitions?
To perform sanity testing there is no need of any special tool’s help. As specified earlier, testers perform sanity tests entirely unplanned and manual way.
Still tools can make it easier for you to create, manage, and track the progress of your sanity tests.
Some of the most popular sanity testing tools include: Selenium, Katalon etc.,
Sanity testing is one of the best testings which helps us avoid unnecessary efforts and time. It’s a proven method that ensures the previous bugs in the program have been fixed and that the software application works as expected.