Python for GCSE

7: Validation and exception handling

Revision tools
You can print this page for a quick reference guide or you can use the tools below to create printable test sheets
7.1: know the purpose of testing and be able to design and use test plans and test data.
Validation and exception handling
KeywordDefinition
actual resultdescription of what a program actually did when it was tested
expected resultdescription of what a program should do if it worked fully
test datathe specific values that will be input into a program in order to test one part of it
test plana list of ways in which a program will be tested to make sure it works fully
7.2: understand how to write code that accepts and responds appropriately to user input.
Validation and exception handling
KeywordDefinition
inputthe data that a program accepts in (e.g. from the user or a file)
outputthe data that a program sends out (e.g. to the user or a file)
processthe calculations that take place to work out what outputs to send based on the inputs a program receives
7.3: use validation and exception handling to make programs robust
Validation and exception handling
KeywordDefinition
presence checktype of validation where the program checks data for empty values
range checktype of validation where data is checked to see if it's between an expected minimum and maximum value
type checktype of validation where data is checked against what sort of data the program expects (e.g. integer, boolean, character or string)
validationchecking that input data is suitable for processing and doesn't contain anything that would cause an error to occur