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…