Difference between Sanity Testing and Smoke testing

Can anyone help me with the differences between sanity vs smoke testing with some good examples. im a bit confused after googling some articles. please reply

5 Likes

According to my latest lookup at ISTQB:

smoke test
Synonyms: confidence test, sanity test, intake test
A test suite that covers the main functionality of a component or system to determine whether it works properly before planned testing begins.

so they are officially the same, although they probably have different history and different usage.

3 Likes

To me, the distinction between ‘sanity tests’ and ‘smoke tests’ depends on the context under which you’re doing the testing.

A ‘sanity test’, for me, is an initial look at a new build to see if there are any obvious glaring errors in functionality or presentation. It’s not normally done under pressure from the business, though the developer might be anxious to see if (for example) they’ve got a difficult fix right.

A ‘smoke test’, although it looks very similar, is usually (in my experience) applied when there’s business pressure - a demo, public launch or some other instance where visible failure would be an instant embarrassment. It consists of a quick run through the ‘happy path’ to see if the app can walk around on its own without bumping into the furniture, as a friend of mine once said. Often, it’s conducted with someone senior looking over your shoulder who hasn’t been closely connected with the project up until now, but has to go up in front of people who matter and pitch for the project. Reputations and jobs may be on the line, and could be impacted by simple but obvious problems that will take minutes to fix if they’re caught now.

A ‘smoke test’ may include instructions to someone doing a demo not to do X because that’s not finished yet.

2 Likes

Key difference between smoke testing and sanity testing:
-Smoke testing has a goal to verify “stability” whereas sanity testing has a goal to verify “rationality”.
-Smoke testing is done by both developers and testers whereas sanity testing is done by testers.
-Smoke testing verifies the critical functionalities of the system whereas sanity testing verify the new functionality like bug fixes.
-Smoke testing is a subset of acceptance testing whereas sanity testing is a subset of regression testing.
-Smoke testing is documented and scripted whereas sanity testing isn’t.
-Smoke testing verifies the entire system from end to end whereas sanity testing verifies only a particular component.

3 Likes

very late in seeing this post. But, if still looking for some material. Please check out the below article based upon my own real time experience working in the Industry:

Thank you
Mukta

2 Likes

Smoke testing is the component of the acceptance testing process which is meant to verify the entire system for end-to-end verification. Sanity testing on the other hand is a non-scripted process that works on a single component verification.

In broader terms, Smoke testing is meant to meet the stability goals of the application, and sanity testing is meant to align with rationality goals associated with the project.

2 Likes

You can automate smoke tests but its unlikely that you can automate sanity tests.

My older views went along the lines of the following.

Origins of smoke test.

Plumbing blow smoke down a pipe to check for leaks rather that risk destroying your pipe with water.

Circuit boards, turn on and watch for smoke, stop straight away if smoke there as its not fit for purpose and could do harm.

Woods, where there is smoke there is fire.

So in testing you can look at all of those,

quick smoke test to see if its ready for testing, i.e if the basic checks fail its not worth wasting time doing more testing at this point.

Circuit boards analogy is similar its a decision gate, proceed or stop and fix the basics before harm is done.

Woods, if you are getting basics issues found then its highly likely there will be many more problems the deeper your testing goes, so plan accordingly.

Sanity tests though gets things a bit more interesting and my views on this are evolving, a bit more human and empathy etc comes in.

In the past I have referred to them as insanity tests or wtf tests, its a full senses aware view on whether there is anything that blatantly stands out as a wtf is that sort of thing.

Consider a visit to a councilor, they automated their system so you get a series of basic questions, how are you feeling today, give a rating of 1 to 10 on your current stress levels. You can pass that smoke test whilst putting your pants on your head, putting two pencils up your nose and singing “Wubble wubble wubble, cluck cluck, jibber jibber, wubble! Beep!”

The sanity test requires full sensory awareness, empathy can be good factor and it should pick up on things that are completely unexpected and things like unknown risks that a smoke test may miss.

Note that does not mean that its thorough, it still tends to be a very rapid surface level check.

1 Like

I just love that image. Andrew.

IMHO
Smoke is the most useful happy-path handful of tests that verify further testing is worthwhile undertaking. Sanity is a contrived/informal test to verify that the “thing” you changed , specifically does what it says. Without setting up a totally clean room for a smoke test. Which is pretty much what @robertday already said.

1 Like

Smoke testing is an approach which is usually carried out during the initial development stages of the Software Development Life Cycle(SDLC) to make sure that the core functionalities of a program are working fine without any issues. It is executed before any detailed functional tests are done on the software.
Example: Consider E-commerce application: QA will check basic features like Login, forgot password, Product page, Add to Cart, checkout with Cash on Delivery etc. After these work fine then QA will do detail testing.

Sanity testing is a kind of testing performed to check whether a software product is working correctly when a new module or functionality gets implemented to an existing product.
Example: Consider Now in E-commerce application online payment is newly introduced. So QA will check Login, Forgot Password, Product page, Add to Cart, Checkout with Cash on Delivery and online payment. After these work fine then QA will do detail testing.

2 Likes

It’s too easy to re-describe component “integration testing” as sanity testing. An important distinction to make, for me a sanity test cannot ever PASS, because a sanity test is in my books, informal. It’s a manual test assertion I made up 5 minutes ago, to gain confidence of an integration. I won’t sanity test often. I just think that’s lazy language and how we need to stop using “loaded” words.

I feel I’m repeating, but to me a smoke test, is a suite of checks that everyone agrees upon , and constitutes basic functionality that needs to be working, and otherwise blocks all teams’s progress. (If not passing smoke you cannot merge your new code.)

I like how you describe the actual context in your answer, something I often don’t manage. I like this definition, yes.

2 Likes

Thanks for your comment !!

It’s a Blackadder reference, the humor might have been too subtle though outside of UK.

1 Like

It was probably a Cunning Plan.

1 Like