Validation & Verification Methods
9618 AS Computer Science
Data Integrity refers to the accuracy, completeness, and consistency of data. It ensures that:
Data integrity can be compromised during data entry, data transmission, malicious attacks (malware, hacking), or accidental data loss (hardware issues).
Validation is an automatic computer check to ensure that the data entered is sensible and reasonable. It does NOT check the accuracy of data.
Validation ensures data is sensible and reasonable, but cannot guarantee it is correct. Validation is automatically carried out by computer software.
Remember: Validation checks if data is reasonable (within acceptable criteria), NOT if it is accurate (correct). For example, if you enter your age as 62 instead of 26, it is reasonable but not accurate.
| Validation Type | Description | Example |
|---|---|---|
| Range Check | Ensures a number falls within a set range | Percentage must be 0-100 |
| Limit Check | Checks that a value does not exceed a maximum/minimum limit | Maximum 5 items per order |
| Length Check | Checks the length of a string | PIN must be exactly 4 digits |
| Type Check | Checks that input is correct data type | Age must be a whole number |
| Presence Check | Ensures field is not left blank | Registration form requires name |
| Existence Check | Checks that a referenced value exists in database | Student ID must exist in records |
| Format Check | Ensures data matches a pre-defined pattern | Email must contain @ and domain |
| Check Digit | Final digit calculated from other digits to detect errors | ISBN, barcodes |
Checks that only numbers within a specified range are accepted. For example, month in a date must not exceed 12, or a percentage must be between 0 and 100.
Checks only one limit - either upper limit or lower limit. For example, a maximum number of years for a person's age, or minimum order quantity.
Checks that data contains an exact number or range of characters. For example, a telephone number must be 10-11 digits, or a PIN must be exactly 4 characters.
Checks that characters entered conform to a pre-defined pattern. For example:
Ensures that an entry field is not left blank. For example, making sure a registration form is not submitted with blank required fields like name or email.
Checks that a referenced value exists in a database or list. For example, confirming a student ID entered exists in the school records, or a filename referred to in data entry actually exists.
A check digit is the final digit included in a code; it is calculated from all other digits in the code. When a number is entered into a computer, the check digit is recalculated and if the same value is not generated, an error will occur.
| Error Type | Example |
|---|---|
| Incorrect digit | 5327 entered instead of 5307 |
| Phonetic errors | 13 (thirteen) instead of 30 (thirty) |
| Transposition error | 4087 instead of 4807 (two digits swapped) |
| Missing/Extra digit | 247 instead of 2407, or 42107 instead of 4207 |
Step 1: Each digit is given a weighting from 10 down to 1 (left to right)
Step 2: Multiply each digit by its weighting and sum:
(1×10) + (8×9) + (4×8) + (1×7) + (4×6) + (6×5) + (2×4) + (0×3) + (1×2)
= 10 + 72 + 32 + 7 + 24 + 30 + 8 + 0 + 2 = 185
Step 3: Divide total by 11: 185 ÷ 11 = 16 remainder 9
Step 4: Subtract remainder from 11: 11 - 9 = 2
Check digit = 2
Note: If remainder is 10, letter X is used as check digit.
Step 1: Multiply 1st, 3rd, 5th, 7th digits by 3:
(3×2) + (3×4) + (3×3) + (3×5) = 6 + 12 + 9 + 15 = 42
Step 2: Add remaining digits: 42 + 1 + 2 + 4 = 49
Step 3: Divide by 10: 49 ÷ 10 = 4 remainder 9
Step 4: Subtract from 10: 10 - 9 = 1
Check digit = 1 → Full barcode: 21423451
Verification is checking that data has been accurately copied onto a computer or transferred from one computer system to another. Verification ensures data matches the original source.
| Method | Description | Limitations |
|---|---|---|
| Double Entry | Data is entered twice; computer compares both entries and outputs error if different | Time-consuming; same mistake entered twice won't be detected |
| Visual Check | User manually compares input data against original source document on screen | Prone to human error; relies on user attention |
| Check Digits | Final digit calculated from other digits; computer recalculates to verify | Only works for numeric codes; requires algorithm |
When data is transferred electronically from one device to another, there is possibility of data corruption or even data loss. Several methods exist to minimize this risk.
A checksum is a value transmitted at the end of a block of data, calculated using the other elements in the data stream, used to check for transmission errors.
A parity check is a method to check whether data has been changed or corrupted following transmission. An extra bit (parity bit) is added to a string of binary code to ensure the number of 1-bits are either even or odd.
| Parity Type | Rule | Parity Bit Value |
|---|---|---|
| Even Parity | Total number of 1-bits (including parity bit) must be EVEN | Set to make total even |
| Odd Parity | Total number of 1-bits (including parity bit) must be ODD | Set to make total odd |
If there are multiple errors in the same byte that still produce the same parity, the error will NOT be detected!
Example: "00001111" changes to "00000011" - both have even parity (four 1s and two 1s are both even... wait, 00001111 has 4 ones, 00000011 has 2 ones - both even!)
Actually: Original 00001111 has 4 ones (even), corrupted 00000011 has 2 ones (even) - parity unchanged, error undetected!
Parity blocks and parity bytes can be used to check an error has occurred AND where the error is located. Parity checks on their own only detect that an error occurred, not where.
ARQ (Automatic Repeat Request) is a form of error detection that uses a system of acknowledgements and timeouts. ARQ is often used to ensure reliable transmissions over an unreliable service.
| Component | Description |
|---|---|
| Acknowledgement (ACK) | Signal sent by receiver to confirm data was received correctly |
| Timeout | Set period of time after which data is resent if no acknowledgement received |
| Retransmission | Automatic resending of data when timeout occurs without acknowledgement |
ARQ combines well with other error detection methods. Data is first checked using parity or checksum, then if an error is found, no ACK is sent → timeout occurs → data is resent automatically.
| Data Security | Data Integrity |
|---|---|
| Deals with protection of data | Deals with validity of data |
| Protects data from illegal access/loss | Ensures data is not corrupted after input or transmission |
| Methods: Encryption, firewalls, passwords, access control | Methods: Validation, verification, checksums, parity checks |
| Prevents unauthorized users from accessing data | Ensures data accuracy and consistency |
| Term | Definition |
|---|---|
| Data Integrity | The accuracy, completeness, and consistency of data; ensures data is correct and not corrupted |
| Validation | Automatic computer check to ensure data entered is sensible and reasonable |
| Verification | Checking that data has been accurately copied or transferred, matching the original source |
| Range Check | Validation that ensures a number falls within a specified minimum and maximum range |
| Limit Check | Validation that checks a value against one limit (upper or lower) only |
| Length Check | Validation that checks the number of characters in data entry |
| Format Check | Validation that ensures data conforms to a pre-defined pattern |
| Presence Check | Validation that ensures a field is not left blank/empty |
| Existence Check | Validation that confirms a referenced value exists in a database or file system |
| Type Check | Validation that ensures the correct data type is entered |
| Check Digit | Final digit in a code calculated from other digits to detect entry errors |
| Double Entry | Verification method where data is entered twice and compared for match |
| Visual Check | Verification method where user manually compares input with original source |
| Checksum | Value transmitted with data block, calculated from data, used to detect transmission errors |
| Parity Bit | Extra bit added to binary data to make total number of 1s even or odd |
| Even Parity | Parity system where total number of 1-bits (including parity bit) must be even |
| Odd Parity | Parity system where total number of 1-bits (including parity bit) must be odd |
| Parity Block | Grid of data with horizontal and vertical parity bits to locate errors |
| Parity Byte | Additional byte containing vertical parity bits for each column in a parity block |
| ARQ | Automatic Repeat Request - error control using acknowledgements and timeouts |
| Acknowledgement | Signal sent by receiver to confirm successful data receipt |
| Timeout | Set period after which data is resent if no acknowledgement received |
| Transposition Error | Error where two adjacent digits are swapped (e.g., 4087 instead of 4807) |
| Phonetic Error | Error caused by similar-sounding numbers (e.g., 13 instead of 30) |
Answer:
Answer:
Answer:
Answer:
Answer:
Answer:
Answer:
Answer:
Answer:
Answer:
EAN8 Check Digit:
ISBN-10 Check Digit:
| Topic | Key Point |
|---|---|
| Validation | Checks reasonableness, NOT accuracy |
| Verification | Confirms data matches original source |
| Parity Check | Extra bit for even/odd count of 1s |
| Parity Block | Locates exact error position |
| Checksum | Value from algorithm to detect corruption |
| ARQ | ACK + Timeout = Reliable transmission |
| Check Digit | Final digit calculated from code |
| Situation | Best Method(s) |
|---|---|
| Ensuring password typed correctly | Double entry verification |
| Checking age is reasonable | Range check validation |
| Detecting transmission errors | Checksum, Parity check, or ARQ |
| Finding exact error location | Parity block check |
| Verifying barcode correctness | Check digit |
| Ensuring field not empty | Presence check validation |
| Reliable data transmission | ARQ + Checksum/Parity |