Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is a sanity test/check

What is it and why is it used/useful?

like image 971
Andy Hin Avatar asked Oct 29 '10 20:10

Andy Hin


People also ask

What is checked in sanity testing?

Definition: Sanity testing is a subset of regression testing. After receiving the software build, sanity testing is performed to ensure that the code changes introduced are working as expected . This testing is a checkpoint to determine if testing for the build can proceed or not.


2 Answers

A sanity test isn't limited in any way to the context of programming or software engineering. A sanity test is just a casual term to mean that you're testing/confirming/validating something that should follow very clear and simple logic. It's asking someone else to confirm that you are not insane and that what seems to make sense to you also makes sense to them... or did you down way too many energy drinks in the last 4 hours to maintain sanity?

If you're bashing your head on the wall completely at a loss as to why something very simple isn't working... you would ask someone to do a quick sanity test for you. Have them make sure you didn't overlook that semicolon at the end of your for loop the last 15 times you looked it over. Extremely simple example, really shouldn't happen, but sometimes you're too close to something to step back and see the whole. A different perspective sometimes helps to make sure you're not completely insane.

like image 155
Sion Sheevok Avatar answered Oct 02 '22 20:10

Sion Sheevok


Good example is a sanity check for a database connection.

SELECT 1 FROM DUAL 

It's a simple query to test the connection, see:

SELECT 1 from DUAL: MySQL

It doesn't test deep functionality, only that the connection is ok to proceed with.

like image 43
Jon Avatar answered Oct 02 '22 19:10

Jon