Producing robust programs Flashcards

1
Q

input validation techniques

A
  • type check
  • range check
  • presence check
  • format check
  • length check
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
1
Q

Anticipating misuse

A
  • division by zero
  • communication error
  • printer and other peripheral errors
  • disk errors
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Authentication

A

A way to confirm a user identity usually by usernames and passwords

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Ways to maintain program

A
  • comments
  • white space
  • indentation
  • descriptive variable names
  • functions
  • constants at top of program
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Comments use

A
  • explain program
  • explain section of code
  • visually divide sections of program
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

White space use

A
  • makes sections of program easier to see
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Indentation use

A
  • for every selection and iteration
    branch
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What are the 2 types of testing

A
  • iterative testing
  • terminal testing
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

types of data tests

A
  • normal inputs
  • boundary input
  • invalid input
  • erroneous input
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q
A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly