QualityMax checks whether a code change fixes the problem it was meant to solve. Follow this small online-shop example: a customer is charged delivery when it should be free, then compare a rejected patch with a successful repair.
No code knowledge, signup, or installation needed to follow this example.
The example, step by step
A $50 order should cost $50. Not $55.
Imagine an online shop that promises free delivery on orders of $50 or more. An automatic check places the same $50 order before and after a proposed code change.
1 Start with the problem
The original code only gives free delivery above $50. At exactly $50, it adds a $5 delivery charge.
Expected: $50 · Actual: $55
2 Try a proposed fix
A patch is a proposed code change. This one mistakenly raises the free-delivery threshold to above $100, so the $50 order still costs $55.
The problem remains.
3 Check the same order again
A test is an automatic check of expected behavior. The same check fails before and after this change. QualityMax reports needs human review.
This proposed fix did not pass.
The downloadable sample runs this rejected patch first, then a repair that changes > 5000 to >= 5000. The repair makes the same $50 test pass. This page does not generate a new fix or run your code in the browser. You can inspect every file below, or reproduce both checks on your own machine.
Before and after
The original file, rejected patch, and successful repair
These are the complete files used in the walkthrough. Amounts in the code are in cents: 5000 means $50 and 500 means $5. The test stays the same for both changes.
1. Original file
invoice.py — calculates an order’s total.
Delivery is free only above $50. The $50 order is overcharged.
def invoice_total(subtotal_cents: int, member: bool = False) -> int:
if subtotal_cents < 0:
raise ValueError("subtotal must be non-negative")
discounted = subtotal_cents - (subtotal_cents // 10 if member else 0)
shipping = 0 if subtotal_cents > 5000 else 500
return discounted + shipping
The additional checks test other parts of the shop’s pricing rules. They are separate supporting evidence. The recorded status is needs_human.
The default walkthrough exits 0 only after observing both the rejected patch and the successful repair outcomes. It does not mean the rejected patch passed.
Repair: the unchanged check passes
The local, synthetic, unsigned walkthrough starts from another copy of the same original file. Its selected $50 test fails before the repair, then passes after the boundary changes to >= 5000. Its independent oracle reports 8 passed.
This successful repair is a separate fixture outcome. It does not make the rejected patch a verified fix.
Rejected patch (recorded diff)
The minus line is removed from the original file; the plus line replaces it. The threshold increases from $50 to $100. This does not fix the problem.
diff --git a/invoice.py b/invoice.py
--- a/invoice.py
+++ b/invoice.py
@@ -2,5 +2,5 @@
if subtotal_cents < 0:
raise ValueError("subtotal must be non-negative")
discounted = subtotal_cents - (subtotal_cents // 10 if member else 0)
- shipping = 0 if subtotal_cents > 5000 else 500
+ shipping = 0 if subtotal_cents > 10000 else 500
return discounted + shipping
Successful repair (local fixture diff)
The repair changes the boundary so a $50 order receives free delivery.
diff --git a/invoice.py b/invoice.py
--- a/invoice.py
+++ b/invoice.py
@@ -2,5 +2,5 @@
if subtotal_cents < 0:
raise ValueError("subtotal must be non-negative")
discounted = subtotal_cents - (subtotal_cents // 10 if member else 0)
- shipping = 0 if subtotal_cents > 5000 else 500
+ shipping = 0 if subtotal_cents >= 5000 else 500
return discounted + shipping
These SHA-256 fingerprints identify the exact sample files and runner used for this record. They identify a version; they do not prove that a fix works.
Your machine → artifacts/verified-patch-sample/<run-id>/broken/ and artifacts/verified-patch-sample/<run-id>/repair/
Each directory contains the receipt, selected-test results, independent oracle, applied patch, and original/proposed source snapshots for that one fixture.
sample-result.json — verdict, status, and hashes
base-selected.xml — selected-test JUnit before patch
head-selected.xml — selected-test JUnit after patch
The first run installs four pinned sample dependencies into a temporary environment. It then checks the rejected patch and successful repair separately, using independent copies of the original source and the same unchanged test. It does not install the QualityMax application.
1 Check prerequisites
Python 3.11 or 3.12, Git, a working venv, macOS or Linux, and internet access to PyPI.
The output identifies each original file, proposed file, unchanged test, and receipt. Using Python 3.12? Substitute python3.12. Only pytest 8.3.5, iniconfig 2.1.0, packaging 24.2, and pluggy 1.5.0 are installed in a temporary environment.
Limitations
What this does not prove
This is a fixed synthetic example, not an arbitrary patch runner.
Selected-test success does not prove whole-patch correctness.
This is fixture validation, not a measured benchmark.
Troubleshooting
If the run stops early
Use the actual output printed by the runner and its generated run directory to identify setup issues, then run again. A setup failure may produce no receipt. A timed-out execution can write execution_error in JSON and a needs_human verdict, then exit 2; it is not a completed reproduction.
Setup failure: Python, Git, or dependency install
The runner reports supported Python versions and bootstrap failures directly. Confirm Python 3.11 or 3.12, Git on your PATH, and PyPI access; then use the output from your own run to decide the next step.
Execution error or timeout
Read the generated JSON and the command output from this run. An execution error is distinct from a completed fixture result; do not infer a passed or failed patch from it.