Validation and Verification
Validation and Verification
Chapter: 7
Basic data types in programming
▪ Data in programs can be of different types. numeric or text
▪ You will need to tell your program what type of data you want it to store in a variable.
2. Verification is used to check that the data does not change as it is being entered.
Verification
• Verification is checking that data has been accurately copied from one source to another - for
instance, input into a computer or transferred from one part of a computer system to another.
• Verification methods for input data include:• The data is entered twice, sometimes by different operators.
⮚ Double entry • The computer system compares both entries and if they are
⮚ Screen / visual check
different outputs an error message requesting that the data
is entered again.
⮚ Type checks
⮚ Presence checks
⮚ Format checks
⮚ Check digits
Validation
• Validation is the automated checking by a program that data is reasonable before it is accepted into a computer system.
When data is validated by a computer system, if the data is rejected a message should be output explaining why the data
was rejected and another opportunity given to enter the data.
There are many different types of validation checks including:
A type check checks that the data entered is of a given data type.
⮚ Range checks e.g. the number of brothers or sisters would be an integer (whole number)
⮚ Length checks
⮚ Type checks
⮚ Presence checks
⮚ Format checks
⮚ Check digits
Validation
• Validation is the automated checking by a program that data is reasonable before it is accepted into a computer system.
When data is validated by a computer system, if the data is rejected a message should be output explaining why the data
was rejected and another opportunity given to enter the data.
There are many different types of validation checks including:
A presence check checks to ensure that some data has been entered and the value has not
⮚ Range checks been left blank.
⮚ Length checks e.g. an email address for an online transaction must be completed.
⮚ Type checks
⮚ Presence checks
⮚ Format checks
⮚ Check digits
There are many different types of validation checks including:
⮚ Range checks
A format check checks that the characters entered conform to a pre-defined pattern.
⮚ Length checks
⮚ Type checks
⮚ Presence checks
⮚ Format checks
⮚ Check digits
Validation
• Validation is the automated checking by a program that data is reasonable before it is accepted into a computer system. When data is
validated by a computer system, if the data is rejected a message should be output explaining why the data was rejected and another
opportunity given to enter the data.
There are many different types of validation checks including:
⮚ Range checks
⮚ Length checks • A check digit is the final digit included in a code; it is calculated from all the other digits in
⮚ Type checks the code.
⮚ Presence checks • Check digits are used for barcodes, product codes, International Standard Book Numbers
⮚ Format checks (ISBN) and Vehicle Identification Numbers (VIN).
⮚ Check digits • They are used to identify errors in data entry caused by mis-typing or mis-scanning a
barcode.
o An incorrect digit entered, e.g. 5327 entered instead of 5307
o Transposition error where two numbers have changed order, e.g. 5037 instead 5307
o Omitted or extra digits, e.g. 537 instead of 5037 or 53107 instead of 5307
o Phonetic errors, e.g. 13, thirteen, instead of 30, thirty.