THE CODE CHANGE REVIEW Understanding AI HQ free worksheet, version 1.0 (2026-11-12) Fill it in online, print it or get the PDF: Understanding AI HQ website, Learn > Worksheets HOW TO USE IT 1. Fill in sections 1 and 2 before you ask for a change. 2. Fill in section 3 after, before you keep it. 3. Keep a working copy each time the tests pass. ================================================================ 1. BEFORE YOU ASK ================================================================ THE ONE CHANGE I WANT > THE EXACT ERROR (LAST LINE, PLUS FILE AND LINE) > > THE TEST THAT WILL PROVE IT WORKS > ================================================================ 2. NOTHING PRIVATE IN THE PROMPT ================================================================ I'VE CHECKED MY PROMPT CONTAINS NO [ ] API keys, passwords or tokens [ ] .env file contents [ ] Real customer or personal data (use a fake sample) [ ] Confidential code I'm not allowed to share ================================================================ 3. BEFORE YOU KEEP IT ================================================================ WHAT CHANGED, IN ONE SENTENCE > > REVIEW [ ] The test that failed now passes [ ] All the other tests still pass [ ] The change touches only what I asked for [ ] I can explain every line that changed [ ] I've saved a working copy A CASE THE TESTS STILL DON'T COVER > ---------------------------------------------------------------- Passing tests mean the code does what you tested, not that it has no bugs. Never paste a secret into a prompt; if you do, cancel it and make a new one. ################################################################ # EXAMPLE ANSWERS ################################################################ THE CODE CHANGE REVIEW Understanding AI HQ free worksheet, version 1.0 (2026-11-12) Fill it in online, print it or get the PDF: Understanding AI HQ website, Learn > Worksheets HOW TO USE IT 1. Fill in sections 1 and 2 before you ask for a change. 2. Fill in section 3 after, before you keep it. 3. Keep a working copy each time the tests pass. EXAMPLE ANSWERS. The example is the real bug and fix from the lesson, run on 12 November 2026 with one Claude model. ================================================================ 1. BEFORE YOU ASK ================================================================ THE ONE CHANGE I WANT > average_rating returns None for an empty list instead of crashing. THE EXACT ERROR (LAST LINE, PLUS FILE AND LINE) > ZeroDivisionError: division by zero, ratings.py line 3. THE TEST THAT WILL PROVE IT WORKS > test_no_ratings_yet: assertIsNone(average_rating([])) ================================================================ 2. NOTHING PRIVATE IN THE PROMPT ================================================================ I'VE CHECKED MY PROMPT CONTAINS NO [x] API keys, passwords or tokens [x] .env file contents [x] Real customer or personal data (use a fake sample) [x] Confidential code I'm not allowed to share ================================================================ 3. BEFORE YOU KEEP IT ================================================================ WHAT CHANGED, IN ONE SENTENCE > Added a check that returns None when the list is empty, before the division. REVIEW [x] The test that failed now passes [x] All the other tests still pass [x] The change touches only what I asked for [x] I can explain every line that changed [x] I've saved a working copy A CASE THE TESTS STILL DON'T COVER > Ratings outside 1 to 5. ---------------------------------------------------------------- Passing tests mean the code does what you tested, not that it has no bugs. Never paste a secret into a prompt; if you do, cancel it and make a new one.