As we know that testing is an inevitable part of SDLC, a team of QA professionals or testers conducts testing on software products to make sure that they comply with the specified requirements.
For any software product, it is crucial that it should meet all the requirements specified by the client or end-users at the onset of the development process. However, the client’s or end user’s requirements are not fixed.
This means that the requirements change at any point in the software development process. As a result, it becomes essential to test a particular software product against those changing requirements. This is where regression testing comes into play.
Regression testing is a type of software testing that verifies the correctness of the software product even after a small change in the source code or after the integration of new functionality. It ensures that the software functions as expected even after the integration of new features or enhancement of the existing features. And sanity testing is a part of regression testing.
Sanity testing is a type of software testing technique that takes place after smoke testing. When the software build comes after minor changes in functionality or features, sanity testing ensures that all the existing bugs have been fixed and no other issues are detected due to those changes.
This blog post aims to explain sanity testing in detail, its advantages and disadvantages, and the process. Also, it helps you understand the differences between smoke and sanity testing.
So, let us begin our discussion!
What is Sanity Testing?
It is a variant or, more precisely, a subset of regression testing that the team of testers performs on the software build to make sure that certain changes to the source code do not result in new defects or errors. The testing team also makes sure that the development team has fixed the existing bugs or errors in the software build.
Basically, it acts as a stoppage for the software build to determine whether it is possible to conduct testing on it or not. In addition, this type of testing technique ensures that any changes in the source of the software build do not affect its associated components or modules and work as expected.
The testing team performs sanity testing only after the software build undergoes and passes smoke testing, and the quality assurance team accepts it for further testing. Also, testers reject the software build if the sanity tests fail, which saves time, money, and effort.
In a nutshell, the primary purpose of this type of testing technique is to test the new software build for its correctness as soon as the development team releases it.
The following are the primary objectives of sanity testing:
- It ensures that the predefined features of the software product function as expected.
- It verifies the correctness and accuracy of newly added features or modules to the software product.
- This type of testing ensures that the introduction of new features does not affect the existing functionality.
Here are some remarkable features of sanity testing:
- A Subset of Regression Testing: It is a variant, subset, or subdivision of regression testing because both serve the same purpose of verifying that any changes or new functionality do not impact existing ones. In addition, it primarily focuses on the small sections or less important modules of the software product.
- Unscripted: This type of testing is unscripted, i.e., there is no planning before conducting it on the software build.
- Narrow and Deep: It is a narrow and deep approach to software testing that covers the limited functionalities of the software product.
- Not Documented: Testers do not document sanity testing.
- Performed by Testers: Usually, testers are responsible for performing this type of testing.
To understand sanity testing, let us take an example of an eCommerce website. Consider that the website has a login page, the home page, user registration page, user profile page, and various product pages.
Now, let us say there is a defect in the login page. The password field accepts less than four alphanumeric characters even though the requirement states that it should not be less than eight characters.
As a result, the testing team reports it as a defect and sends the website to the development team for fixing. Once the development team fixes the reported defect, they again send the website to the testing team.
Here, the testing team evaluates the website to check whether the development team has fixed the reported defect or not. Also, it verifies that the new changes do not affect the existing functionality of the website. We refer to this as sanity testing.
When to Perform?
There are two scenarios where testers carry out this type of testing. They are as follows:
- When there is an improvement or modification in a specific functionality or bug fix.
- When there is an integration of new functionality in the software build.
Sanity Testing Process
Though it is not a scripted or unplanned type of software testing technique , there is a well-defined process to carry it out. It involves the following three steps:
- Identification: The first step involves identifying the newly added features or components to the software build. Also, it involves detecting the code that the development modifies during the bug fix.
- Evaluation: Once the testers identify new components and modified components, they analyze and evaluate each component separately to check whether it is functioning as intended.
- Testing: Now, the final step is testing, where testers inspect and assess all the components and parameters associated with the components evaluated in the evaluation step. Here, they verify that modified components or new components do not affect other components of the software build.
If the software build functions well after sanity testing, testers then carry out more exhaustive and thorough testing on it. However, if it fails in any of the above steps, the testing team rejects that software build.
Advantages and Disadvantages of Sanity Testing
Now that we know what sanity testing is, let us now discuss its advantages and disadvantages below.
- It is easy to understand and implement.
- It is relatively less expensive than other types of software testing.
- This type of software testing technique is helpful in quickly identifying bugs in the core functionality of the software product.
- Testers execute it in less time since there is no need for documentation.
- If sanity tests fail, testers do not carry out further testing on the software product, which significantly saves time, effort, and money.
- It is very useful in identifying missing independent objects.
- This type of software testing does not cover all the test cases.
- It is not a planned type of software testing.
- Also, it is not documented, and there will be no future reference available.
- It only validates the features of the software product and not the design structure.
Sanity Testing vs Smoke Testing
We have discussed what sanity testing is. Let us now throw light on smoke testing.
It is a software testing technique that the testers perform in the first build of the software product to ensure that all the critical functionalities work as intended. It takes place before the execution of functional or regression tests.
Many people often get confused between the two. The following table highlights the differences between sanity testing and smoke testing :
This type of software testing validates the critical functionalities of the software build for their correctness.
This type of software testing tests each and every functionality to ensure that it functions as expected.
The primary objective is to verify the stability of the software product.
The main goal is to verify the rationality of the software product.
Usually, smoke testing is scripted and documented.
It is not scripted and documented.
Developers or testers can carry out smoke testing.
Only testers can conduct this type of testing.
It is a subset of user-acceptance testing (UAT).
It is a subset of regression testing.
This type of testing makes use of the entire software product.
This type of testing only employs a specific component of the software product.
This concludes our take on sanity testing. It is a type of software testing technique, where testers conduct testing on a software build that the development team has recently worked on to fix bugs, improve existing functionality, or add new features.
It ensures that any changes in the functionality, fixing of bugs, or the introduction of new features do not affect the software build’s existing functionalities. Also, it is more intense only on the modified components of the software product.
In short, this type of testing technique tests every new build of the software product and verifies that it functions correctly.
We hope that this blog post has helped you gain better insights into sanity testing. Still, if you have any doubts, feel free to share them in the comments section below.
People are also reading:
Leave a Comment on this Post