Validation, verification and trace tables · 验证、核对与追踪表
| English | 中文 | Pinyin · 拼音 |
|---|---|---|
| validation/ˌvælɪˈdeɪʃn/ | 验证 | yàn zhèng |
| verification/ˌverɪfɪˈkeɪʃn/ | 核实 | hé shí |
| trace table/treɪs ˈteɪbl/ | 追踪表 | zhuī zōng biǎo |
| range check/reɪndʒ tʃek/ | 范围检查 | fàn wéi jiǎn chá |
| length check/leŋθ tʃek/ | 长度检查 | cháng dù jiǎn chá |
| presence check/ˈprezəns tʃek/ | 存在性检查 | cún zài xìng jiǎn chá |
| test data/test ˈdeɪtə/ | 测试数据 | 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)检查它是否合理;核对(verification)检查它是否被正确复制。
- 一张追踪表(trace table)逐步跟随一个算法。
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.
验证
- 验证检查数据合理且遵循规则(它不能检查数据是否真实)。
- 范围检查(range check,在限制之间)、长度检查(length check,正确的字符数)、类型检查(type check,正确的数据种类)、存在检查(presence check,不为空)、格式检查(format check,正确的模式,例如 dd/mm/yyyy),和一个校验位(check digit,确认一个数的额外数字)。

每个算法分解为输入、处理和输出——这里,求三个分数的平均。
Checking that an age is between 0 and 120 is a: · 检查一个年龄在 0 和 120 之间是一个:
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.
核对
- 核对检查数据是否被正确复制或录入(没有打字错误)。
- 目视检查(visual check)——一个人把键入的数据与原件比较。
- 双重录入(double entry)——数据被录入两次,两个副本被比较。

线性搜索从开始依次检查每个项目,直到找到这个值。
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
追踪表与测试数据
- 一张追踪表记录一个算法运行时每个变量的值——以检查它是否有效或弄清它做什么。
- 测试数据(test data)类型:正常(normal,被接受)、异常(abnormal,被拒绝)、极端(extreme,允许的最大/最小)、边界(boundary,一个限制每一侧的值,例如 120 和 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: · 一张追踪表被用来:
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? · 追踪 total = 0; FOR i = 1 TO 5: total = total + i。最后 total 是多少?
1+2+3+4+5 = 15 — the value the trace table builds up row by row. · 1+2+3+4+5 = 15——追踪表逐行累积的值。
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
你掌握了
- 验证 = 它合理吗?(范围、长度、类型、存在、格式、校验位)
- 核对 = 它被正确复制了吗?(目视检查、双重录入)
- 一张追踪表逐步跟踪变量的值
- 测试数据:正常、异常、极端、边界