2.3.1 Flashcards
what is defensive design?
the practice of anticipating every possible way that a user could misuse a system or device
a defensive design has not been good enough when:
-the program crashes
-the program behaves in an unintended fashion
-data security has been compromised
what does defensive design anticipate?
it anticipates misuse and uses authentication
what’s the first part of defensive design?
to decide what type of user interface to use: command line interface, graphical interface, menu driven interface
what’s the second part of defensive design?
considering how data is entered- using widgets is a way of limiting data entries and preventing entry errors
what’s the third part of defensive design?
when data is entered into a program it is important that it is valid in order for the program to operate correctly
validation
check made by a computer to ensure that the data entered is sensible or reasonable
what are the different types of validation checks?
-presence check
-range check
-type check
-format check
-lookup check
-contingencies
presence check
makes sure the data has been entered in a particular field
range check
ensures the data is within a certain limit
type check
ensures the data is in the correct data type
format check
ensures the data entered matches a particular pattern
lookup check
checks to see if the data exists in a list
contingencies
unexpected events, this could include: invalid input of data, file missing ect.
global
the variable can be used outside a function