Validation (Edexcel GCSE Computer Science): Flashcards
📚Flashcards
Practise the cards
13 cards from this deck
ShowHide
Practise the cards
13 cards from this deck
What is validation in programming?
What is validation in programming?
Ensures data received is suitable for processing
Garbage in, garbage out principle
Garbage in, garbage out principle
Bad data input produces bad/unreliable results
Length check definition
Length check definition
Verifies input has correct number of characters
Length check use cases
Length check use cases
4-digit PIN, postcode validation
len() function purpose
len() function purpose
Counts characters in input
Presence check definition
Presence check definition
Ensures user entered something, not blank input
Presence check benefit
Presence check benefit
Prevents processing empty data that causes errors
Check empty input with len()
Check empty input with len()
len(key) == 0
Alternative empty input check
Alternative empty input check
key == ""
Range check definition
Range check definition
Verifies value falls between acceptable limits/boundaries
Range checks applicability
Range checks applicability
Work for both numbers and text characters
Operators in range checks
Operators in range checks
Relational (<, >, <=, >=) and Boolean (and, or) operators
Combining validation types
Combining validation types
Use multiple checks together for thorough data validation
