Information Technology Topic

Choosing Validation and Verification Checks

  1. Read notes
  2. Flashcards
  3. Quiz
  4. Confident

Study focus - 3 things

  1. Validation checks that data is allowed and believable (range, reasonableness, data type, inconsistency). Verification checks that what was typed matches the original. Choose by asking what kind of mistake could happen to this field
  2. A value can pass every validation check and still be wrong: 64 typed instead of 46 sits inside a 0 to 100 range, so only verification such as double entry can catch it
  3. Double entry means the same data is keyed twice and the computer compares the two. Any difference is flagged and checked against the source document, which catches typing and transposition errors

Section 1Pick the check to fit the mistake

Every check has one job. A check can only catch the mistakes it was built for, so choosing a check means matching it to the mistake you expect. Validation looks at the data itself and asks: is this value allowed, and does it make sense? It does not need the source document. Verification asks a different question: is what was typed exactly what the source document says? Here's the trick: before you name a check, ask 'what could go wrong with this field?' A mark of 154 out of 100 breaks a rule. A mark of 46 typed as 64 breaks no rule at all, and only a comparison with the original will show it. One check is rarely enough. A form usually has different validation checks on different fields, plus verification for the fields where a quiet slip would do real damage, such as pay or account numbers.

Section 2Range check: limits on a number

A range check tests that a value lies between a lowest and a highest limit. Anything outside the limits is rejected. Use it where a number or date has firm limits: a CSEC practice mark from 0 to 100, a month from 1 to 12, or the age on a first-form entry sheet from 10 to 14. A kind of range check is used on real application forms, where an age outside the allowed band is refused as invalid. Watch out: a range check only says inside or outside. If a clerk types 12 when the form says 13, the 12 is inside 10 to 14, so it passes. The check cannot know the value is wrong.

Section 3Reasonableness check: allowed but not believable

A reasonableness check asks whether a value is believable, even though the rules allow it. It compares the value with what is normal or expected. For example, hours worked in a week may be allowed from 0 up to 60. A part-time cashier who normally works 20 hours and suddenly shows 58 is inside the limits, but the figure is far from normal, so it is queried. Here's the trick: a range check has fixed limits that never move. A reasonableness check is about what is likely for this person, item or situation, and it often just raises a query for someone to look at.

Section 4Data type check: the right kind of data

A data type check tests that the value is the right kind of data for its field: numbers in a quantity field, a real date in a date-of-birth field. The word ten typed into a quantity field is rejected. The number 10 is accepted. Each database field has one data type, so the system can refuse anything of the wrong kind before it is stored. Easy to mix up: a data type check says nothing about whether the number is sensible. 9999 is a perfectly good whole number for a quantity field, so the type check passes it. Sensible limits are the job of a range or reasonableness check.

Section 5Inconsistency check: fields that disagree

An inconsistency check compares two or more fields that belong together and makes sure they do not contradict each other. Each value alone might pass every other check. A mother's date of birth must come before her child's. A library book cannot be returned before the day it was borrowed. In a household survey, a form that gives more people living in the house than the number of people it has answers for is flagged for a follow-up call. Here's the trick: whenever a form has two fields that depend on each other, such as two dates, or a date of birth and an age, think inconsistency check.

Section 6Verification by double entry

Double entry is a way to verify typed data. The same data is keyed in twice, usually by two different people, and the computer compares the two entries. Wherever they differ, it flags the item. When an item is flagged, someone looks at the source document and decides which entry, if either, is right. Double entry catches typing errors (a wrong key hit) and transposition errors (digits swapped, such as 4175 typed as 4715), because two people rarely make the same slip in the same place. Watch out: double entry compares the two entries with each other, not with the truth. If both people copy the same mistake, or the source document itself is wrong, nothing is flagged. Survey offices that do large amounts of keying also test their keyers on batches with known answers and track an error rate, because accuracy has to be proved.

Section 7Choosing checks for a scenario

Work through four steps. 1: list the fields. 2: for each field, ask what could go wrong. 3: match the mistake to a check. 4: decide whether the data comes from a source document and would be costly if wrong, which means add double entry. Number must stay between limits: range check. Value allowed but unlikely: reasonableness check. Wrong kind of data: data type check. Two fields must agree: inconsistency check. Typed value must match the document: double entry. In an answer, name the check and say what it catches. 'Range check on hours, 0 to 120, to reject impossible values; double entry of the timesheet, to catch 38 typed as 83' scores better than just listing words. And remember validation never proves a value is right, it only proves it is acceptable.

Examples

A teacher in Portmore keys practice test marks out of 100 into a class file. The source sheet shows 78, 54, 91, 46 and 67. By mistake she types 78, 154, 91, 64 and 67. The mark field has a range check from 0 to 100. (a) State which typed marks the range check rejects. (b) Compare the typed marks with the source sheet and state how many are wrong. (c) Identify the wrong mark that the range check lets through, name the type of error, and suggest a check that would catch it.

(a) Test each typed mark against 0 to 100. 78: inside. 154: more than 100, rejected. 91: inside. 64: inside. 67: inside. Only 154 is rejected, so one mark. (b) Compare with the source: 78 correct, 154 wrong (should be 54), 91 correct, 64 wrong (should be 46), 67 correct. Two typed marks are wrong. (c) The wrong mark that passes is 64. The digits of 46 have swapped places, so it is a transposition error. A range check cannot see it because 64 is a perfectly allowed mark. Verification by double entry would catch it: the second typing of 46 would differ from 64, the item would be flagged, and the teacher would check the source sheet.

A call centre in Montego Bay registers 5 agents. Employee numbers have 5 digits. The source list is 40718, 52390, 61845, 73026 and 80957. Operator A types 40718, 52930, 61845, 73026 and 80957. Operator B types the same list independently as 40718, 52390, 61845, 73062 and 80957. (a) State which check would reject any entry that contains letters, and say whether all of A's and B's entries pass it. (b) Compare A's and B's entries and state how many numbers are flagged by double entry. (c) Using the source list, state which operator made each error and name the type of error. (d) The form also holds each agent's date of birth and start date. Name the check that makes sure an agent was not born after they started, and explain it.

(a) A data type check (digits only). Every entry from A and B is made of digits, so all pass. The check cannot see the slips. (b) Compare row by row. Row 1: 40718 and 40718 match. Row 2: 52930 and 52390 differ. Row 3: 61845 and 61845 match. Row 4: 73026 and 73062 differ. Row 5: 80957 and 80957 match. Two numbers are flagged. (c) Row 2: the source says 52390, so Operator A made the error, 52930. The 3 and 9 swapped, a transposition error. Row 4: the source says 73026, so Operator B made the error, 73062. The 2 and 6 swapped, also a transposition error. The other three rows matched, so nothing was flagged. (d) An inconsistency check. The two dates belong together: the date of birth must come before the start date. Each date alone could pass a range check, but the pair contradicts each other, so the check rejects it.

Now let's water it

Session runs notes to flashcards to quiz back-to-back.

Where this comes from