Worked example · Computer Science · Year 11

Redrafting a test commentary for a bug fix

LNF: Literacy → Writing → Proofreading, editing and improving

What this is

A complete, secure Year 11 answer, annotated so you can see which success criterion each part meets. It is also the answer key. The bug: line 4 uses age > 65, so a 65-year-old pays £8.50; it should be age >= 65. This is a logic error, not a syntax error, because the program runs. The most common weaknesses in redrafts are keeping “it works now” without evidence, and keeping the untrue claim that the program “has no bugs”.

Step 1: understand the bug

Age1112646566
Price given£5.50£8.50£8.50£8.50£6.00
Correct?YesYesYesNo, should be £6.00Yes

(b) Line 4, elif age > 65:, should be elif age >= 65:, because the brief says “65 and over”.

Step 2: proofread

Ifan wroteCodeCorrection
didnt (sentence 1)Pdidn’t (apostrophe for the missing o)
it didnt work (1)VTest 4 failed: the program gave the wrong price for age 65.
their was (2)Spthere was
sintax error (2)Sp and TSpelled syntax, but the right term is logic error: the program ran.
should of been (3)Gshould have been
the thing on line 4 (4)Vthe comparison operator > in the condition on line 4
tested it again and it works now (5)E and GWhich tests, with what results? Tense changes from past to present.
crashs (6)Spcrashes
it crashs, I dont no why (6)P and SpComma splice: use a full stop. don’t know. Also name it: a runtime error (ValueError).
progam (7)Spprogram
has no bugs (7)HNot true: test 6 still fails.

The pupil works sentence by sentence and finds more than 10 problems, and separates surface errors (spelling, punctuation) from deeper ones (wrong term, no evidence, untrue claim). Evidences criteria 1, 2 and 4.

Step 3: precise terms

Ifan wrotePrecise version
it didnt workTest 4 (boundary data, age 65) failed.
a sintax error on line 4a logic error in the condition on line 4
I changed the thing on line 4I changed the comparison operator on line 4 from > to >=
it works nowtests 1 to 5 now pass
when you type a word it crashsentering a word causes a runtime error (ValueError), because int() cannot convert text such as “ten” to a number

Evidences criterion 2.

Step 4: fix the structure

PartSentencesWhat is missing
What went wrong and why1, 2, 3The expected and actual result in one place; the correct type of error; why > excludes 65.
What I changed4The exact change: > to >=.
How I retested, and what still needs work5, 6, 7Which tests were rerun and their results; an honest note that test 6 still fails.

Evidences criterion 3.

Step 5: redraft (model, 144 words)

What went wrong. Test 4 used boundary data: an age of 65. The brief says customers aged 65 and over pay £6.00, but the program output £8.50. This was a logic error, not a syntax error, because the program ran without stopping. The condition on line 4, age > 65, is only True for ages above 65, so a customer aged exactly 65 fell through to the else branch.

What I changed. I changed the comparison operator on line 4 from > to >=, so the condition became age >= 65.

How I retested. I reran all six tests. Test 4 now outputs £6.00 as expected, and tests 1, 2, 3 and 5 still pass. However, test 6 still fails: entering “ten” causes a runtime error (ValueError) because int() cannot convert text. The program therefore needs input validation before it is finished.

The three parts answer what went wrong, what changed and how it was retested. Every claim has evidence, the technical terms are correct, and the final paragraph is honest about test 6. The past tense is used for actions and the present tense for what the code does now. Evidences criteria 1 to 4.

Step 6: feedback and response (model)

Partner’s comment: “Your first paragraph says the result was wrong but not what price it gave. Add the actual output.”

Response: “I added ‘but the program output £8.50’, so the reader can compare the expected and the actual result without looking at the table.”

The response names the exact change and why it helps the reader. Evidences criterion 5.

If you finish early: answers

text = input("Enter your age: ") while not text.isdigit(): text = input("Please enter your age in digits: ") age = int(text)

Why this response is secure