It is widely believed that smoke testing is only performed when the software is new or has undergone significant changes, while sanity testing is done when the software undergoes bug fixes or minor enhancements.

We recommended that you always perform smoke testing before performing sanity testing check. Smoke testing is quick, easy on your resources, and doesn't require skilled testers. More importantly, it ensures that crucial features of the software work as expected.

For example, it is reasonable for testers to assume a change in the product page layout in an e-commerce application is unlikely to affect the search, product catalog, shopping cart, or billing features.

In such scenarios, testers perform sanity testing as testing everything would be very time-consuming. They will verify that the product screen is correctly displayed for different kinds of products on various browsers and devices.

However, there is still a risk that while fixing that page, the developers made a change that affects other parts of the code.

For example, your e-commerce site developer can modify the abbreviate function that abbreviates a long string to shorten its input to 40 characters instead of 80. The product screen will work fine. However, the shopping cart screen, which also uses the same function, will now have a big problem because it will not display some crucial details. End-users will not checkout and cost your business a lot of revenue.

Smoke testing would have quickly exposed this defect and saved you the time and effort of sanity testing, something which you have to redo anyway once your developers fixed the checkout screen.

It is no surprise that Microsoft claimed that, after code reviews, smoke testing is the most cost-effective method for identifying and fixing defects.