Menu

Input Validation

Card 1 of 16 0 got it 0 still learning
Question
TapClick or press space to see the answer
Answer
All 16 cards in this set
Which term describes checking that an input matches a set of rules, such as a postcode having the correct format?
Pattern check
What is meant by a length check?
Checking that an input has a certain number of characters
What is the name for the check that makes sure a value is between an upper and a lower limit?
Range check
What is meant by authentication?
Checking that someone is who they say they are
What is the name for the check that makes sure a field has not been left blank?
Presence check
What is meant by authentication by lookup?
Checking a username and password against stored records
A program must not accept a blank username. Which validation check should be used?
Presence check
A program asks for an age and only accepts values from 0 to 120 inclusive. Which validation check is being used?
Range check
A password must be at least eight characters long. Which validation check is being used?
Length check
A room code must be a letter followed by a number, for example B7. Which validation check is being used?
Pattern check
In a program, which function checks that a username contains only letters?
isalpha()
A program stores valid usernames and passwords in a 2D list. Which term describes checking a password against this stored data?
Authentication by lookup
Why does a program that asks for a user's age need validation?
To reject values that are not realistic
A user enters a postcode that is correctly formatted but is not their real postcode, and the program accepts it. What does this show about validation?
It checks the data is reasonable, not that it is correct
A program holds a stored password and only allows a user to continue when the password typed in matches it. What does this check achieve?
It confirms the user is who they say they are
A program uses a while loop around the input for a postcode, so the question is asked again and again until a valid postcode is entered. Why is the loop used?
To keep asking until the data is valid