Difference Between Smoke and Sanity Testing
Overview
Smoke and Sanity testing are both done on the build. When a source code is converted using commands to standalone software deployed on the server is called build. The code is not running on the server using eclipse or visual studio code IDE.
The testing team tests the deployed build only to check if there are any bugs in the system.
Introduction
On a project simultaneously, multiple developers are working on their respective functionalities. They are running and developing the code on their local system. The merged code is deployed on the server.
There are three server types: a development server, a testing server, and a production server. The testing server is the one where smoke and sanity testing is done. Nowadays, the testing server could be a virtual environment from Saucelabs, BrowserStack, etc.
What is Smoke Testing?
Smoke testing is done to validate if all application functionalities are working fine. Both developers and testers do smoke testing on the build. The application performance on the local system is always different from that on the server. Hence, it's a different environment setup.
After a build is deployed, say on Day 1, smoke testing is done to test functionality A, B. After 15 days, another build is deployed where smoke testing is done to test functionality A, B, C, D.
Features of Smoke Testing
- Smoke testing is done to validate if the build is working fine on the server.
- Both developers and testers do smoke testing.
- Smoke testing tests the functionality. If a bug is found, the code is fixed, build is deployed again.
- Smoke testing is done on the test environment. The application behavior on the local system vs. server is a lot different.
What is Sanity Testing?
Sanity testing is regression testing done on the build after the bugs are fixed. Regression testing ensures that changes on one part of the code have not affected the rest of the application.
For example, If a site has payment integration, but Gpay had some issues. In sanity testing, Features of Gpay would be tested and ensured that the rest of the UPI integrations are working just fine.
Sanity testing is done only by the testers. Post sanity testing, only the bug is closed.
Features of Sanity Testing
- Sanity testing is regression testing done by testers on the server.
- Sanity testing is done to check whether the bug is fixed.
- Sanity testing is done after smoke testing.
- Sanity testing is reported in the bug cycle.
Difference between Smoke Testing and Sanity Testing
Criteria | Smoke Testing | Sanity Testing |
---|---|---|
Definition | Smoke testing is done to test the functionalities working fine on the build server. | Sanity testing use case is to test the build that new changes have not affected the old code. |
Users | Smoke testing is done by both developers and testers. | Sanity testing is done only by the testers |
Purpose | Smoke testing is done to test that all the features listed in the requirements document are working fine. | Sanity testing is done for regression testing. That is rest of the product is working fine. |
Report | Smoke testing results are reported in RTM. | Sanity testing result is reported in the bug cycle. |
Example | Testing features of a site on a testing environment. | Regression testing ensures the bug is fixed and the rest of the features also work fine. |
Conclusion
- Smoke testing tests all the requirements listed by the client in RTM are working fine. Smoke testing is done on the build.
- Sanity testing ensures new code has not affected the previously validated features.
- Smoke testing is done by both developers and testers, whereas the testers only do Sanity testing.
- Smoke testing is done first, and then on new features, Sanity testing is done.