Robust Programs Flashcards
What are two defensive design considerations?
Anticipating misuse
Authentication
Input sanitisation
What is anticipating misuse?
Planning ahead to take steps against potential misuse
What is authentication?
Ensuring only authorised can gain access to the system
What is input santisation?
Cleaning up unwanted data (e.g. changing cases)
What is input validation?
Checks if data follows a criteria
What is range check?
Checks if data is within a certain range
What is format check?
Checks if data is entered in a certain way (e.g. DD/MM/YY)
What is presence check?
Checks if data has been entered
What is type check?
Checks if data is a certain type
What is length check?
Checks if the length of input is within a certain amount
What are the main ways to make a program more maintainable?
Indentations
Sub programs
Comments
Naming conventions
What is the use of indentations?
Makes the program more maintainable by improving the readability by showing each ‘block’ of code
What is the use of sub programs?
Makes the program more maintainable by making it easier to read, debug + code
What is the use of comments?
Makes the program more maintainable by making the code easier to understand
What is the use of naming conventions?
Makes the code more maintainable by making variables more understandable (score = int(input…
What is the purpose of testing?
Ensures the program works correctly no matter what the user inputs
What is iterative testing?
Testing the program whilst coding it
What is final testing?
Testing the code once it has all been coded
What is a syntax error?
A mistake in the grammar/ spelling of the program (program isn’t able to run)
What is a logical error?
A mistake made by the programmer (program still runs)
What is test data?
Data used to test if the program works correctly
What is normal data?
Data that the program should accept and process
What is boundary data?
Data at the extreme boundary of data ranges
What is invalid data?
Data of the correct type but doesn’t meet validation rules
What is erroneous data?
Data of the wrong type that the program shouldn’t accept and can’t process