Data Validation

A check to see if data is 'valid' before it is processed...i.e. that it is sensible data.

There are a number of different data validation checks which can be carried out...These are some of them...

Presence Check A check that makes sure some data fields are present

Example:
An application for a passport must have the applicant's surname.

 

Range check A check to see if data lies within a specific range.

Examples:
The 'day' part of a date must be in the range 1..31
An exam grade should be in the range 'A'...'G' or 'U'

 

Type check Checks to see of data is of the right type

Examples:
Exam marks should be numbers (integers)
Exam grades should be letters.

 

Format check A check that data is in a particular format.

Example:
A postcode must be 2 letters, 2 digits, a space, a digit and 2 letters.

 

Length check Checks to see if data has the correct number of characters in it.

Examples:
Bank account numbers should be 8 characters.
Postcodes should be 4 characters... a space... and then 3 characters.

 

Check digit For numerical data. A check digit is an extra digit added on to a number. This check digit is the result of a calculation performed on the digits of the number.

When the data is entered into the computer, it performs the same calculation to see if the check digit is correct...ie it checks the check digit!

Examples
The last digit of a bar code is a check digit.
The last digit of an ISBN number on a book is a check digit.

Incidentally...this is one reason why you cannot 'invent' credit card numbers!