Sanity testing means the test engineer will verify the major functionalities of the application to test whether the application is ready for testing or not.
In other words, it is a very brief run-through of the functionality of a computer program, system, calculation, or other analysis, to assure that the system or methodology works as expected, often prior to a more exhaustive round of testing.
In short, Sanity works on Rule of Thumb.
Rule of Thumb
A rule of thumb is a principle with broad application that is not intended to be strictly accurate or reliable for every situation. It is an easily learned and easily applied procedure for approximately calculating or recalling some value, or for making some determination.
Importance of Sanity Testing
With the evolution of test methodologies, sanity tests are useful for identifying problems related to different area of application. Some of these are:-
Initial Environment Validation: The process of sanity testing begins with the execution of some online transactions, batch programs of various modules to see whether the software runs without any hindrance or abnormal termination. This practice can help identify most of the environment related problems.
For example, if a person has just set up a computer and a compiler, a quick sanity test can be performed to see if the compiler actually works: write a program that simply displays the words "hello world".
Identify Missing Object: Sanity testing helps to identify the dependent missing objects.
Application Stability Test: Sanity Testing is used to check whether a new version of application is stable and performing well. It normally includes a set of core tests of basic GUI functionality to demonstrate connectivity to the database, application servers, printers, etc.
For example, an application is crashing the system and destroying the database every ten minutes, which means that the testing cannot be carried on as the current state is not stable.
Check for missing errors from previous build: Sanity testing is carried on to check a particular functionality which had errors in previous versions and were not able to proceed further and which is ready for testing in latest version.
Bringing the disparity between Smoke Testing and Sanity Testing
There are occasions where some testing communities often equated Sanity testing and Smoke testing. Below table draws the difference between the two:
Sanity Testing - A overview