Validation, verification and trace tables
| English | Chinese | Pinyin |
|---|---|---|
| validation | 验证 | yàn zhèng |
| verification | 核实 | hé shí |
| trace table | 追踪表 | zhuī zōng biǎo |
| range check | 范围检查 | fàn wéi jiǎn chá |
| length check | 长度检查 | cháng dù jiǎn chá |
| presence check | 存在性检查 | cún zài xìng jiǎn chá |
| test data | 测试数据 | cè shì shù jù |
Checking and tracing
- When data is entered, we check it to reduce mistakes.
- Validation 验证 checks it is sensible; verification 核实 checks it was copied correctly.
- A trace table 追踪表 follows an algorithm step by step.
Validation
- Validation checks data is sensible and follows the rules (it can't check the data is true).
- Range check 范围检查 (between limits), length check 长度检查 (right number of characters), type check (right kind of data), presence check 存在性检查 (not blank), format check (right pattern, e.g. dd/mm/yyyy), and a check digit (an extra digit confirming a number).

Every algorithm decomposes into input, processing and output — here, finding the average of three marks.
Checking that an age is between 0 and 120 is a:
A range check confirms a value lies within allowed limits.
Match each validation check to its purpose.
Presence = not blank; type = right kind of data; format = right pattern.
Verification
- Verification checks data was copied or entered correctly (no typing mistakes).
- Visual check — a person compares the typed data with the original.
- Double entry — the data is entered twice and the two copies are compared.

Linear search checks each item in turn from the start until it finds the value.
Validation checks that data is sensible (in range, right type, not blank), while verification checks it was copied or entered correctly (e.g. double entry).
Validation = "is it sensible?"; verification = "was it entered/copied correctly?" — you usually want both.
Entering data twice and comparing the two copies is:
Double entry is a verification method — the two copies must match.
Trace tables and test data 测试数据
- A trace table records each variable's value as an algorithm runs — to check it works or to find out what it does.
- Test data types: normal (accepted), abnormal (rejected), extreme (largest/smallest allowed), boundary (the values on each side of a limit, e.g. 120 and 121).

A trace table records each variable's value as the program runs
Fill in a trace table
A trace table follows the variables one line at a time. Step through and watch the counter and the running total change — exactly the skill a trace-table exam question tests.
A trace table is used to:
Tracing helps you check an algorithm works, or work out what it does, by following the variables.
Trace total = 0; FOR i = 1 TO 5: total = total + i. What is total at the end?
1+2+3+4+5 = 15 — the value the trace table builds up row by row.
You've got it
- validation = is it sensible? (range, length, type, presence, format, check digit)
- verification = was it copied correctly? (visual check, double entry)
- a trace table tracks variable values step by step
- test data: normal, abnormal, extreme, boundary