Validation, verification and trace tables
Introduit| English | Sens |
|---|---|
| validation/ˌvælɪˈdeɪʃn/ | validation |
| verification/ˌverɪfɪˈkeɪʃn/ | vérification |
| trace table/treɪs ˈteɪbl/ | table de traçage |
| range check/reɪndʒ tʃek/ | contrôle de plage |
| length check/leŋθ tʃek/ | contrôle de longueur |
| presence check/ˈprezəns tʃek/ | contrôle d'existence |
| test data/test ˈdeɪtə/ | données de test |
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).

Checking that an age is between 0 and 120 is a:
Difficulté 1/5 · 100 pièces + un petit bonus lors de la première réussite aujourd'hui
A range check confirms a value lies within allowed limits.
Match each validation check to its purpose.
Difficulté 2/5 · 140 pièces + un petit bonus lors de la première réussite aujourd'hui
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.
Double entry of data is a validation check.
Difficulté 1/5 · 100 pièces + un petit bonus lors de la première réussite aujourd'hui
False. Double entry is a verification check: it confirms data was entered correctly. Validation checks that data is sensible, such as a range or type check.
Entering data twice and comparing the two copies is:
Difficulté 1/5 · 100 pièces + un petit bonus lors de la première réussite aujourd'hui
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).

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:
Difficulté 1/5 · 100 pièces + un petit bonus lors de la première réussite aujourd'hui
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?
Difficulté 2/5 · 140 pièces + un petit bonus lors de la première réussite aujourd'hui
1+2+3+4+5 = 15 — the value the trace table builds up row by row.
Worked example: test data for an exam mark
A program accepts whole-number exam marks from 0 to 100. Give one value of each type of test data.
- Normal: 57 (accepted). Abnormal: −8 or "ten" (rejected). Extreme: 0 and 100, the smallest and largest allowed values (accepted).
- Boundary: test each side of each limit: 100 (accepted) and 101 (rejected); 0 (accepted) and −1 (rejected). The check used is a range check, plus a type check for "ten".
A program accepts ages 18 to 65. Which pair is boundary test data for the upper limit?
Difficulté 1/5 · 100 pièces + un petit bonus lors de la première réussite aujourd'hui
Boundary data sits on each side of a limit: 65 should be accepted and 66 rejected.
Typing a new password twice is a validation check.
Difficulté 1/5 · 100 pièces + un petit bonus lors de la première réussite aujourd'hui
Double entry is verification: it checks the data was copied correctly, not that it is sensible.
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