Sanity check or sanity test is a basic test to quickly evaluate whether a claim or the result of a calculation can possibly be true. It is a simple check to see if the produced material is rational. In computer science, a sanity test is a very brief run-through of the functionality of a computer program, system, calculation, or other analysis, to assure that part of the system or methodology works roughly as expected.
Sanity testing is a type of testing that is performed on the stable build of the software to ensure that the code changes made are working properly without any bugs. It is a quick and superficial check to ensure that the system is still functioning as expected after a change has been made. Sanity testing is often used as a preliminary step before conducting more extensive testing, such as regression testing.
Some key features of sanity testing include:
- It is a subset of regression testing and is usually executed after the software product has passed the smoke test.
- It is a more focused test that allows testers to focus on one or few specific areas of the system and confirm that the changes there have not caused any unintended side effects.
- It is an efficient way to verify that a small change or modification to the system has not caused any unintended side effects or broken any existing functionality.
Sanity testing is used to validate the changes made to one or few specific parts of the application in order to make sure that the software is still functioning as expected after a small change or a bug fix. It is often used as a preliminary step before conducting more extensive testing, such as regression testing. If the sanity test fails, the build is rejected by the testing team to save time and money. It is performed only after the build has cleared the smoke test.