1/21
Name | Mastery | Learn | Test | Matching | Spaced | Call with Kai |
|---|
No analytics yet
Send a link to your students to track their progress
Valid data
Data that is within the limits of what a user might sensibly or reasonably enter.
Validation
Automatic checking of data (checked by system), to ensure only possible, sensible, reasonable data is accepted.
How should good code approach validation?
Code should always be tested with data samples from as many of the following types: normal, boundary, abnormal, erroneous. It data is rejected, a message should explain why, and another opportunity to answer should be given.
Normal data
Data that is sensible and should be accepted.
Boundary data
Data that is right at the very edge of the accepted range.
Abnormal data
Valid data that falls outside of the accepted range.
Erroneous data
Data that is outside of the accepted range.
Range
Number must be in a specified range, e.g. between 0 and 100 inclusive.
Length
Length of inputted characters must match specified number of characters, e.g. 8 characters long / between 2 and 30 characters long
Type
The data inputted must be of the correct data type: it must follow rules related to whether it is numbers or letters, e.g. number of siblings must be an integer
Look-up
A specific character must be / must not be included, e.g. an @ in an email address / a % in name.
Often coded with lists of data
Format
Ensures the data entered is in the correct format required, e.g. an date as 00.00.0000
Presence
Ensures some data has been entered, e.g. a phone number in a form
Uniqueness
Used to check data such as an email address or username are unique within a system.
Where is validation written into?
Programmes for: Database data entry, Online data entry to forms on websites, Data entry to kiosks (at train stations / ATMs)
ANSWERING TEST DATA QUESTIONS
"Abnormal data would be 20 and it should not be accepted."