Skip to content

Commit ef3e159

Browse files
committed
chore: add CI and improve debugging case study
1 parent 0d0c9cf commit ef3e159

2 files changed

Lines changed: 50 additions & 1 deletion

File tree

.github/workflows/ci.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
8+
permissions:
9+
contents: read
10+
11+
jobs:
12+
python:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v4
16+
- uses: actions/setup-python@v5
17+
with:
18+
python-version: "3.12"
19+
- run: python -m unittest discover -s tests/python -v
20+
21+
javascript:
22+
runs-on: ubuntu-latest
23+
steps:
24+
- uses: actions/checkout@v4
25+
- uses: actions/setup-node@v4
26+
with:
27+
node-version: "20"
28+
- run: node --test tests/javascript/*.test.js

README.md

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
1-
# Python + JavaScript Bugfix Case Study
1+
# Python & JavaScript Debugging Case Study — Reproduce, Fix, Test
2+
3+
[![CI](https://github.com/Ryan-Chen9/python-js-bugfix-case-study/actions/workflows/ci.yml/badge.svg)](https://github.com/Ryan-Chen9/python-js-bugfix-case-study/actions/workflows/ci.yml)
24

35
![Python and JavaScript bugfix case study](assets/hero.png)
46

57
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.
68

9+
**Portfolio:** [All runnable demos](https://github.com/Ryan-Chen9) · [Before and after](#before-and-after) · [See the matching Fiverr service →](https://www.fiverr.com/ryan_chen09/fix-bugs-in-your-python-or-javascript-code-fast)
10+
711
It demonstrates a compact debugging process for two common failures:
812

913
- **Python:** an order discount is skipped exactly at the qualifying threshold.
@@ -44,6 +48,13 @@ python3 -m unittest discover -s tests/python -v
4448
node --test tests/javascript/*.test.js
4549
```
4650

51+
Expected result:
52+
53+
```text
54+
Python: 5 tests passed
55+
JavaScript: 4 tests passed, 0 failed
56+
```
57+
4758
The reproduction assertions intentionally confirm the original bad behavior, while the regression assertions verify the corrected behavior. Therefore, a complete test run should pass.
4859

4960
## Before and after
@@ -53,6 +64,16 @@ The reproduction assertions intentionally confirm the original bad behavior, whi
5364
| Python discount boundary | subtotal is exactly `100.00` | `100.00` | `90.00` |
5465
| JavaScript pagination | page `1`, size `3`, items `1..7` | `[4, 5, 6]` | `[1, 2, 3]` |
5566

67+
Minimal fixes:
68+
69+
```diff
70+
- if subtotal > threshold:
71+
+ if subtotal >= threshold:
72+
73+
- const start = page * pageSize;
74+
+ const start = (page - 1) * pageSize;
75+
```
76+
5677
See [ROOT_CAUSE_REPORT.md](ROOT_CAUSE_REPORT.md) for the full diagnosis, blast-radius analysis, fix rationale, and verification record.
5778

5879
## Debugging approach shown here

0 commit comments

Comments
 (0)