When there are some minor issues with application and a new build is obtained after fixing the issues then instead of doing complete regression testing, a sanity is performed on that build. Basically, sanity testing is a subset of regression testing.
Sanity testing is done after thorough regression testing is over, it is done to make sure that any defect fixes or changes after regression testing does not break the core functionality of the product. It is done towards the end of the product release phase.
Sanity testing follows narrow and deep approach with detailed testing of some limited features.
Sanity Test Cases of a telephone:
1.) Verify that Phone is in working state, i.e., we are able to hear receiver bell.
2.) Verify that Phone has STD activated or not.
3.) Verify that Phone has ISD activated or not.
4.) Verify that Keypad of Phone are working properly after pressing.