What is sanity testing and smoke testing?

In this post, we will discuss sanity and smoke testing. We will also discuss differences between smoke and sanity testing. Most people think that these two testing types are the same, but they are completely different. Read this article carefully to understand this topic easily.

Sanity Testing

It is a subset of regression testing and ensures that the changes made in the code of the application are working correctly. This type of testing is performed after the software build is released with some minor changes in the code. We have to make sure that code changes don’t affect the functionality of the application, and all the bugs have fixed. It helps us in saving both time and money involved in testing if the software build gets failed.

If the functionality is not working as expected after minor changes in the code, then the sanity testing fails.
If the functionality is working as expected after minor changes in the code, then the sanity testing passes.

We are working on the calculator app. Now software development team has done some minor changes in the code as per the customer requirements.

After some changes in the code when you try to perform some primary functions like add two numbers of multiply two numbers. For example, you tried to multiply 3*4, and your calculator gives the result as 18. As our primary functions are failed, there is no benefit of performing advanced operations.

Example of Sanity Testing

Let us suppose our software team is working on the Facebook application. In the first two builds, we release the application with login, add friends and chatting functionality.

In the third build, we also add other functionalities like create the page, create posts. Now our software development team will add these functionalities in the application, and sanity testing will be performed to make sure these changes doesn’t impact the other functionalities of the application.

If it affects the functionality, then the development team will again fix those issues. Whenever there are some changes in the code or some new functionality is added, sanity testing will be performed.

How you will differentiate sanity testing and smoke testing

Smoke Testing

Smoke testing is performed on software build to check that the critical functionalities of the software application are working fine. It is performed before regression testing or any other testing.The primary purpose of this type of testing is to reject the software application, which has defects so that the QA team is not required to waste their time in testing this software application.

This type of testing is performed in the early stages of the software build, and it is a subset of acceptance testing. This type of testing can be performed manually or through automated tools.In Smoke Testing, the main focus is to make sure that the software build we receive from the development team is testable or not.

If it is testable, then QA team tests the software application; otherwise, it is rejected. By rejecting the software application in the early stages, It saves a lot of time in the testing process.

Examples of Smoke testing

With the help of these two examples, you will get to know about the smoke testing. You will also know when to accept the build and when to reject the build.

In this case, we are taking the example of the most popular social platform Facebook.

Case 1

  • You try to login to Facebook.
  • When you try to login Facebook, then you are not able to login with valid credentials.
  • If you are not able to login to this application, then the other functionalities can not be tested, So QA team is not required to test this application.
  • As a result, the software build is rejected, and it saves a lot of time.

Case 2

  • You try to login to Facebook.
  • When you try to login Facebook, then you can successfully log in.
  • You can also login this application by using the wrong password.
  • If a user can also log in by using the wrong password, then it is a security concern and needs to be resolved.
  • As you can log in to the application, other functionalities can be tested. So the application is forwarded to the QA team for testing purpose.
  • As a result, the software build is Accepted.

Difference between Sanity and Smoke Testing

Sanity TestingSmoke testing
This is performed to make sure that new functionalities/bugs have been fixed.This is performed to make sure that the critical functionalities of the application are working fine.
The objective of sanity testing is to verify the rationality of the system.The objective of smoke testing is to verify the stability of the system.
Sanity Testing is performed by the testers.Smoke testing is performed by both testers and developers.
Sanity testing is not documented and is unscripted.Smoke testing is documented and scripted.
It is performed after smoke testing.It is performed at the early stages.
Sanity testing is a subset of regression testing.Smoke testing is a subset of acceptance testing.
This type of testing is based on a narrow approach.This type of testing is based on a wide approach.

In the next post, we will discuss Regression Testing and Retesting. We will also discuss the differences between regression and retesting. If you have any doubts related to this topic, do let us know in comments. If you are looking to learn software testing from scratch, click here.

Leave a Comment