1. Home
  2. Blog
  3. Software Testing

Software Testing

Retesting vs Regression Testing: 8 Key Differences with a Real Bug Fix Example

Retesting checks that a reported bug is really fixed. Regression testing checks that the fix, or any other change, did not break something that used to work. See both in action on one bug fix, then compare them across 8 differences you can quote in an interview.

8 min read
Retesting vs regression testing: key differences

Key takeaways

  • Retesting vs regression testing: retesting asks “is this bug fixed?”, regression testing asks “did anything else break?”.
  • Retesting reruns the failed test for a known defect; regression testing reruns passing tests around the change.
  • In our example, the retest passed, but the regression run caught a new bug the developer had introduced in the same commit.
  • Regression suites are the best candidates for automation; retests are often manual, though automated failed tests can be rerun in seconds.

“Is retesting the same as regression testing?” is one of the most common QA interview questions, and in day-to-day work the line in retesting vs regression testing is often blurred. They answer different questions, run at different times and need different amounts of effort. To make the difference concrete, we built a small shopping cart, logged a bug, fixed it, and ran both kinds of testing with pytest 9.2.0 on Python 3.13.

Quick answer

Retesting (also called confirmation testing) means running the exact test that found a defect again, after the fix, to confirm it now passes. Regression testing means rerunning tests that already passed to make sure a change has not broken existing behaviour. You usually do retesting first and regression testing right after it.

What is retesting?

Retesting is targeted. A tester reports a bug with clear steps, the developer fixes it, and the tester repeats the same steps with the same data on the new build. If the result is correct, the bug is closed; if not, it is reopened. It follows the bug life cycle directly: “Fixed” is never “Closed” until a retest passes.

  • It is planned around specific defect IDs.
  • It uses the original test case and data, so a well-written bug report makes it fast.
  • It cannot be skipped: a fix nobody has verified is just a guess.

What is regression testing?

Regression testing is protective. Any change, whether a bug fix, a new feature, a library upgrade or a configuration change, can have side effects. Regression tests rerun existing checks in and around the changed area to catch those side effects, which nobody reported because they did not exist yesterday.

  • It is planned around risk and impact, not specific defects.
  • Its scope ranges from a few related tests to the full suite.
  • It runs after every meaningful change, so it benefits most from automation and CI. Our regression testing checklist covers planning it.

A real bug fix example

Our cart has two functions: total(), which applies a coupon, and shipping(), which is free above 500. Six tests cover them, including the boundary case that exactly 500 still pays shipping.

Run 1: the bug is found

FAILED test_cart.py::test_coupon_lowercase - AssertionError: assert 200 == 180
1 failed, 5 passed in 0.41s

The coupon save10 in lowercase was ignored. We logged it as BUG-101.

The fix

The developer changed the coupon check to coupon and coupon.upper() == "SAVE10". In the same commit, while “tidying up”, they also changed the shipping rule from total > 500 to total >= 500.

Run 2: retesting

$ pytest --lf
1 passed in 0.10s

pytest’s --lf (last failed) option reruns only the tests that failed last time. That is retesting in its purest form: BUG-101 is fixed.

Run 3: regression testing

$ pytest
FAILED test_cart.py::test_shipping_boundary - assert 0 == 49
1 failed, 5 passed in 0.18s

The full suite caught what the retest could not: an order of exactly 500 now shipped for free. Had the team stopped after the retest, the shipping bug would have reached production. After the developer reverted the shipping change, all 6 tests passed.

Tip: this is why “the fix is verified” and “the build is safe” are separate sign-offs. One retest proves the first; only a regression run supports the second.

8 key differences

# Aspect Retesting Regression testing
1 Purpose Confirm a specific defect is fixed Confirm changes did not break existing features
2 Trigger A defect marked as fixed Any code, config or environment change
3 Tests run Previously failed test cases Previously passed test cases
4 Scope Narrow: the defect and its steps Wide: affected areas up to the full suite
5 Planning basis Defect IDs Impact and risk analysis
6 Finds Whether the known bug still exists New, unexpected bugs (regressions)
7 Automation Often manual; automated if the failing test is automated Strong candidate for automation and CI
8 Priority and order Done first, higher priority Done after retesting, can run in parallel

Which comes first?

Retesting usually comes first. If the fix does not work, the build goes back to the developer and a full regression run would be wasted effort. Once the retest passes, regression testing begins. In a CI pipeline with automated tests the distinction blurs, because every push runs the whole suite and does both at once. The concepts still matter: a pull request should state which bug it fixes (the retest) and the pipeline proves nothing else broke (the regression).

Automation: where each fits

Regression tests repeat the same checks release after release, which makes them ideal for automation. A suite that takes a manual team two days can run in minutes on every commit. Retesting is often manual, especially for UI or exploratory findings, but if the failing case is automated, rerunning it is instant, as our --lf run showed. A good habit: when a bug is found manually, add an automated test that reproduces it before the fix. The retest becomes automatic, and the test joins the regression suite forever. Our pytest tutorial shows how to write such tests.

How much regression testing is enough?

Running everything on every change is ideal but not always possible. Teams usually combine:

  • Change impact: tests for code the change touches and code that depends on it.
  • Risk: payments, login and data integrity always get checked.
  • Smoke tests: a fast set proving the build basically works; see smoke vs sanity testing.
  • Full runs nightly or before release.

Keep the suite healthy: unreliable tests that fail at random erode trust in regression results, so fix or quarantine flaky tests quickly.

Checklist: from fixed bug to safe release

  1. Read the fix notes. Ask the developer which files and features the change touched; that list drives your regression scope.
  2. Retest on the right build. Confirm the build number, then repeat the exact steps and data from the bug report.
  3. Try close variations. If lowercase coupons failed, also try mixed case and spaces; partial fixes are common.
  4. Update the bug. Close it with build and evidence, or reopen it with what still fails.
  5. Run targeted regression. Execute tests for the touched features and anything that depends on them.
  6. Run the wider suite. Smoke tests at minimum; the full automated suite where time allows.
  7. Add the bug’s test to the suite. Today’s retest becomes tomorrow’s regression check.
  8. Report clearly. State separately “BUG-101 verified fixed” and “regression: 1 new failure found”, so release decisions use both facts.

Following these steps in our example would have caught the shipping regression at step 5, before anyone signed off the release. Severity of new findings then guides what blocks the release; see our severity vs priority guide.

Interview-ready answer

“Retesting is confirming that a specific defect has been fixed by rerunning the test case that failed. Regression testing is rerunning previously passing tests to make sure the fix or any other change has not broken existing functionality. Retesting is narrow, planned from defect IDs and done first; regression testing is broader, planned from impact and risk, and is the main candidate for automation.” Add a one-line example like our coupon and shipping bug and the answer stands out.

Common mistakes

  • Closing a bug after the retest alone when the fix touched shared code.
  • Retesting with different data from the bug report, which can hide a partial fix.
  • Calling a full rerun “retesting”; the words mean different things in test reports.
  • Never updating the regression suite with tests for fixed bugs, so old bugs can quietly return.
  • Bundling unrelated changes with a fix, as our developer did, which makes regressions more likely and harder to trace.

Final thoughts

Retesting vs regression testing is not either-or. Retesting tells you the bug you knew about is gone; regression testing tells you no new bug took its place. Our small example showed both sides in three runs: one failing test, one successful retest and one regression caught before release. Do both, retest first, automate the regression suite, and add every fixed bug to it.

Frequently asked questions

What is the main difference between retesting and regression testing?

Retesting confirms that a specific reported defect is fixed by rerunning its failed test. Regression testing checks that changes have not broken features that previously worked.

Is retesting the same as confirmation testing?

Yes. ISTQB calls it confirmation testing: rerunning the test cases that failed, after the defect has been fixed.

Which is done first, retesting or regression testing?

Retesting usually comes first. If the fix fails, the build returns to development; once it passes, regression testing checks for side effects.

Can retesting be automated?

Yes, when the failing test is automated, it can be rerun instantly, for example with pytest --lf. Many manual findings are retested by hand, so turn them into automated tests.

Why is regression testing usually automated?

Because the same checks are repeated after every change and release. Automation makes them fast, consistent and cheap to run on every commit in CI.

Keep learning

Work with Stack Quora

Need help with testing, WordPress or SEO?

We help teams ship better software and grow their sites. Tell us what you are working on and we will suggest a clear next step.

Keep reading

More guides on testing, AI & modern development

Enjoyed this article? Pick a topic and jump straight into our newest tutorials.

Artificial Intelligence

BM25 Explained: How Keyword Search Ranks Results, With Python Code and Hybrid Search

BM25 explained with a pure Python implementation we ran: the formula, IDF, term saturation, the k1 and b parameters, why…

Read article →
Software Development

HTTP Methods Explained: GET, POST, PUT, PATCH, DELETE, Tested on a Live Server

HTTP methods explained with a small server we ran: GET, POST, PUT, PATCH, DELETE, HEAD and OPTIONS, safe vs idempotent,…

Read article →
DevOps

Git Bisect Explained: Find the Commit That Broke Your Code, Manually or Automatically

Git bisect explained with a tested repository: find the one bad commit among 41 in 5 test runs, automate it…

Read article →
Test Automation

pytest Markers Explained: Custom Marks, skip, skipif, xfail and -m Filters

pytest markers explained with a tested suite: register custom marks, run only smoke tests with -m, combine filters with and,…

Read article →
Software Testing

Positive vs Negative Testing: Differences, 24 Real Test Cases and a Checklist

Positive vs negative testing explained with a real signup form: 6 positive and 18 negative test cases run in pytest,…

Read article →
Databases & SQL

SQL ORDER BY Multiple Columns: ASC, DESC, NULLS LAST, Case and Custom Order

SQL ORDER BY with multiple columns explained with tested queries: mixed ASC and DESC, tie-breakers, NULLS FIRST and LAST, case-insensitive…

Read article →
Databases & SQL

SQL Running Total: SUM OVER, Per-Group Totals, Moving Sums and the RANGE Trap

How to calculate a SQL running total with SUM() OVER: per-group totals, daily cumulative sums, moving sums, percent of total,…

Read article →
Software Development

JavaScript Sort Array: Numbers, Objects, Strings and Why 10 Comes Before 5

How to sort an array in JavaScript correctly: numbers with a compare function, objects by one or more fields, strings…

Read article →
Software Development

Python String Methods: Cheat Sheet, Real Examples and the strip() Trap

Python string methods with tested examples: split, join, strip, replace, find, startswith, is-methods, casefold, partition and translate, plus the strip()…

Read article →
Software Development

Python zip() Explained: Loop Two Lists at Once, Unzip, strict=True and Traps

Python zip() pairs items from several lists in one loop. Tested examples for dicts, unzipping with *, strict=True, zip_longest, sliding…

Read article →
Artificial Intelligence

Cosine Similarity Explained: Formula, Worked Example and Python Code

Cosine similarity explained simply: the formula, a worked example by hand, pure Python and NumPy code, cosine vs Euclidean distance…

Read article →
Software Development

UTF-8 Encoding Explained: How Text Becomes Bytes and How to Fix Garbled Text

UTF-8 encoding explained with byte-level examples we ran in Python: how characters become 1 to 4 bytes, why café turns…

Read article →
DevOps

Git Squash Commits: 4 Easy Ways, Tested Step by Step (rebase -i, reset, merge)

Git squash commits explained with 4 tested methods: interactive rebase, reset –soft, merge –squash and fixup with autosquash. Before-and-after logs,…

Read article →
Test Automation

pytest parametrize Explained: 7 Patterns with Tested Examples

pytest parametrize explained with 7 tested patterns: basic cases, readable ids, stacked decorators, pytest.param with xfail and skip, indirect fixtures…

Read article →
Software Testing

Retesting vs Regression Testing: 8 Key Differences with a Real Bug Fix Example

Retesting vs regression testing explained with a real bug fix run in pytest: retesting confirmed the fix, the regression run…

Read article →
Databases & SQL

Delete Duplicate Rows in SQL: 5 Safe Methods, Tested Step by Step

How to delete duplicate rows in SQL safely: find them, preview them, then remove them with ROW_NUMBER, MIN(id), EXISTS, rowid…

Read article →
Databases & SQL

SQL RANK vs DENSE_RANK vs ROW_NUMBER: Differences with Tested Examples

SQL RANK vs DENSE_RANK vs ROW_NUMBER in one table: how each handles ties, top-N per group, the second-highest salary trap…

Read article →
Software Development

JavaScript Optional Chaining (?.) Explained: 8 Examples, ?? Defaults and Traps

JavaScript optional chaining stops “Cannot read properties of undefined” errors. 8 tested examples for properties, arrays and methods, ?? vs…

Read article →
Artificial Intelligence

RAG Chunking Strategies Explained: Fixed, Overlap, Sentence, Recursive and Headings, Measured

RAG chunking strategies compared on one document with tiktoken 0.14: fixed-size, overlap, sentence packing, recursive splitting and heading-based chunks, measuring…

Read article →
DevOps

Git Stash Explained: Save, Apply, Pop and Untracked Files, Tested

Git stash explained with commands we ran on Git 2.56: push with a message, untracked files, list and show, apply…

Read article →
Software Testing

Pairwise Testing Explained: How All-Pairs Cuts 216 Tests to 13, Tested

Pairwise testing explained with a generator we ran in Python 3.13: a checkout with 216 combinations covered by 13 tests,…

Read article →
Test Automation

Test Doubles Explained: Dummy, Stub, Spy, Mock and Fake, with Tested Python Code

Test doubles explained with one Python example run in pytest 9.2: dummy, stub, spy, mock and fake, when to use…

Read article →
Databases & SQL

SQL COALESCE Explained: Defaults, NULLIF, IFNULL vs ISNULL and Traps, Tested

SQL COALESCE explained with queries we ran in SQLite 3.50: first non-null values, empty strings, NULL in maths, NULLIF for…

Read article →
Databases & SQL

SQL Self Join Explained: Employee-Manager, Pairs and Row Comparisons, Tested

SQL self join explained with queries we ran in SQLite 3.50: employee and manager, earning more than the manager, unique…

Read article →
Artificial Intelligence

LLM Context Window Explained: Tokens, Limits and How to Fit More, Measured

The LLM context window explained with token counts we measured using tiktoken: words vs tokens for prose, code and Hindi,…

Read article →
DevOps

Git Cherry-Pick Explained: Copy the Commit You Need, Safely, Tested

Git cherry-pick explained with commands we ran in Git 2.56: copying a hotfix to a release branch, new hashes and…

Read article →
Test Automation

Snapshot Testing Explained: How It Works, When It Helps and When It Hurts

Snapshot testing explained with a pytest and syrupy demo we ran: creating snapshots, reading the diff after a code change,…

Read article →
Software Testing

Mutation Testing Explained: Why 100% Coverage Still Missed Our Bug

Mutation testing explained with a small mutation tool we built and ran: 14 mutants, a test suite with 100% line…

Read article →
Artificial Intelligence

Prompt Injection Explained: How AI Apps Get Tricked and How to Defend Them

Prompt injection explained for builders: direct and indirect attacks, why keyword filters fail (our test blocked 1 of 4), and…

Read article →
DevOps

DNS Records Explained: A, AAAA, CNAME, MX, TXT and TTL With Real Lookups

DNS records explained with lookups we ran: how resolution works, A and AAAA, CNAME rules, MX and null MX, TXT…

Read article →
DevOps

Feature Flags Explained: Safe Releases, Gradual Rollouts and Flag Hygiene

Feature flags explained with a rollout simulation we ran: flag types, percentage rollouts with stable hashing, kill switches, allow lists,…

Read article →
Test Automation

Test Data Generation With Python Faker: Realistic, Repeatable and Safe Data

Test data generation with Python Faker, run and measured: seeding for repeatable data, locales, unique values, domain-shaped records, edge cases…

Read article →
Software Testing

Shift-Left Testing Explained: Find Bugs Earlier Without Slowing the Team

Shift-left testing explained: what it means, why early defects are cheaper, practices from requirement reviews to CI checks, the tester's…

Read article →
Artificial Intelligence

LLM Structured Output Explained: Getting Reliable JSON From AI Models

LLM structured output explained with validation we ran in Pydantic: JSON mode and schemas, constrained decoding, the ways model output…

Read article →
Test Automation

API Contract Testing Explained: Catch Breaking Changes Before They Ship

API contract testing explained with a schema check we ran: what a contract is, consumer-driven contracts, Pact, OpenAPI, which changes…

Read article →
Software Testing

Risk-Based Testing Explained: Score Risks, Build a Matrix and Test What Matters

Risk-based testing explained step by step: identifying risks, scoring likelihood and impact, building a risk matrix, mapping risk to test…

Read article →