Smoke Testing is the initial of testing which is basically done to ensure that all the basic functions of an application is working fine. Smoke Testing is also called as a Build Verification Testing shortly called as BVT. A Set of Test focusing on the Core Functionalities of the application is run along with its test cases is executed on every new build to verify that the build is good enough to proceed in testing .This type of testing is very essential to perform in the early stages of Testing as it identifies the bugs or issues that are inside the code. The results of this testing is used to decide if a build is stable enough to proceed with further testing and thus reduces the time and cost of Testing.
Sanity Testing :
Sanity Testing is usually an unplanned activity done with a unscripted approach when we do not have much time to test. This type of testing is done to ensure that the basic menus, commands, functions etc are working well after a small change in the code. It helps to identify the dependent missing functionalities. It is narrow way of testing where it focus on one or few functionality to test to ensure that the application or a software is working fine.
Difference between Smoke and Sanity
Smoke Testing is a methodical way of execution of testing where we have a set of test cases written for it and executed whereas Sanity is a unscripted rather non documented approach of testing where we execute the act of testing without any test cases to execute.
Smoke Testing is done in the initial stage of testing when the build is deployed in the Test Environment to ensure that Build given for testing is working fine to proceed further on testing while Sanity Testing is done in the later stage of testing .
Smoke Testing is performed on end to end testing to ensure that stability of the application where as Sanity Testing is performed for a particular part of the system or component of the application to ensure that the fix or code change is not affecting the behavior of the system.
To Conclude on the above topic I would say in the Industry both these words are often confusing use them wisely according to your needs.