All RAFT resources

Faculty · The RAFT Framework for Ethical AI Use

Debugging with an explanation

Diagnose a boundary error, design useful tests, and explain a correction.

All redesign examples

Before

Fix this function using any resources and submit the corrected code.

What the original hides

A correct patch can conceal weak understanding of the failure and missing tests.

After

Repair a function that counts passing scores. A passing score is 70 or more. Inputs are lists of numbers from 0 through 100. Submit your initial diagnosis, corrected code, tests, and a short explanation.

Student process

  1. Research Independently First: predict the result for [69, 70, 71], run the starter if possible, and explain the mismatch with the specification.
  2. Augment Your Work: AI may ask debugging questions or comment on your proposed tests. It may not supply the replacement function or the explanation.
  3. Fact-Check Everything: run your own tests and compare results with hand predictions. Review each retained suggestion against the specification.
  4. Transform Into Your Own Work: write the correction and explain why it changes the boundary behavior. Explain one additional test without referring to AI output.

Evidence to submit

Submit before-and-after code, expected and actual test results, and a 100-word reasoning note. A trace table on paper is an equivalent option when execution is unavailable.

CriterionPointsEvidence
Diagnosis30Identifies the boundary condition and its consequence.
Tests and correction40Correct behavior for all specified cases and a justified extra test.
Explanation30Explains the operator and what tests can and cannot establish.
Instructor reasoning and expected checks

Change > to >=. Expected counts: [] → 0; [69,70,71] → 2; [70,70] → 2; [0,100] → 1. Passing these tests supports this specification; it is not proof against every possible input.

Get the editable assignment pack

Free Word and PDF files · Email confirmation required. Request the resource, open the email within 24 hours, then confirm to download. Ongoing emails are optional.

By Dr. Chase Cookson · v2.1 (009019026)
Course, assignment, and institutional rules take priority.