/en-tutor-prep-igcse-cs-standard-methods-validation-verification/
/en-tutor-prep-igcse-cs-standard-methods-validation-verification/
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: Standard Methods, Validation and Verification — Tutor Prep Guide

IGCSE Computer Science: Standard Methods, Validation and Verification — Tutor Prep Guide

  • 2026-11-27

Students can name bubble sort but cannot count its comparisons, and they mix up validation with verification. This chapter uses 1,000 records and one mistyped barcode to turn comparison counts and the six checks into steps a student can count out loud.

Objectives — Students can: (1) give the worst and average comparisons for a linear search over 1000 records, and work out 0.5 seconds and 0.25 seconds; (2) describe one bubble sort pass and work out 4,950 comparisons at most for 100 items, and 99 when already sorted; (3) write the four counting routines and get an average of 41.35; (4) say what each of the six validation checks catches and write conditions for three of them; (5) separate the two verification checks, using 20 keying errors and 5 source errors to show what double entry misses.

01 Prerequisites (3-minute check)

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

Skill Quick check Pass mark
Compare and swap Why does swapping two variables need a third, temporary one? Otherwise the first value is overwritten
Loops Which loop suits checking items until one is found? A conditional loop, since the count is unknown
Averages What is the average of 12, 15 and 18? 15, since the total is 45 over 3

02 Lesson flow (60 minutes)

Time Stage Tutor does Student does
0-8 min Five methods Ask how many checks it takes to find one name One at a time at worst, which is a linear search
8-20 min Linear search 1000 records at 0.5 milliseconds a comparison 500 comparisons on average, 0.25 seconds
20-34 min One bubble pass Walk 5, 3, 8, 1 through the first pass 3 comparisons and 2 swaps
34-42 min Counting comparisons Work out 100 and 1,000 item maxima 4,950 and 499,500
42-52 min Six checks What each catches, and how to write it One bad example per check
52-60 min Two verification checks Use 20 keying errors and 5 source errors Double entry misses source errors

03 Teaching script (read it out)

Scene 1: Searching and sorting – count it or you do not know it

The standard methods are limited to five: linear search, bubble sort, totalling, counting, and maximum, minimum and average. Start with searching. A linear search compares from the first item onwards, stops on a match and stops at the end otherwise. Over 1,000 records the worst case is 1,000 comparisons, and if the target is equally likely at any position the average is 500. At 0.5 milliseconds a comparison that is 0.5 seconds worst and 0.25 on average. So a linear search is fine on a short list and painful on a hundred thousand records.
One bubble sort pass compares neighbours from left to right and swaps whenever the left is bigger, so one item reaches its place at the end. Walk 5, 3, 8, 1: compare 5 and 3 and swap, giving 3, 5, 8, 1; compare 5 and 8 and leave them; compare 8 and 1 and swap, giving 3, 5, 1, 8. The first pass made 3 comparisons and 2 swaps, and the largest item is last. The second pass covers the first three, the third covers the first two, and the total is 6 comparisons, which is 4 times 3 over 2.
Generalise to 100 items: at most 99 passes, and at most 100 times 99 over 2 comparisons, which is 4,950. If a pass makes no swap the list is already ordered, so it stops, and a sorted list of 100 needs only 99 comparisons. 1,000 items is 499,500 comparisons (demonstration figures).
That gives an important conclusion: 0478 has linear search only and no binary search, so sorting does not speed up searching. Sorting 1,000 items costs 499,500 comparisons while one linear search costs at most 1,000. Sorting pays only when the output must be in order, or when the largest and smallest are needed repeatedly.

Pass Comparisons Swaps Result
First swap 5 and 3, keep 5 and 8, swap 8 and 1 2 3, 5, 1, 8
Second keep 3 and 5, swap 5 and 1 1 3, 1, 5, 8
Third swap 3 and 1 1 1, 3, 5, 8

Students say how many passes an already sorted list needs, which is one, because a pass without a swap ends it.

Scene 2: Totalling, counting and averages – four skeletons

The other three methods are fixed skeletons, and the exam only changes the story. Totalling starts a sum at zero and adds each item; counting starts a counter at zero and adds one whenever the condition holds; maximum and minimum take the first value as the current extreme and replace it as they go; an average is the total divided by the number of items.
Demonstrate with a pile of receipts: 30 of them totalling 1240.50, so the average is 1240.50 divided by 30, which is 41.35; 8 of them are above 50, and that 8 is the count. Then 12 temperature readings: total 345, average 28.75 degrees, maximum 38 and minimum 21.
The four skeletons fail in the same place: the initial value. Sums start at zero and counts start at zero, but a maximum must not start at zero, because a list of negative readings would give the wrong answer, so the first item is the starting value. The second trap is what the average divides by: the number of items, not the total and not the maximum. In pseudocode the sum and count are set before the loop, updated inside it, and the average is worked out after it; in the wrong order every average divides by the last item only.

Students explain why a maximum cannot start at zero, using a list of negative numbers as the proof.

Scene 3: Validation and verification – sensible against identical

Validation checks whether input is sensible and acceptable, and there are six kinds. A range check tests the limits, such as a day from 1 to 31; a length check counts characters, such as a student ID of exactly 8; a type check tests for a whole number or for text; a presence check tests for a blank; a format check tests position, such as two letters then four digits; and a check digit is calculated from the other characters and compared with the check position entered.
Work the check digit once. The first four digits are 4, 1, 2 and 7, with weights 4, 3, 2 and 1 from the left: 4 times 4 plus 1 times 3 plus 2 times 2 plus 7 times 1 is 30; the remainder of 30 divided by 11 is 8, so the full code is 41278. If someone mistypes the third digit to give 41378 the total is 32 and the remainder 10, which is not 8, so the system rejects it. A check digit catches typos and transpositions, and not data that is the right shape but the wrong value.
Verification is a different job: it checks that the data entered matches the source. There are only two kinds. A visual check compares the screen or printout with the source, and 500 items at 30 seconds each is 15,000 seconds, which is 4.17 hours (demonstration figures), so in practice it is sampled. Double entry has two people key the same data and the system compares the two results.
State the difference in one line: validation asks whether the value is sensible, verification asks whether it matches the source. So a perfectly sensible value can still be wrong: typing 210 instead of 120 passes range and format, and only verification catches it. Conversely, 20 keying errors in 1,000 entries, which is 2 per cent, are all caught by double entry; but if both people misread the same figure on the same document, all 5 source errors survive, because both entries agree. There is a cost figure too: fixing 20 errors at the door takes seconds each, while tracing them later at 15 minutes each is 5 hours (demonstration figures).

Check What it tests How to write it What it catches
Range check A day is 1 to 31 REPEAT the input UNTIL it falls in range Catches 45 and 0
Length check A student ID is exactly 8 characters Reject unless LENGTH equals 8 Catches 7 or 9 characters
Type check An age must be a whole number Test whether the input is an integer Catches twelve or 12.5
Presence check A name must not be blank Reject when the length is zero Catches a bare Enter
Format check A code is two letters then four digits Test each position for letter or digit Catches AB12C4
Check digit The last digit is calculated from the first four Multiply by weights, add, take the remainder Catches the typo 41378

Students answer what separates validation from verification, mentioning the source, with one example that passes validation and is still wrong.

04 Question types and worked steps

Type Example Steps Answer
Linear search Find one name among 1,000 records Compare from the first item, counting comparisons 1,000 at worst, 500 on average
One bubble pass 5, 3, 8, 1 Compare neighbours and swap when the left is bigger 3 comparisons and 2 swaps, largest last
Three skeletons 30 receipts totalling 1240.50 Total, count, divide by the number of items Average 41.35, 8 above 50
Choose the check A student ID must be exactly eight characters Count the characters, which is one validation kind A length check, so validation, not verification
Sanity check (teach this): Rationality checks: (1) validation and verification are not interchangeable, since validation tests sense and verification tests the source; (2) all six validation checks must be known, and a check digit is validation, not verification; (3) 99 passes is the maximum, and a sorted list needs one, because no swap ends the sort; (4) the average linear search is half the list, assuming each position is equally likely, and the worst case is still the whole list; (5) sorting does not speed up a linear search, since 499,500 comparisons dwarf the 1,000 of one search; (6) maximum and minimum start from the first item, not zero, or a list of negatives gives the wrong answer; (7) double entry cannot catch source errors, so the 5 example is a ceiling, not a guarantee.

05 Independent practice (3 questions)

Question Answer What to watch
A linear search over 1,000 records at 0.5 milliseconds a comparison. How long on average? 500 comparisons, 0.25 seconds Check whether they used the worst case as the average
100 items through bubble sort. How many comparisons at most, and how many when already sorted? 4,950 at most, 99 when sorted Check whether they used n times n instead of n times n minus one over two
Digits 4, 1, 2, 7 with weights 4, 3, 2, 1 and remainder after dividing by 11. What is the check digit? 30 leaves 8 Check whether they reversed the weights

06 Common mistakes and what to say

Mistake Student writes Say this
Treating validation as proof If it passes validation the data is right Validation only shows it is sensible; typing 210 for 120 passes and only verification catches it.
Trusting double entry blindly Two people keying it twice cannot be wrong If both misread the same document, all 5 source errors survive.
Mixing validation with verification A check digit is a kind of verification A check digit is calculated from the other characters and tests sense, so it is validation; verification compares with the source.
Assuming sorting speeds up searching Sort it first and the search will be much faster 0478 has linear search only; sorting 1,000 items costs 499,500 comparisons against 1,000 for one search.

07 Homework (paper, section and question numbers)

08 Exit check (last 5 minutes)

Question Answer Decision
Two methods in one line Search compares one by one, sort compares and swaps neighbours Cannot say it, return to act one
Six checks Range, length, type, presence, format, check digit Cannot say it, return to the first half of act three
One line distinction Validation tests sense, verification tests the source Cannot say it, return to the end of act three

09 Tutor FAQ

Why say at most for bubble sort passes?

Because it can stop early. 100 items need at most 99 passes, but a pass with no swap means the list is ordered and the sort ends, so a sorted list needs one pass and 99 comparisons. Asked for the maximum, answer 4,950; asked for the best case, answer 99, and both numbers must be known.

Which comes first, verification or validation?

In practice the input is taken, then presence, type and format checks run, then double entry compares the two copies, and only then is the record stored. The order is less important than the distinction: verification confirms the copy, validation confirms the sense, and neither replaces the other.

What does a check digit catch and miss?

It catches a mistyped digit and two adjacent digits swapped, because the weighted total changes: 4127 leaves 8, and 4137 leaves 10. It misses a value that is the right shape but the wrong value, such as 4127 keyed where 5127 belongs, and it misses anyone who calculates a valid check digit on purpose. That is why a check digit is the first layer and important data is still verified against its source.

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 →