Producing robust programs Flashcards
1
Q
input validation techniques
A
- type check
- range check
- presence check
- format check
- length check
1
Q
Anticipating misuse
A
- division by zero
- communication error
- printer and other peripheral errors
- disk errors
2
Q
Authentication
A
A way to confirm a user identity usually by usernames and passwords
3
Q
How to increase the security of pass-based authentication systems?
A
- force user to use strong passwords
and change it regularly - limit the num of failed attempts
4
Q
Ways to maintain program
A
- comments
- white space
- indentation
- descriptive variable names
- functions
- constants at top of program
5
Q
Comments use
A
- explain program
- explain section of code
- visually divide sections of program
6
Q
White space use
A
- makes sections of program easier to see
7
Q
Indentation use
A
- for every selection and iteration
branch
8
Q
reasons for testing
A
- ensure no errors in code
- check that program has an acceptable
performance and usability - ensure that unortharised access is
prevented - check if program meets the
requirements
9
Q
What are the 2 types of testing
A
- iterative testing
- terminal testing
10
Q
Iterative testing
A
- each new module is tested as it is
written - program branches checked for
functionality - checking new modules dont introduce
new errors in existing code - ensures the program handles
erroneous data and exceptional
situations
11
Q
terminal testing
A
- all modules work together
- program produces required results
with normal, boundary, invalid and
erroneous data - program meets the requirements with
real data - beta test may find more errors
12
Q
types of data tests
A
- normal inputs
- boundary input
- invalid input
- erroneous input
13
Q
How to make an algorithm more robust
A
- writing code which anticipates a range
of possible inputs - those input could be invalid or
erroneous data - making sure bad data doesnt crash
the program - making sure prompts to the user are
descriptive and helpful - making sure only data of the correct
“data type” are entered - checking and handling missing or
black data
14
Q
A