Practice worksheet — teaching exercise, no fabricated results Review AI-written code before you trust it Review a tiny AI-written function, find a logic bug and write a testable repair report. 1. Code can look valid and still be wrong Complete the lesson practice. Record the actual result or why it remains unverified: Lesson-specific self-check: Why is visually tidy code not necessarily correct? Reference answer (try before reading): It can fail on unexpected input; verify behavior against an expected output and tests. My response / what I tried: ____________________________________________________________ How did I verify it / what remains unchecked? ____________________________________________________________ 2. Define the intended behavior first Complete the lesson practice. Record the actual result or why it remains unverified: Lesson-specific self-check: What should be specified before asking for a review? Reference answer (try before reading): The function’s intended behavior, input and expected result, not just “review this code.” My response / what I tried: ____________________________________________________________ How did I verify it / what remains unchecked? ____________________________________________________________ 3. Test more than the happy case Complete the lesson practice. Record the actual result or why it remains unverified: Lesson-specific self-check: Why test an edge case as well as an ordinary input? Reference answer (try before reading): It reveals failures hidden by the happy path, such as an empty list or unsupported input type. My response / what I tried: ____________________________________________________________ How did I verify it / what remains unchecked? ____________________________________________________________ 4. Review the proposed change, not just the output Complete the lesson practice. Record the actual result or why it remains unverified: Lesson-specific self-check: How should a proposal to change many files for a one-line bug be handled? Reference answer (try before reading): Inspect its scope and justification, then prefer a minimal change that passes relevant tests. My response / what I tried: ____________________________________________________________ How did I verify it / what remains unchecked? ____________________________________________________________ 5. Submit a short review report Complete the lesson practice. Record the actual result or why it remains unverified: Lesson-specific self-check: What makes a code review report actionable? Reference answer (try before reading): A reproduction, affected location, rationale, suggested fix and explicit acceptance tests. My response / what I tried: ____________________________________________________________ How did I verify it / what remains unchecked? ____________________________________________________________ Final project: input A function adding two prices but one arrives as a string Reference deliverable Input: total("4",2). JavaScript can concatenate to "42" instead of the intended numeric 6. Proposed fix: validate numeric types explicitly; test 4+2, 0+2 and string input. Acceptance criteria Accept only when valid numbers yield 6 and invalid types are handled explicitly. Note: do not invent a test result or enter sensitive data in examples.