Glossary · Testing fundamentals
Sanity testing
Also called: sanity test, sanity tests
Definition
A narrow, focused check after a small change or bug fix to confirm that the affected area works as intended before wider testing continues.
Sanity testing is a quick, targeted check that a specific change works and that the area around it still behaves rationally. It happens after a bug fix or a minor change on a build that is already reasonably stable. If the sanity check fails, the build goes back to development without spending time on a full regression run.
Example
A bug report says the “Forgot password” email is not sent when the address contains a plus sign (ana+test@example.com). The developer ships a fix. A sanity check would:
- Request a reset for
ana+test@example.comand confirm the email arrives. - Request a reset for a normal address and confirm it still works.
- Follow the reset link and confirm the new password is accepted.
That is it. Nobody checks the shopping cart or the reporting module here. If these pass, the build moves on to regression testing.
Sanity vs smoke testing
| Sanity testing | Smoke testing | |
|---|---|---|
| Scope | Narrow and somewhat deep, one feature or fix | Broad and shallow, the whole application |
| Trigger | A specific fix or small change | Every new build |
| Build state | Already fairly stable | Unknown, possibly broken |
| Form | Often unscripted, done by a tester | Usually a scripted, automated suite |
Some teams describe sanity testing as a subset of regression testing focused on the changed area. That is a reasonable way to think about it.
A note on terminology
Definitions vary between companies and textbooks, and some teams use “smoke” and “sanity” interchangeably. In an interview, give the distinction above, then say that what matters in practice is that the team agrees what each check covers and when it runs. Being precise and acknowledging the ambiguity reads better than insisting on one textbook.