You’re on the small tech team at The Second Draft, an independent bookshop, and bugs arrive the way they do at work. First, Grace, the owner, sends a note: a shelf count on the staff desk has gone below zero. Then a customer, Nadia, gets a refund that’s 150 pence short. Both bugs sit in code you didn’t write.
In this course, you’ll fix bugs, with evidence, in code a teammate or an AI agent wrote. For a first taste, here’s the check you’ll save for Nadia’s refund. It’s a small script that prints what you expected and what you got, and you run it with node ~/checks/refund.mjs. Before your fix, it prints this:
Expected: 600p
Actual: 450p
The shop refunds 450 pence where it should refund 600. After a one-line fix, the same check prints Actual: 600p, and the two lines agree. Before you put your name on the fix, you’ll also check that refunds on other orders still add up, since one passing check covers only Nadia’s order.
What You’ll Learn
By the end of this course, you’ll take a bug report to a bug that’s reproduced, explained and fixed, in a codebase you didn’t write. A saved check script will fail before your fix and pass after it. The course follows that route in order:
- Reproducing and Locating a Bug: Reproduce Grace’s bug and locate the fault.
- Asking the History When and Why: Ask the repo’s Git history why a line changed, and use your saved check with
git bisectto find the commit that broke it. - Fixing the Cause Safely: Fix the cause, and nothing more.
- Project: Nadia’s Short Refund: Fix Nadia’s refund, check that other refunds still add up, then explain your fix to Margaret, who built the refunds code.
What You Should Know Already
You need JavaScript basics, and you should already be able to read an error message and log a value. If either feels shaky, When Things Go Wrong: Errors and Debugging covers it.
From Finding Your Way Around a Codebase You Didn’t Write, you need to trace a feature and follow its data. The bugs land in the parts of The Second Draft you mapped there, so your map comes with you. The code is the copy of the shop’s GitHub repository you cloned in that course. If you’re starting here instead, the first lesson shows you how to get it. Node 26 and Git are the tools you need.
How the Course Works
Most lessons are text, and two more are videos like this one. Coding exercises run in your browser, and the course’s own tests check them. Your saved checks are different. They’re scripts you write yourself, and they print expected and actual. Code Mentor, RealJS’s AI mentor, answers your questions, and you check its answers. A quiz comes at the end.
There’s no download of the shop’s code. You work in your clone, and later lessons read its Git history. At the bottom of this page are the slides (PDF) and the sample code (ZIP). The lessons show each finished check, to compare with yours once you’ve written them.
Your first step is Grace’s note. Next, in Reproduce a Bug Report, you’ll make her shelf count go wrong every time.