Testing With Selenium WebDriver (82 Blogs)
AWS Global Infrastructure

What is Sanity Testing? Everything That You Need To Know About Sanity Testing

Last updated on Sep 10,2024 3.9K Views


In this accelerating and increasingly digital business world software development and software testing play a very crucial role.  Software testing is vital to release efficient, effective and reliable software at a rapid pace. There are different types of software testing and each of these types has a different purpose and provides a unique value to the software development process. One of the most useful types of testing is sanity testing. In this article, we will explore ‘What is Sanity Testing?’ in detail.

 

Types of Software Testing

The prime objective of any software project is to get a high-quality output while reducing the cost and the time required for completing the project. So, every software product is subjected to testing. There are many different types of software testing. Each of these testing types has its own purpose. The type of software testing that you choose depends on your testing objective, the complexity, and functionality of your software, and your testing team. The image below lists out some of the most common types of software testing used today.

TestingTypes - What is Sanity Testing - Edureka

In this article, our main focus is on sanity testing. Let’s get started!

What is Sanity Testing?

Sanity Testing is a type of software testing which is usually performed on a stable build to ascertain that bugs have been resolved and there are no new defects introduced due to changes in the code, or functionality of software product.

Sanity Testing - What is Sanity Testing? - Edureka

The main goal of sanity testing is to verify the correctness and rationality of the software. It is usually done near the end of a test cycle and focus on new functionality or defects in previously existing functionality. Listed below are the main objectives of sanity testing:

  • Verify and validate the veracity of the newly added functionalities and features
  • Evaluate the accuracy of new feature changes, if  added any
  • Ensure that introduced changes don’t affect existing functionalities
  • Tests rational thinking & logic implementations of developers

Basically, sanity testing is surface level testing, which helps in deciding if the software build is good enough to pass it on to the next levels of testing. To understand the concept more properly, this ‘What is Sanity Testing?’ article further lists the features of sanity testing.

Features of Sanity Testing

Listed below are the key features of sanity testing:

  • It is cursory testing, which checks the functioning of the product after code amendments 
  • Usually done near the end of the test cycle
  • Most of the times sanity tests are not scripted and undocumented as well
  • It is a narrow and deep approach of testing where limited functionalities are covered 
  • Most of the time sanity tests are executed  by testers
  • It acts as a gatekeeper for the builds to be passed on to further levels of testing

Now that we have a clear understanding of what sanity testing is and it’s key features, let’s check out how to conduct sanity testing.

How to do Sanity Testing?

Unlike other types of software testing, there is no hard and fast rule to carry out the process of sanity tests. To make sure that sanity tests are quick and speedy testers usually do not script the test cases. You need to remember that the main objective here is, to ensure that false results or bugs are not present in component processes. Also that the new features have not affected the functionalities of existing features. To carry out sanity testing you can follow three simple steps listed down below:

  1. Identification: The first thing is to identify the new functionalities and features along with the modification or changes introduced in the code when fixing bugs

  2. Evaluating: Next step is to check if the newly implemented features and functionalities are working as intended and according to specifications

  3. Testing: Randomly check all the related parameters, associated functionalities and elements of the above-evaluated features and changes to ensure they are working fine

If the three steps went good, the release can be passed for thorough testing. Let’s try to figure this out with a real-time example.

Example of Sanity Testing

Imagine a scenario where you have an application with multiple modules. In module X, you have a user registration form that allows the user to enter the data and submit it. But now there is a new requirement from a user. Which is to add ‘Preview Profile’ button in the user registration form that enables him to preview his profile before details are submitted. 

SanityTestingExample - What is Sanity Testing? - Edureka

The development team implements the requirement and sends the product for sanity testing. First, you perform some basic tests on the newly added feature, ie, ‘Preview Profile’. Then you check if the submit button is still working. Also, verify other functionalities and features that are dependent on the registration form. If the product passes the sanity testing, you can subject it for further testing. If not, you can reject the build. Well, this is not a fixed procedure. Every organization has its own way of performing sanity tests according to their requirements.

You might be thinking as to what is the need for sanity testing when there are other superior types of testing. In the next part of this ‘What is Sanity Testing?’ article, let’s discuss the advantages of performing smoke testing.

Benefits of Sanity Testing

Listed below are the advantages of subjecting software builds to smoke testing before sending it for rigorous testing:

  1. Very simple to understand and execute, yet efficient in finding bugs
  2. Detects errors and defects in the early stages of software development
  3. For sanity testing, there is no need for scripting and documentation
  4. Sanity testing helps identify any deployment or compilation issues
  5. Sanity testing saves unnecessary testing effort and time
  6. Less cost expensive when compared to other types of testing

Now that you know how to perform sanity testing and its benefits, let’s take this ‘What is Sanity Testing?’ article, a step further and discuss how it is different from smoke testing.

Smoke Testing vs Sanity Testing

Smoke testing and sanity testing are two very different practices. But people still get them confused, since the distinction is somewhat subtle. The table below lists the key differences between smoke testing and sanity testing.

Features Smoke TestingSanity Testing
System Builds
Initial builds are subjected to smoke testing
Relatively stable builds are subjected to sanity testing
Motive of Testing
To measure the stability of the newly created build to face off more rigorous testing
To evaluate rationality & originality of the functionalities of software builds
Components Tested
Tests are executed on entire system end-to-end
Only certain components of the system are tested
Documentation 
Involves documentation and scripting work
Doesn’t emphasize any sort of documentation or scripting
Test Coverage
Shallow & wide approach to include all the major functionalities without going too deep
Narrow & deep approach involving detailed testing of functionalities and features
Performed By?
Executed by developers or testers
Executed by testers

In simple terms, smoke testing ensures that the fundamentals of the software are sound, while sanity testing looks back to see if the changes made after additional development and testing broke anything.

So, that’s it, guys! With this, we have reached the end of this article. Hopefully, by now, you have the basic knowledge of what sanity testing is. In conclusion, sanity testing offers quick, broad and shallow testing to decide if it is possible and reasonable to proceed with further rounds of testing Developers and others alike can use sanity tests in software projects, and can dramatically improve code quality.

If you found this “What is Sanity Testing?” article relevant, check out the live-online Selenium Certification Training by Edureka, a trusted online learning company with a network of more than 250,000 satisfied learners spread across the globe. 

Got a question for us? Please mention it in the comments section of this ‘What is Sanity Testing?” article and we will get back to you. 

Comments
0 Comments

Join the discussion

Browse Categories

Subscribe to our Newsletter, and get personalized recommendations.