You are on page 1of 10

Validation/verification

Lecture 2
Validation
• Validation is a process that checks that data is reasonable (side by side) before it is accepted by a computer system.
• Validation is automated meaning that a well designed algorithm should successfully decide whether or not data is
acceptable. These include:
• Range Checks
• Presence Checks
• Format Checks
• Type Checks
• Character Checks
• Check digit
• Length check
Range check
• A range check is used to ensure that numbers are only accepted into a
program if it falls within a certain acceptable range.
• Example - If a program asks for somebodies age then you might limit
entries to be between 13 and 100
Age = 0
OUTPUT "Please enter your age"
Age = INPUT()
WHILE Age < 13 OR Age > 100 DO
Presence check
• A Presence check is used to ensure that some data has been entered
OUTPUT "Please enter your name so that we can post your comment"
Name = INPUT()
WHILE Name = "" DO
     OUTPUT "Sorry, You must enter a name before your post can be
published"
     Name = INPUT()
END WHILE
Format check
• A format check is used to ensure that data entered matches a desired
pattern.
e.g. if a user is required to enter an email address then it should follow a set
pattern of "XXXXX" + @ + "XXXXX" + "." + "XXX"  This would allow an
email address such as "example@gmail.com" to be accepted.
TYPE CHECK

•  A Type check is used to ensure that the correct data type has been
entered.  OUTPUT "Please enter your age"

While Accepted = False Do:


​     Age = INPUT()
     IF Age.isdigit():
        Accepted = TRUE
     ELSE:
          OUTPUT "Age Not acceptable - Must be a whole
number"
     END IF
CHARACTER CHECK

•  A Type check is used to ensure that an entered string does not contain any
unacceptable characters. 

An example scenario might be that a user needs to choose a username.


The username cannot contain the ! or @ symbol as they are reserved for
admin usernames.
Verification
• purpose of Verification is to ensure that data that has been entered into a
computer there are 4 Verification methods to be aware of at this stage, these are:
• Visual Checking
• Double entry verification
• Parity Checks
• Check sums
.
VISUAL CHECKING

•  A visual data check is as simple as it sounds. It is a very manual / human


way of checking which involves a user manually reading through data to
ensure that it is correct.
This is similar to proof reading. If a mistake is spotted then the data can
be changed.
DOUBLE ENTRY VERIFICATION

Double entry verification works by asking the


user to enter data twice.
The two pieces of data will then be compared.
If the two entered pieces of data do not match
then a mistake has been detected.
The user will now be asked to enter the data again.

You might also like