All that you need to know about Sanity Testing

All that you need to know about Sanity Testing

6 mins read476 Views Comment
Anshuman
Anshuman Singh
Senior Executive - Content
Updated on Aug 1, 2024 15:16 IST

In order to better understand what sanity testing is, let’s first try to understand what a build is. So, a “build” is typically a pre-release version of software exclusively utilized by the company developing the software.

2022_12_MicrosoftTeams-image-170.jpg

Now that we know what a build is, it will be easy to understand what sanity testing is. But before we begin explaining sanity testing in-depth, let’s go through the topics listed under the table of content (TOC) that we will cover in this article.

Table of content (TOC)

You can also explore artciles related to software testing, such as:

What is Smoke Testing?
What is Smoke Testing?
How do developers determine when the software or a product is ready for the functional testing? It is decided once the software or product has gone through the smoke testing...read more
What is Black Box Testing? Its Types and How To Do It?
What is Black Box Testing? Its Types and How To Do It?
Black Box Testing, also known as Function Testing, is a powerful technique to test the functionalities of software applications without an in-depth understanding of the internal logic or source code...read more
What Is Penetration Testing and How Does It Work?
What Is Penetration Testing and How Does It Work?
Penetration testing means attempting an authorized simulated attack to exploit a system’s vulnerability in order to learn about potential flaws and the damage they can cause. As a result, in...read more

What is sanity testing? 

Sanity testing definition: Sanity testing is performed once the build is received in order to ensure that the software is working as expected after making minor changes in the code.

Sanity testing is a subset of regression testing. The primary objective of this type of testing is to ensure that all the defects have been resolved in the original build or that the changes made in the code to correct the functionality in the original build have not resulted in some additional issues.

You can also read: A Day in Life of a Software Engineer – An Interview Log

Now, the next question that arises is, when you should conduct a sanity test? Sanity test should be conducted in the following cases:

  •  After fixing a bug.
  • Before going into production.
  • When there is a minor change in the code.
  • Whenever the build is obtained after a series of regressions.

You can also explore: Software Engineer Online Courses & Certifications

Recommended online courses

Best-suited Quality Assurance & Testing courses for you

Learn Quality Assurance & Testing with these high-rated online courses

Example of sanity testing 

Consider creating an online food delivery app and offering your elite members a 10% discount on New Year (January 1st, 2023). So you asked your developer to make a minor change in order to meet the specified requirement.

You can also explore: White box testing with real life example

After receiving the build in which minor code changes have been made in order to meet the specified requirement, you will perform sanity test. And the testing will test or verify a variety of conditions, such as:

  • Elite members receive the discount on January 1st.
  • Non-elite members should not receive the discount on January 1st.
  • No member receives that rebate discount before or after January 1st.
  • Other discount coupons should not be applicable after a 10% off discount.
  • Members who opted for elite membership on January 1st also receive discounts, etc.

You can also explore: Free Software Engineer Courses Online

As in the above scenario, sanity testing only verified a small portion or section of the software after implementing a small code change. This testing will not check other functionalities that are entirely different, such as whether the reviews are getting submitted, if the customer can add instructions related to their order, etc. 

You can also explore: Acceptance testing with real-life examples

This testing will only check the functionality that was supposed to work as expected after the code change and other related functionalities (Other discount coupons should not be applicable after a 10% off discount), as shown in the above example. Other functionalities will be checked either in the smoke testing or regression testing.

Features of sanity testing 

Let’s go through some of the features, such as:

  • Unscripted: This type of testing is unscripted most of the time.
  • Not documented: No documentation is needed in order to conduct this type of testing.
  • Requires less time: As the testing is narrow and not performed on the whole application or software, it consumes less time.
  • Subset of regression testing: This type of testing is a subset of regression testing that verifies or checks only a specific section of a software or application rather than the complete application.

You can also explore: Test plan vs Test strategy

Advantages of sanity testing 

Here are some of the advantages:

  • Consumes less time, as there is no need for documentation
  • Saves a lot of money in comparison to the other types of testing
  • Allows to detect problems in a software’s core functionality rapidly
  • Aids in the rapid identification of defects in core functionality and the identification of missing dependent objects
  • Allows you to test the functionality of a small section of an application or software rather than the entire application

Disadvantages of sanity testing

Here are some of the disadvantages:

  • Focuses solely on the software’s functions
  • Does not include all test cases in test scenarios.
  • Because this type of testing is not scripted or documented, no future references are available.
  • Covers only a subset of the application’s functionality, which may result in an error in the unchecked functionality
  • It does not cover the design structure level, making it difficult for the development team to identify and resolve issues.

Sanity vs Smoke

These terms, smoke testing and sanity testing are confusing, and these terms should be clarified. So, in order to understand these terms in a better way, let’s look at sanity testing vs smoke testing in a tabular format.

For more information, you can also explore: smoke testing vs sanity testing

For a better understanding, let’s explore the difference between smoke testing vs sanity testing in a tabular format:

Benchmark Sanity testing Smoke testing
It aims to test New functionalities and to check whether bugs have been fixed or not. Critical functionalities of the software
Verifies the Rationality of the system Stability of the software
Testing is done by both testers and developers No. Testers only do it. Yes
Is it documented or scripted? No Yes
It is a subset of Regression testing Acceptance testing
It examines A particular part of the software The entire system from end to end
It is performed on the Stable build Initial build
Testing type Wide and shallow testing Elaborate and planned testing
Can it be done with the help of automation tools? No. It is only done manually. Yes

Passing thoughts

Sanity testing is performed to ensure that all defects have been resolved and that no new issues have arisen as a result of the resolutions or modifications. This testing also ensures that any changes to the code or functions do not affect the associated modules.

FAQs

What is sanity testing?

Sanity testing is performed once the build is received in order to ensure that the software is working as expected after making minor changes in the code.

What are the advantages of sanity testing?

Here are some of the advantages of sanity testing: Consumes less time, as there is no need for documentation Saves a lot of money in comparison to the other types of testing Allows to detect problems in a software's core functionality rapidly Aids in the rapid identification of defects in core functionality and the identification of missing dependent objects Allows you to test the functionality of a small section of an application or software rather than the entire application

What are the disadvantages of sanity testing?

Here are some of the disadvantages of sanity testing: Focuses solely on the software's functions Does not include all test cases in test scenarios. Because this type of testing is not scripted or documented, no future references are available. Covers only a subset of the application's functionality, which may result in an error in the unchecked functionality It does not cover the design structure level, making it difficult for the development team to identify and resolve issues.

What are the features of sanity testing?

Some of the fetaures of sanity testing are unscripted, undocumented, subset of regression testing, consumes less time, etc.

About the Author
author-image
Anshuman Singh
Senior Executive - Content

Anshuman Singh is an accomplished content writer with over three years of experience specializing in cybersecurity, cloud computing, networking, and software testing. Known for his clear, concise, and informative wr... Read Full Bio