Skip to main content
XenonStack

TestOps

XenonStack Insights Sanity Testing: Techniques, Tools and When to Use It

and | Published | Updated

Sanity Testing: Techniques, Tools and When to Use It
10:25
Sanity Testing Explained: a quick gate for fixes before wider testing, shown as a stack from smoke test to release decision.

Key takeaway

  • Sanity testing is a quick, focused check that a fix or small change works before wider testing. See how it differs from smoke and regression testing.

What is sanity testing?

Sanity testing is a quick, narrow check that a specific bug fix or small change works as intended, run on a build that has already passed its first checks. It tells the team whether the build is worth deeper effort or should go straight back to the developer. It is usually treated as a focused subset of regression testing.

Terminology varies. The ISTQB glossary, as reproduced on istqb-glossary.page lists "sanity test" as a synonym of smoke test, while many teams use the two words for different checks. This guide uses the common team meaning: smoke checks ask whether the build is stable at all, sanity checks ask whether the change just made behaves sensibly. For a side-by-side view, read our smoke testing vs sanity testing guide.

How does sanity testing work?

A sanity test follows a short sequence. It is usually unscripted or lightly scripted, so the value comes from choosing the right few checks.

Two-column diagram of the sanity test steps: receive the build, identify the change, run focused checks, pass or reject, mapped to the decision each step supports.
StepWhat happensDecision it supports
1. Receive the buildA build arrives with a fix or a small change, after it has passed basic stability checks.Is the build ready to test further?
2. Identify the changeRead the change note or ticket and list the functions it touches and their nearest neighbours.What must be checked, and what can wait?
3. Run a few focused checksExercise the fixed behaviour and the closely related paths, narrow but with real depth.Does the change do what the requirement says?
4. Pass or rejectIf the checks pass, move on to wider testing. If not, reject the build and report the defect.Spend more test effort, or stop now?
5. Record the resultNote which checks ran, which defects were found and what was left untested, with reasons.What does the release note say?

How is sanity testing different from smoke and regression testing?

Sanity testingSmoke testingRegression testing
Question it answersDoes this change work as intended?Is the build stable enough to test?Did the change break anything that worked before?
ScopeNarrow and deep on a few areasBroad and shallow across core functionsWide, across all areas the change could affect
Typical timingAfter a fix or small change, on a stable buildStraight after a new buildAfter the change is accepted, before release
Typical styleOften manual or exploratoryOften automatedPreferred for automation
OutcomeReject the build or widen testingAccept or reject the build for testingConfidence that existing behaviour holds

The ISTQB glossary, as reproduced on istqb-glossary.page defines regression testing as testing of a previously tested program following modification, to show that a change has not introduced or exposed defects in unchanged areas. Sanity testing is the cheap check that decides whether paying for that is worthwhile. For the smoke side, see smoke vs regression testing.

When should you run a sanity test, and when is it not enough?

SituationRun a sanity test?Why
Hot fix for a single defect, little timeYesIt confirms the fix works before you spend a full regression cycle.
Minor change to existing functionalityYesIt checks the change and its nearest neighbours quickly.
New build that may be unstableNot firstRun a smoke test first. Sanity checks assume the build already starts and its core works.
Major release with new modulesNot enoughNeeds full functional, integration and regression testing. See system testing.
Performance, load or security riskNot enoughQuick manual checks cannot show these. Use dedicated automated testing.

What does a sanity test look like in practice?

This is an illustrative example, not a case study. Suppose a defect report says a discount code is ignored at checkout, and the developer ships a fix.

CheckWhat the tester doesWhy it belongs in the sanity set
The fix itselfApply the discount code to a basket and confirm the total changesThis is the change under test
Nearest neighboursAdd and remove items, change quantity, then re-check the totalThe pricing code is shared with these paths
Direct dependantsComplete the order and check the order summary shows the same totalA wrong total here would block the release
Left for laterPayment methods, delivery options, account pagesOutside the change; leave for regression, and note it as untested

Which techniques and tools support sanity testing?

Most sanity checks start as a short manual checklist. Automation helps when the same checks repeat on every build. Two documented patterns are below, and they work with whichever test tool you already use.

ApproachHow it helpsSource
Manual checklistThe tester lists the change, its neighbours and what is out of scope, then records the result.Common testing practice
Tagged automated testsPlaywright lets you tag tests with an @-prefixed tag and run only those with the --grep option, so a small sanity subset runs on every build.Playwright documentation (read 13 Nov 2026)
Pipeline gateIn Azure Pipelines, stages run in order by default, and a stage runs only if the stages it depends on succeeded unless you set a custom condition. A sanity stage can therefore sit between build and the wider test stages.Microsoft Learn (read 13 Nov 2026)

To see where this sits in a wider testing strategy, read shift-left testing, continuous testing in DevOps and TestOps best practices.

What are the best practices for sanity testing?

Keep it short. Limit the set to the changed behaviour and its closest neighbours. If it grows into a full cycle, it has become regression testing.

Prioritise the critical path. Check what the business cannot release without, such as a failed checkout or login.

Reject quickly. If a sanity check fails, return the build at once instead of continuing with deeper testing.

Automate the stable checks. Move repeated checks into tagged tests or a pipeline stage, and keep the exploratory checks manual.

Record what ran. Note the executed cases, the defects with their status and anything left untested, with reasons, in the release note.

Review the set often. Update the checks as the product changes so they stay relevant.

How do sanity checks fit when AI agents change the code?

As coding and testing agents propose more small changes, the number of builds that need a fast gate grows. The sanity check is a natural place to put an explicit rule: the agent may merge only when the focused checks pass, and a person decides when they do not. Agentic software testing covers the agents, tools and controls that make this safe.

According to its site, AgentQA tests agent outputs and workflows continuously, and ElixirClaw is an agentic OS platform to build, orchestrate and govern AI agents and automation workflows. Both are worth a look if sanity gates for agent-made changes are on your roadmap.

Related testing guides

To map one release decision your testing agents should make, and the context and policy it depends on, book a Context Workshop. See what happens in the workshop.

Frequently asked questions

What is sanity testing in simple terms?

It is a quick check, usually after a bug fix or small change, that the changed behaviour works as intended. If it fails, the build goes back to the developer. It is usually treated as a subset of regression testing.

Is sanity testing the same as smoke testing?

Not in common team practice. Smoke testing asks whether a build is stable enough to test, and sanity testing asks whether a specific change works. The ISTQB glossary, as reproduced on istqb-glossary.page, does list sanity test as a synonym of smoke test, so define the terms in your own test plan.

Is sanity testing manual or automated?

Either. It is often manual or exploratory because the checks depend on the change, but stable repeated checks can be tagged and run automatically, for example with Playwright tags and the --grep option.

When should you not rely on sanity testing?

Do not rely on it for major releases, new modules, or performance, load and security risk. It is narrow by design and does not replace regression or system testing.

What should be recorded after a sanity test?

Record the cases executed, the defects found with a status, and anything left untested with the reason, so the release note shows what was and was not checked.

Next Steps with Sanity Testing

Talk to our experts about implementing compound AI system, How Industries and different departments use Agentic Workflows and Decision Intelligence to Become Decision Centric. Utilizes AI to automate and optimize IT support and operations, improving efficiency and responsiveness.

 

Table of Contents

navdeep-singh-gill

Navdeep Singh Gill

Global CEO and Founder of XenonStack

LinkedIn profile

Navdeep Singh Gill is serving as Chief Executive Officer and Product Architect at XenonStack. He holds expertise in building SaaS Platform for Decentralised Big Data management and Governance, AI Marketplace for Operationalising and Scaling. His incredible experience in AI Technologies and Big Data Engineering thrills him to write about different use cases and its approach to solutions.

Get the latest articles in your inbox

Subscribe Now

Interested in solving your challenges with the XenonStack team?
Get Started

Tell us about you and your priorities so we can prepare the right conversation. It takes about 2 minutes.

Please Select your Industry
Banking
Fintech
Payment Providers
Wealth Management
Discrete Manufacturing
Semiconductor
Machinery Manufacturing / Automation
Appliances / Electrical / Electronics
Elevator Manufacturing
Defense & Space Manufacturing
Computers & Electronics / Industrial Machinery
Motor Vehicle Manufacturing
Food and Beverages
Distillery & Wines
Beverages
Shipping
Logistics
Mobility (EV / Public Transport)
Energy & Utilities
Hospitality
Digital Gaming Platforms
SportsTech with AI
Public Safety - Explosives
Public Safety - Firefighting
Public Safety - Surveillance
Public Safety - Others
Media Platforms
City Operations
Airlines & Aviation
Defense Warfare & Drones
Robotics Engineering
Drones Manufacturing
AI Labs for Colleges
AI MSP / Quantum / AGI Institutes
Retail Apparel and Fashion

Continue