ScreenshotNeo

BlogGuides

Sanity Testing vs. Regression Testing: Key Differences

Sanity testing checks whether a change is ready for deeper testing; regression testing looks for unintended effects on existing behavior. Learn how to choose scope.

By the ScreenshotNeo team4 October 20268 min read

Sanity testing is commonly a quick, narrow check that a changed build or feature is coherent enough to continue testing. Regression testing checks whether a change introduced or exposed defects in parts of the software that were not changed. The terms describe different testing questions. Regression testing has a standards-based definition; “sanity testing” is common industry usage, but its scope varies by team.

Use a sanity check for an initial decision about whether deeper testing is worthwhile. Use regression tests to gather evidence that important existing behavior still works after a change. A sanity check does not replace regression coverage, and neither term implies one mandatory test count or sequence.

What is the difference between sanity testing and regression testing?

Question Sanity testing (common usage) Regression testing
What does it ask? Does the changed build or area appear stable enough to continue testing? Did the change cause defects in unchanged areas?
What is the scope? Usually narrow and quick, often selected around the change; defined locally by the team. Selected existing tests, from change-focused checks to broad coverage, based on risk and impact.
When does it happen? Often after a new build, fix, or change, as an initial check. After a software, configuration, or data change that might affect existing behavior.
What decision does it support? Whether deeper testing is worth proceeding with on this build. Whether important existing behavior continues to work after the change.
How is it run? Often manually, but it can be automated. Manually or automatically; automation can make repeated checks faster and more consistent.

ISTQB defines regression testing as change-related testing to detect defects introduced or uncovered in unchanged areas of software. The cited ISTQB glossary does not define sanity testing as a formal counterpart. Treat the sanity column as a useful description of common usage, and document your team’s meaning. ISTQB Standard Glossary

When should I use sanity testing?

Run a sanity check when a build or fix needs a small initial check before investing in deeper testing. Choose checks that demonstrate the changed area is coherent enough to proceed. For a checkout change, for example, an initial check might confirm that the checkout page opens and the modified interaction responds. The exact checks depend on the change and your team’s definition.

If this initial check fails, record the build and failure, then return the issue to the team responsible for the change. Continuing a broad test run against a build that cannot perform its basic changed behavior may produce results that are hard to interpret. Passing the check only says the selected narrow checks passed; it does not establish that other areas are unaffected.

When should I use regression testing?

Use regression testing after changes that could affect existing behavior. Changes to code are a common trigger, but configuration and data changes can also affect processes. Microsoft recommends regression testing after such changes and before a production change. Regression tests can be manual or automated. Microsoft Learn: types of tests

Regression testing is especially useful when components share code, data, configuration, or workflows. A change in one area can cause a defect elsewhere, even if that other area was not deliberately modified. Choose checks that provide evidence about the existing behavior most exposed to the change and the business processes where failure would matter most.

How to choose regression test scope

Regression does not automatically mean rerunning every test. Select a scope that matches impact, risk, and the time available. Microsoft describes broad, impact-focused, change-targeted, and combined approaches:

Approach What to run Trade-off
Broad coverage Test nearly all processes. Provides wider coverage, but costs more to run and maintain.
Business-priority coverage Prioritize processes by business impact. Protects high-impact workflows while leaving lower-priority areas with less coverage.
Change-focused coverage Target areas affected by the change. Requires less effort, but cannot establish that unrelated areas are unaffected.
Combined coverage Protect critical processes and increase testing around changed features. Balances focused checks and critical workflow protection; the right scope still depends on impact and available time.
  1. Understand the change. Identify affected code, configuration, data, interfaces, and workflows.
  2. Map dependencies. Identify unchanged components and processes that rely on the changed area.
  3. Rank impact. Consider user or business impact if a process fails, as well as how likely it is to be affected.
  4. Select tests. Include checks around the changed area and protect critical existing processes. Broaden coverage when impact is uncertain or wide.
  5. Record the reasoning. Note what was tested and what was left out so the remaining uncertainty is visible.

A targeted run offers useful evidence within its scope; it does not prove that every untested part of the application is unaffected. If impact analysis is weak, shared dependencies are extensive, or a failure would be severe, broaden the regression run where time and environment allow. Microsoft Learn’s testing strategy guidance describes these scope choices.

Sanity testing vs. confirmation testing

Confirmation testing asks whether a specific reported defect was fixed. It typically repeats the steps that reproduced the defect. Regression testing asks whether the change caused side effects in unchanged areas. After a fix, a practical sequence is to confirm the original failure is gone, then run regression tests selected through impact analysis.

A confirmation test can be narrow, but its purpose is specific to a fix. ISTQB’s Test Automation Engineer syllabus notes that confirmation tests can be added to an automated regression test bed. A shared suite can therefore contain both kinds of checks without making their goals identical. ISTQB Test Automation Engineer syllabus

Is sanity testing the same as smoke testing?

There is no universal distinction established by the cited primary sources. Organizations use “sanity” and “smoke” inconsistently, and teams may give the labels different scopes or purposes. Avoid relying on the label alone: state which build, features, workflows, and pass criteria the check covers.

How to automate regression testing

Automation is useful when important checks are repeated often enough that running them manually takes substantial effort, or when consistent execution matters. Microsoft recommends progressively automating regression tests: begin with key business processes and expand coverage over time. Automation can improve speed, coverage, and repeatability and reduce the risk of human error, but automated checks still need to be selected, reviewed, and maintained. Microsoft Learn: testing strategy

  1. Start with high-value repeatable checks. Prioritize critical business processes and stable behavior that is expensive to check manually.
  2. Run checks in a known environment. Record the application build and relevant configuration so failures can be investigated in context.
  3. Make results actionable. Preserve enough output, such as failure details and relevant screenshots, to help diagnose a failure.
  4. Review failures before treating them as product defects. A failed automation run can reflect a product regression, a test problem, or an environment issue.
  5. Maintain the suite as behavior changes. Remove obsolete checks, update valid expectations, and expand coverage according to risk.

Microsoft lists Microsoft Playwright, Selenium, the Regression suite automation tool, and third-party tools among the options in its Dynamics 365 guidance. Selection depends on the application, environment, test design, and maintenance capacity; the cited sources do not establish one universally best framework. Microsoft Learn: regression testing tooling

Capture screenshots as regression evidence

For web interfaces, screenshots can help reviewers understand a visual test failure. A screenshot alone does not show that behavior works: pair visual evidence with checks for the relevant interaction or expected state. For a repeatable browser workflow, a test runner such as Playwright or Selenium can capture the page as part of a run; choose tooling that fits your app and environment.

Or skip the browser setup

For a standalone capture, ScreenshotNeo is a website screenshot API and MCP server for developers. One GET request returns an image or PDF. It can be useful when you need a captured page as review evidence without setting up a browser capture flow. See the ScreenshotNeo docs.

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
import requests

r = requests.get(
    "https://api.screenshotneo.com/v1/shot",
    params={"access_key": "YOUR_API_KEY", "url": "https://stripe.com"},
    timeout=90,
)
open("shot.webp", "wb").write(r.content)
const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://stripe.com' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);

Cookie banners, popups, and chat widgets are removed before the shot. Bot checks, blank pages, and failed loads are never billed; response headers indicate the page verdict and billing status. Its MCP server lets AI agents use screenshot tools. The free plan includes 1,000 screenshots a month with no card; paid plans start at $5 for 3,000.

Sign up free for 1,000 screenshots a month, no card required.

Common mistakes and troubleshooting

Problem Why it happens What to do
A team treats sanity testing as a fixed standard. The term’s meaning varies; the cited glossary does not set a universal scope. Write down the check’s purpose, scope, and pass criteria in your team’s process.
A narrow sanity check is treated as proof of no regressions. It usually focuses on the changed area and may miss side effects elsewhere. Run regression tests for affected and critical unchanged behavior.
Regression testing means rerunning everything on every change. “Regression” describes the goal, not a mandatory suite size. Choose broad, priority-based, change-focused, or combined coverage based on risk and time; record the limits.
A bug-fix check is called regression testing. The check may only repeat the defect steps, which verifies the fix rather than side effects. Separate confirmation of the fix from regression checks for collateral effects, even if both run in one suite.
A failing automated check is immediately blamed on the product. Test code or the environment can fail independently of product behavior. Inspect the failure details, build, configuration, and test setup before classifying it.
Visual snapshots change between runs. Differences in page state, data, or capture conditions can affect screenshots. Stabilize the state and capture conditions, and investigate differences before updating expected evidence.

Performance, reliability, and cost

Sanity checks are usually small by convention, so they can provide an early signal with limited execution effort. Regression cost depends on the size and maintenance of the selected suite, the environment, and how often it runs. Broader coverage takes more effort to execute and maintain; targeted coverage takes less effort but leaves more untested behavior. Avoid claims that one scope is always fastest or sufficient.

Automating repeatable, high-value checks can improve execution speed and consistency over time, but test development and maintenance also take effort. Start where repeated manual work or risk justifies that investment. For visual evidence, keep capture conditions consistent and retain enough context to investigate failures; a screenshot is evidence of appearance at a point in a run, not proof of all functional behavior.

FAQ

Does regression testing retest everything?

No. Teams can select a broad suite, prioritize by business impact, target affected areas, or combine these strategies. The scope should reflect risk and available time.

Can sanity testing be automated?

Yes. “Sanity” describes a commonly used purpose and scope, not a required manual technique. Define the checks and pass criteria locally, then automate them if repeated execution merits it.

Should regression tests run before production?

Microsoft recommends regression testing after changes to code, configuration, or data that could affect processes, and before a production change. Choose scope according to impact and risk.

Can the same test be both confirmation and regression testing?

A suite can contain both types of test, and one run can include both purposes. Identify whether a particular check verifies a reported fix or looks for side effects so results remain clear.