Validation
Validation takes place wher daa is inputinto a computer
system. The purpose isto ensure the data is sensibleand
conforms to defined rules. A railway season ticket wil have
ancxoiry date. The season ticket isvalid unciit expires
Onceit expiresitis aval d. The “ulefrere is that tre date
‘the season ticket is usec must be before ts expiry date.
When date is validated, fit conforms to the rules then tt
will be accepted. Ititdoes not cortorm to therules, they
‘twill be rejected and an error message will be presented
Validation dees not ensure that cata iscarrect.
TASK
‘create a flow chatt to descrie the pracessaf validation
"You should inches the following:
+ Start
+ eed
+ Inputot data
+ Friormescage
+ dataccepied
+ Datarejecied
+ Validation decision
There area variety of different validation checks that
can be used tecchecie whether data is accentahle.
These cifferen:checksere the diflerent types oi rules
hat are used
Presence check
‘Apreserce checkis used to ensure that data is entered IF
data is entored, then itis accepted. I! data is not entered,
then the user will be presented with an error message
asking them tonter dala,
Figure 1.21 -Required data ona website.
Wren fiingina ‘contact us formona webste, ts
essential thatanemailadcress isertered. Thefollowing
‘would bevalidifonly a presance check iscaried out:
a
+ e@b
+ s@bed
+e
+ 977823
Notice tat none o heseare correct but they pass
theruie that data must be present.
Range check
‘Aranige check ensures that deta is within a defined range.
‘Alimil checkhas a single boundary, (his could be the
highest possible value or the lowest possible value.
‘Arange check includes two boundaries, which wauld be
‘the lower boundary and the usper boundary. The following
symbols are usech when compering with a boundary:
> greater than
= lassthan
= greaterthan or equal to
lessthanorequal to
£n opinion polls taken ard asks forthe tesponden’s
age Tierespondentshavetobe at least IByearscld,
the lower boundary i 18. Thereis no upner bouncary,
20 this isa limit check. Thiscould be waitten as:
Age>=18.
Letters representing grades foran exam are
entered, Only the letters A-E are valid grades, The
grademusi be less than F The upper boundary is €.
Therais no lower boundary, se Lis is limit check,
‘This could bewsiten as:
Grado< F
The number of students in a class must be between
Sand 28. Thelower sourdery 5 and the upper
oundary is 28, 50 thisisa range check. This could
be written as:
Number of students>=5 and <=28