/en-tutor-prep-igcse-cs-test-data-trace-table-error-correction/
/en-tutor-prep-igcse-cs-test-data-trace-table-error-correction/
General Inquiry: info@TutorZone.com.hk
Office Hours: Monday to Saturday - 9:00 AM to 6:00 PM
WhatsApp Monday to Sunday - 24 hours
Hotline: +852 6828 1809
Instant Support: +852 9061 3106

IGCSE Computer Science: Test Data, Trace Tables and Error Correction — Tutor Prep Guide

IGCSE Computer Science: Test Data, Trace Tables and Error Correction — Tutor Prep Guide

  • 2026-11-27

Students think testing means pressing a few keys until the screen looks right. This chapter pins the four kinds of test data to one field that accepts 11 to 18, then makes students fill a trace table one row at a time, then hands them an algorithm with three errors so that finding a fault becomes a markable act: which line, why, and what to change.

Objectives — Students can: (1) write the four kinds of test data for one field and explain how extreme differs from boundary; (2) work out that 6 fields at 12 values each is 72 values, 15 seconds each, which is 18 minutes; (3) fill a 4 pass trace table for a totalling and averaging algorithm, giving a total of 185, a count of 3 and an average of 61.7; (4) find 3 errors in an algorithm and give the line and the correction for each.

01 Prerequisites (3-minute check)

If any of these fails, fix it before the lesson starts.

Skill Quick check Pass mark
Input and output What does INPUT take in and what does OUTPUT send out? INPUT puts a value into a variable, OUTPUT sends a value to the screen
Range check A field says 11 to 18. Does 15 pass, does 10? 15 passes, 10 is rejected
Average What is the average of 40, 65 and 80? 185 divided by 3, which is 61.7

02 Lesson flow (60 minutes)

Time Stage Tutor does Student does
0-10 min Four kinds Write four values for an 11 to 18 field Say that boundary is a pair
10-20 min Extreme and boundary Split 11 and 18 from 10 and 19 Two extreme, four boundary
20-28 min Count the values 6 fields times 12 72 values, 18 minutes
28-42 min Fill the trace table Run the totalling algorithm by hand Total 185, average 61.7
42-52 min Find three errors Read an algorithm and circle the faults 3 errors with one correction each
52-60 min Write the corrections Turn each correction into a pseudocode line Which line, changed to what

03 Teaching script (read it out)

Scene 1: Four kinds of test data – extreme is not boundary

Test data is limited to four kinds, and the exam asks for one of each for a named field, so the borders matter.
Normal data is a typical value that must be accepted, such as 15 for an age field. It shows the happy path works and nothing more.
Abnormal data is a value that must be rejected, such as -5, 120 or a string of letters. This is the kind that tests whether validation exists at all.
Extreme data is the largest or smallest acceptable value, so 11 and 18. The syllabus wording is largest or smallest acceptable, so extreme data is still data that should pass.
Boundary data is a pair: the largest acceptable value with the smallest rejected value, which is 18 and 19; the other direction is 11 with 10. That makes four boundary values for one field: 10, 11, 18 and 19. The usual mistake is to treat extreme as boundary and write only 11 and 18, which never tests the rejected side, so an off-by-one fault survives.
Count the work: 3 normal, 3 abnormal, 2 extreme and 4 boundary values is 12 per field. A form with 6 fields needs 72 values, and at 15 seconds each that is 1,080 seconds or 18 minutes. That number answers why we do not just poke at the program: 18 minutes of random typing rarely lands on 10.

Field Accepted range normal abnormal extreme boundary
Age integer from 11 to 18 15 -5, a negative 11 and 18 10 and 19
Mark integer from 0 to 100 65 120, far above the limit 0 and 100 -1 and 101
Password length 8 to 12 characters 10 3, far too short 8 and 12 7 and 13

Students write the four boundary values for an 11 to 18 field and say which two must be accepted.

Scene 2: The trace table – every row, prompts included

A trace table runs the algorithm by hand, recording variables, outputs and user prompts at each step. The syllabus names all three, and the prompt column is the one students drop.
The demonstration algorithm reads a mark, adds it when it is at least zero, stops on -1, then prints the average:
Total left arrow 0, Count left arrow 0, REPEAT printing a prompt, INPUT Mark, IF Mark is at least 0 then add to Total and add one to Count, UNTIL Mark equals -1, then IF Count is above 0 print Total divided by Count.
Row by row: input 40 takes Total from 0 to 40 and Count to 1; input 65 gives 105 and 2; input 80 gives 185 and 3; input -1 fails the condition, so neither changes, and the loop ends because Mark is -1. The output is 185 and 3, and 185 divided by 3 is 61.6667, which rounds to 61.7 at one decimal place.
Three disciplines: one row per statement, never two inputs on one row; a skipped statement still gets a row marked unchanged, because that is exactly what a reader needs when the answer is wrong; and prompt strings are copied in full, not replaced by the word prompt.
The table earns its place by catching faults: if Count is still 0 at the end, the average divides by zero, and a hand trace shows it before the program crashes.

Step Statement Mark (input or prompt) Total Count
1 OUTPUT “Enter a mark” prompt – –
2 INPUT Mark 40 40 1
3 INPUT Mark 65 105 2
4 INPUT Mark 80 185 3
5 INPUT Mark -1 185 3

Students change the input order to 50, -2, 70 and -1, refill Total and Count, and say why -2 leaves the total alone.

Scene 3: Finding errors – which line, why, and what to change

An error question gives an algorithm and asks for the faults and the corrections. Marks come in two parts: which line, and what it should say. Writing that something is wrong earns nothing.
Four faults cover most papers. First, an uninitialised accumulator, where Total is declared and then added to, so the result depends on whatever was in memory. Second, a reversed condition, such as an algorithm meant to add positives that adds negatives. Third, a loop that never ends because the WHILE body never updates the control variable. Fourth, division by zero when Count is 0. Two more are easy to miss: an array index past its declared bound, and confusing integer and real division, since DIV gives the quotient, MOD gives the remainder, and a plain slash gives a real number.
Use a version with 3 errors in class: with 30 students, the first round finds 1.9 on average, which is 63.3 per cent; after insisting on three columns, line, reason and correction, a second round finds 2.8, which is 93.3 per cent. The difference is not eyesight, it is being forced to write the reason.
A correction must be a pseudocode line that can be pasted back: add Total and Count set to zero before the REPEAT, change the condition so that Mark is at least 0, add one to Count inside the loop, and guard the division with a count above zero.

Fault What it looks like Correction
Uninitialised accumulator Total is declared, then Total + Mark is used straight away Set Total and Count to zero before the loop
Reversed condition Only marks above zero are added, so other negatives slip in Add only when Mark is at least 0
Loop that never ends The WHILE loop never adds one to Count Add Count + 1 inside the loop
Division by zero Total / Count is used even when Count is 0 Guard with IF Count > 0, else output that nothing was entered

Students write each of the four faults as line, reason and correction, then swap sheets to check that a correction was actually written.

04 Question types and worked steps

Type Example Steps Answer
Sort into four Write one boundary value for a password length of 8 to 12 Boundary is a pair, one accepted and one rejected 7 and 13, or 8 and 12 each with a rejected partner
Count values 6 fields, 12 values each, 15 seconds each Multiply, then divide by 60 72 values, 18 minutes
Fill a trace Inputs 40, 65, 80, -1: give Total and Count One row per statement, skipped ones included Total 185, Count 3
Find the fault Total plus Mark is used with no earlier assignment Name the missing initialisation and write the line Add Total set to zero before the loop
Sanity check (teach this): Rationality checks: (1) the four kinds are normal, abnormal, extreme and boundary, in that order; (2) extreme values are accepted, boundary values are a pair of accepted and rejected, so one cannot replace the other; (3) boundary must include the rejected side, so 11 and 18 alone are not complete; (4) one statement per row, and unchanged variables still get a row; (5) prompt strings are copied, not summarised; (6) 185 divided by 3 is 61.6667, which is 61.7 at one place and 62 at zero places; (7) an error answer needs line, reason and correction, and any one of the three missing loses the mark.

05 Independent practice (3 questions)

Question Answer What to watch
A field accepts 11 to 18. Write every boundary value. 10, 11, 18 and 19 Check whether the rejected side is present
Inputs 50, -2, 70, -1 with only non-negative marks added. Give Total and Count. Total 120, Count 2 Check whether -2 was added
6 fields at 12 values each, 15 seconds a value. How many minutes? 72 values, 1,080 seconds, 18 minutes Check whether seconds were read as minutes

06 Common mistakes and what to say

Mistake Student writes Say this
Extreme taken as boundary The boundary is 11 and 18 Those are the acceptable extremes; add 10 and 19 so the rejected side is tested too.
Trace table with variables only After 65 the total is 105 Fill the prompt column as well, and give skipped statements a row marked unchanged.
Naming the fault without a fix Something is wrong here, it needs changing Give three things: the line, the reason and the replacement line, because marks follow those three.
No guard on division The average always works Count can be 0, so guard with a count above zero first.

07 Homework (paper, section and question numbers)

08 Exit check (last 5 minutes)

Question Answer Decision
Four kinds normal, abnormal, extreme, boundary Cannot say it, return to act one
Boundary as a pair largest acceptable with smallest rejected Cannot say it, return to the middle of act one
Three parts of a fix which line, why, changed to what Cannot say it, return to act three

09 Tutor FAQ

How do I stop confusing extreme and boundary?

Remember that extreme all passes and boundary is half pass, half fail. 11 and 18 must both be accepted, so they are extreme. 18 with 19, and 11 with 10, are pairs where one is accepted and one rejected, so they are boundary. Asked for boundary, write a pair; a single value loses the mark.

How much detail does a trace table need?

Enough that a reader can tell what the program did from the table alone. One row per statement: an input row, a test row, an assignment row, and a row each for output and prompt. Unchanged variables still get a row, because that is the information a wrong answer needs.

Is there a checklist of faults to look for?

Four appear almost every year: uninitialised variable, reversed condition, loop control variable never updated, and division by zero. Two more are worth checking: an array index beyond its bound, and mixing DIV with MOD. For each, rehearse one sentence that says what to change.

Find a tutor — freeTutor Registration →

A TutorZone lesson-prep guide. Written by the TutorZone team; questions and lesson flow are original and are not taken from any school or publisher material.

Join as a tutor or coach — academic, music, sports, arts, STEM. Free to register. See how it works →