Heard About Sanity Testing?
Published: 2023-06-13 02:24:05

by [Yoma Daniel](https://blog.openreplay.com/authors/yoma-daniel)

<blockquote><em>Proper testing is essential to ensure positive user experiences. There are many testing processes, and this article will explain what "Sanity Testing" is, how and when to apply it, and the differences with "Smoke Testing".</em></blockquote>



A successful business today depends on developing software that provides a positive [end-user](https://www.investopedia.com/terms/e/end-user.asp) experience. Therefore, adequate software testing is required before it is available on the market. Even if there are many stages of building excellent software, testing is still crucial before it goes public. The Software Development Lifecycle ([SDLC](https://blog.openreplay.com/software-testing-life-cycle/)) includes various testing kinds, each of which serves a unique function.

[Functional testing](https://www.microfocus.com/en-us/what-is/functional-testing#:~:text=Functional%20testing%20is%20a%20type,with%20the%20end%20user's%20expectations.) and [Non-functional testing](https://www.guru99.com/non-functional-testing.html) are the two primary categories into which these testing kinds fall.

Functional testing includes [system testing](https://www.techtarget.com/searchsoftwarequality/definition/system-testing#:~:text=System%20testing%2C%20also%20referred%20to,full%2C%20integrated%20system%20or%20application.), [smoke testing](https://www.guru99.com/smoke-testing.html), sanity testing, [integration testing](https://www.techtarget.com/searchsoftwarequality/definition/integration-testing), and [unit testing](https://www.techtarget.com/searchsoftwarequality/definition/unit-testing#:~:text=Unit%20testing%20is%20a%20software,independently%20scrutinized%20for%20proper%20operation.). This article discusses sanity testing, which centers on the build of a piece of software. In addition, we will list the differences between sanity testing and smoke testing because their functions could be easily misunderstood. 

## What is Sanity Testing?
Sanity testing is a secondary aspect of [regression testing](https://katalon.com/resources-center/blog/regression-testing). It is also called surface-level testing and gets carried out on the stable [build of the software](https://en.wikipedia.org/wiki/Software_build). Sanity testing does the following:
* With sanity testing, you can ensure that new functionalities or bugs have been fixed.
* When deploying software, sanity testing is done to see if testing for the project or product can occur. 

Sanity testing is usually performed in a software product requiring immediate reduction deployment. The team's focus during this test is to confirm if the software is functional enough, instead of focusing on detailed tests. In other words, there is no deep testing. 


## What are The Features of Sanity Testing?
These are the features of sanity testing:
1. Deep Testing: The sanity testing process is deep and narrow, as only limited functionalities are covered deeply.
2. It is unscripted: Most times, sanity testing isn't [scripted](https://www.geeksforgeeks.org/difference-between-scripted-and-unscripted-testing/).
3. It is comprehensive: Sanity testing covers the fundamental evaluation of software behavior.
4. It is simple: Sanity testing is simple and easy to use. 
5. Sanity testing is carried out by [testers](https://www.techopedia.com/definition/29845/software-tester).
6. It is a subset of Regressive-testing: Sanity testing concentrates on a smaller section of the software at a time.
7. Sanity testing is not documented.   


## What Are The Objectives of Sanity Testing?
The objectives of sanity testing are:

* The deployment of a build gets stopped when sanity testing fails, saving time, expenses, and managing complications.
* To ensure that changes to the software do not affect the existing functions so that they will continue to work as expected.
* To certify the accuracy of new components and features.
* To confirm that new features work the way they should.
* To verify the [rationality](https://www.automation-consultants.com/rational-functional-tester/#:~:text=What%20is%20Rational%20Functional%20Tester,such%20as%20HTML%2C%20Java%2C%20.) of the system so that other intense testing can be carried out. 

## The Sanity Testing Process
Sanity testing is mainly done to check for wrong outcomes that do not exist in the component procedures and to ensure that changes do not affect the software's existing functionality.

There are steps involved in carrying out sanity testing. Let’s discuss them:
- Identification: It identifies the newly added features and components. In addition, sanity testing detects modifications while bugs are removed from the code. 
- Evaluation: When the identification process is over, there is an analysis of newly implemented components and changes to ensure they function as intended.
- Testing: The testing step is next if the evaluation process has been completed successfully. In this step, the evaluated components and attributes are inspected to ensure they work as required. 


![-](https://blog.openreplay.com/images/heard-about-sanity-testing/images/uhH4pym.png)









Everything will work well if the steps are followed, and the build is further subjected to intensive testing. 

## The Importance of Sanity Testing
Sanity testing is important because it determines if deployment for a build can be carried out or not. It ensures that bugs and new functionalities have been fixed. Failure during sanity testing leads to a stop in the deployment of the build, which saves time and money.

Here are the advantages of sanity testing:
1. With sanity testing, you can quickly find missing [dependent objects](https://www.freecodecamp.org/news/a-quick-intro-to-dependency-injection-what-it-is-and-when-to-use-it-7578c84fa88f/).
2. Compared to other types of testing, execution in sanity testing is very cheap.
3. Sanity testing can easily identify complications and [deployment issues](https://transcendentsoftware.com/blog/7-software-deployment-challenges-and-how-to-address-them/).
4. Documentation is not needed for sanity testing, so it executes in less time than other forms of testing.
5. With sanity testing, you can find faults in the core functionality of a build.

Below are the disadvantages of sanity testing:
1. Since sanity testing is performed for limited features, detecting problems in other functionalities is difficult. 
2. Sanity testing does not address all test cases. 
3. Sanity testing does not reach the design structure level, making it difficult for developers to comprehend how to fix issues discovered during sanity testing.
4. Sanity testing has no future references because it is unscripted. 
5. Sanity testing gives more significance to the statements and functions of a build.


![-](https://blog.openreplay.com/images/heard-about-sanity-testing/images/1PK0Rl9.jpg)



<div style="background-color:#efefef; border-radius:8px; padding:10px; display:block;">
<hr/>
<h3><em>Session Replay for Developers</em></h3> 
<p><em>Uncover frustrations, understand bugs and fix slowdowns like never before with <strong><a href="https://github.com/openreplay/openreplay" target="_blank">OpenReplay</a></strong> — an open-source session replay suite for developers. It can be <strong>self-hosted</strong> in minutes, giving you complete control over your customer data.</em></p>
<img alt="OpenReplay" style="margin-top:5px; margin-bottom:5px;" width="768" height="400" src="https://raw.githubusercontent.com/openreplay/openreplay/main/static/openreplay-git-hero.svg" class="astro-UXNKDZ4E" loading="lazy" decoding="async">
<p><em>Happy debugging! <a href="https://openreplay.com" target="_blank">Try using OpenReplay today.</a></em><p>
<hr/>
</div>



## Example of Sanity Testing
This is an example to help you further understand how sanity testing works:

We have a messaging app, and in the messaging app, we have a search function to search for contacts.
* A new user tries to search for a contact, but the contact wouldn't appear because there is a bug in the search function.
* The testing team reports the bug to the development team so that they can fix it.
* The development team fixes the bug and then reports to the testing team. 
* The testing team tests the feature to ensure that the changed function works properly. 
* The sanity testing process proves that the modification is authentic. 


## When To Conduct Sanity Testing
Here are some situations in which sanity testing can be conducted:
* After the development team has fixed the bugs.
* Before deploying the application.
* When there are minor changes in the code.
* When a build is received after a series of regressions.

Now let us address the differences between sanity testing and smoke testing. But first, we should understand what smoke testing means.

## What Is Smoke Testing?
Smoke testing verifies that all core functionalities of a program are running well. It is carried out after the software build is complete, in the early stages of the Software Development Life Cycle (SDLC), to identify any failure in the software before release.

Since both Smoke Testing and Sanity testing check the core functionality of a code for errors or failures, understanding their differences can be confusing. So let's get started!

These are the differences between Sanity testing and Smoke testing: 
* Sanity testing ensures that new functionalities and bugs have been fixed, while smoke testing ensures that critical functionalities of the software are working well.
* Sanity testing is performed on relatively stable builds, while Smoke testing is conducted on stable or unstable builds.
* Sanity testing verifies new functionalities like fixed bugs, whereas Smoke testing authenticates the critical functionalities of software.
* Sanity testing is to verify [rationality](https://www.automation-consultants.com/rational-functional-tester/#:~:text=What%20is%20Rational%20Functional%20Tester,such%20as%20HTML%2C%20Java%2C%20.), while Smoke testing is to verify [stability](https://www.tutorialspoint.com/software_testing_dictionary/stability_testing.htm#:~:text=Stability%20testing%2C%20a%20software%20testing,as%20load%20or%20Endurance%20testing.).
* Sanity testing is a subset of Regression testing, while Smoke testing is a subset of [Acceptance testing.](https://www.techtarget.com/searchsoftwarequality/definition/acceptance-test#:~:text=Acceptance%20testing%20is%20a%20quality,testing%20or%20end%2Duser%20testing)
* Sanity testing is part of regression testing, while Smoke testing is part of basic testing.
* Testers conduct Sanity testing, whereas software developers and testers can conduct Smoke testing.
* During Sanity testing, the tester verifies only a particular component of the system, whereas during Smoke testing, the tester verifies the entire system.
* Sanity testing is done when there is little to no time for deep testing, whereas smoke testing gets carried out whenever there is a new build release.

## Conclusion
We have learned about sanity testing, its importance, advantages, and disadvantages. It is the best option to quickly assess software functionality. I hope this article has been useful!