← ACARA Digital Technologies Years 7–8

Writing a bug report from a trace

A short note giving the input used, the expected and actual output, the trace row where it goes wrong, the cause and the correction. Use 'because' to explain the cause to a classmate.

Understanding Writing a bug report from a trace in ACARA Digital Technologies Years 7–8

What it does: Naming the row and the value as it appears in the trace table is the evidence that shows where the bug starts. Starting a sentence with because links the wrong value in the trace to the exact mistake in the algorithm. A good bug report gives the input, the expected and actual output, the trace row, the cause and the correction. 'It is broken' gives none of these. Evidence names a specific row and the values in it. A feeling or opinion is not evidence. A correction must say exactly what to change and what to change it to. The input shows how to repeat the problem. Without it, no one can run the same trace.

Common mistakes: A bug report must give the actual output, and it must differ from the expected output. Here the actual output should be 10, because the total was never divided by the count. The input line must match the rest of the report. An expected output of 3 only makes sense if the input was 3 correct answers, not 0.

Class: _____________________  ·  Name: _____________________  ·  Date: _________

Free printable worksheet with full answer key — or add this module to a class and your students practise it interactively.

This module's key terms are also in a printable crossword (Modules 482–519) and word search (Modules 420–519).

Take this worksheet further — free with Cloodit

Each concept is reinforced from every angle — learned, then applied, then tested.

Learning
Duo
Which bug report is complete?
The algorithm is broken and gives the wrong answer. Please fix it.Input 5. Expected 15, actual 20. Row 3 of the trace is wrong because total was not set to 0 first. Fix: add total <- 0.
Matches
Bug: my algorithm does not work.
↓
Too vague. It gives no input, no expected or actual output and no trace row. Fix it by naming all of these.
Applying
Meanings
Term
bug report
Meaning
A short note giving the input used, the expected and actual output, the trace row where it goes wrong, the cause and the correction. Use 'because' to explain the cause to a classmate.
Practice
BUG REPORT
Testing
Gaps
output: 10
Check Answer
Spots
2Expected output: 5
3Actual output: 5

Cloodit turns curriculum-aligned coding content into journeys students work through one biome at a time.

The 'Woolly Mammoth' badge — Tundra Master, one of Cloodit's 106 collectible badges
Students earn collectable badges

Over 100 of them, across seven natural biomes.

Study Buddy
Students build a real study resource

Turns their work into revision material ready for Flash Cards and Exam study.

Diamond Dash — one of Cloodit's live, competitive Sprint games
Students lock in with Sprints

Live, competitive practice for the start of the lesson or a teacher-led lesson finisher.

A Cloodit certificate of achievement, ready to personalise and print
Custom printable certificates

Honour your top performers, or encourage a student who's trying hard — ready to print in seconds.

Quick Questions

1. Which bug report is complete?
A. The algorithm is broken and gives the wrong answer. Please fix it.
B. Input 5. Expected 15, actual 20. Row 3 of the trace is wrong because total was not set to 0 first. Fix: add total <- 0. ✓
A good bug report gives the input, the expected and actual output, the trace row, the cause and the correction. 'It is broken' gives none of these.
2. Which sentence uses 'because' to explain the cause of a bug?
A. Row 4 shows count is 5 because the line count <- count + 1 is inside the wrong loop. ✓
B. Row 4 shows count is 5. The loop is bad. Count is wrong.
'Because' links the evidence in the trace table to the cause, so your classmate can see why the bug happens.
3. Which one is evidence from the trace table?
A. I think the algorithm looks a bit strange.
B. In row 2, x is 7 but it should be 6. ✓
Evidence names a specific row and the values in it. A feeling or opinion is not evidence.
4. Which part of a bug report states the expected and actual output?
A. Expected: 12. Actual: 10. ✓
B. Fix: change > to >=.
The expected and actual output show the difference between what should happen and what did happen. The fix belongs in the correction part.
5. Which is the best correction line for a bug report?
A. Change the condition from score > 50 to score >= 50. ✓
B. Change something in the IF line so it works.
A correction must say exactly what to change and what to change it to.

Match the Pairs

Input: 4 and 6 → States the input used when the test was run
Expected: 10, Actual: 14 → Compares the expected output with the actual output
Point to the trace row where the value first goes wrong, as evidence from the trace table → Row 1: total shows 4 but should be 0 + 4
Explain the cause to a classmate using a because sentence → It is wrong because total was not set to 0 first.
Bug: my algorithm does not work. → Too vague. It gives no input, no expected or actual output and no trace row. Fix it by naming all of these.
Row 3 is wrong. Fix: change the code. → The correction does not say which step to change or what to change it to. Fix it by naming the step and the new version.

Key Term

bug report
A short note giving the input used, the expected and actual output, the trace row where it goes wrong, the cause and the correction. Use 'because' to explain the cause to a classmate.

Fill in the Blanks

1. Input used: 4 Expected output: 10 Actual output: 14
Hint: Type the label for the output the algorithm should have given.
2. Input used: 4 Expected output: 10 Actual output: 14
Hint: Type the label for the output the algorithm really gave.
3. Input used: 4, expected output: 10 Evidence: the trace table, row 3, total = 14
Hint: Type the name of the table that shows the evidence of where it goes wrong.
4. Row 3: total = 14, expected 10 Cause: total is wrong because it starts at 4
Hint: Type the word that starts the explanation of the cause.
5. Cause: total starts at 4, not zero Fix: add total ← 0 before the loop
Hint: Type the starting value the variable should be given in the correction.

Spot the Error

Question 1
A Input: 4 and 6
B Expected output: 5
C Actual output: 5
D Row 3: total never divided
E Fix: OUTPUT total / count
Line C — A bug report must give the actual output, and it must differ from the expected output. Here the actual output should be 10, because the total was never divided by the count.
Question 2
A Input: 0 correct answers
B Expected output: 3
C Actual output: 1
D Row 3: score reset to 0
E Cause: SET score inside loop
Line A — The input line must match the rest of the report. An expected output of 3 only makes sense if the input was 3 correct answers, not 0.
Question 3
A Input: 5
B Expected: 5 stars
C Actual: 6 stars
D Cause: loop repeated 4 times
E Fix: use i < 5 not i <= 5
Line D — The cause must explain the actual output. 6 stars means the loop ran 6 times, so the line should say 6 times, not 4.
Question 4
A Input: mark is 50
B Expected output: Fail
C Actual output: Fail
D Row 2: 50 > 50 is false
E Fix: use >= instead of >
Line B — Expected output is what should happen, so it must differ from the actual output. A mark of 50 should give Pass, so the line should be 'Expected output: Pass'.
Question 5
A Input: 2, 3, 5
B Expected output: 9
C Actual output: 109
D Row 1: total starts at 100
E Fix: SET total TO 0 first
Line A — The input must match the expected output. 2 + 3 + 5 is 10, not 9, so the input should be 2, 3, 4.

Student with a class code? Join your class →