This repository is a synthetic case study, not a client project. The bugs, requirements, code, and tests were created specifically for this public demonstration. No customer code or private data is included.
Proof first: See the before/after fix · Run the tests · View all demos · Request a scoped Python/JavaScript bug fix on Fiverr →
It demonstrates a compact debugging process for two common failures:
- Python: an order discount is skipped exactly at the qualifying threshold.
- JavaScript: a one-based page number is accidentally treated as zero-based.
Each case includes the buggy implementation, a minimal reproduction, a fixed implementation, regression tests, and a written root-cause analysis.
python_case/
buggy.py original threshold bug
fixed.py validated Decimal-based fix
javascript_case/
buggy.js original pagination bug
fixed.js corrected and validated pagination
tests/python/ Python reproduction and regression tests
tests/javascript/ JavaScript reproduction and regression tests
ROOT_CAUSE_REPORT.md diagnosis, scope, before/after, and verification
- Python 3.10 or newer
- Node.js 18 or newer for the JavaScript tests
- No third-party packages
sh run_tests.shOr run the suites separately:
python3 -m unittest discover -s tests/python -v
node --test tests/javascript/*.test.jsExpected result:
Python: 5 tests passed
JavaScript: 4 tests passed, 0 failed
The reproduction assertions intentionally confirm the original bad behavior, while the regression assertions verify the corrected behavior. Therefore, a complete test run should pass.
| Case | Input | Buggy result | Fixed result |
|---|---|---|---|
| Python discount boundary | subtotal is exactly 100.00 |
100.00 |
90.00 |
| JavaScript pagination | page 1, size 3, items 1..7 |
[4, 5, 6] |
[1, 2, 3] |
Minimal fixes:
- if subtotal > threshold:
+ if subtotal >= threshold:
- const start = page * pageSize;
+ const start = (page - 1) * pageSize;See ROOT_CAUSE_REPORT.md for the full diagnosis, blast-radius analysis, fix rationale, and verification record.
- Reduce the report to the smallest deterministic failing input.
- Write a reproduction assertion before changing the implementation.
- Identify the violated contract and the exact faulty expression.
- Make a narrow fix and add input validation at the same boundary.
- Add regression coverage for the reported case and nearby edge cases.
- Document what changed, what did not change, and any remaining assumptions.
I handle scoped debugging for Python and JavaScript code. See the related Fiverr service:
Debug and fix Python or JavaScript code
Before ordering, please share the error message, minimal reproduction steps, relevant code, runtime/version, expected behavior, current behavior, and acceptance criteria. Do not send production credentials or secrets.
MIT — see LICENSE.
