Producing Robust Programs Flashcards

1
Q

What is the purpose of defensive design?

A

To ensure that a program runs correctly and continues to run no matter what actions a user takes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

State 4 methods of creating a defensive design

A
  • Validation
  • Authentication
  • Maintenance
  • Testing
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is data sanitisation?

A

Hiding or protecting data so it cannot be seen or disclosed

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is validation?

A

The process of ensuring an input is possible and sensible

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Give 5 examples of checks that can be done to validate an input

A
  • Range check
  • Presence check
  • Length check
  • Format check
  • Type check
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is a range check?

A

A check that ensures an input is within a specified range

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is a presence check?

A

A check to see if anything was inputted

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is a length check?

A

A check that ensures an input isn’t too long or short

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is a format check?

A

A check to ensure the input is in the right format

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is a type check?

A

A check to ensure the input is in the specified data type

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is authentication?

A

The process of ensuring a person is who they say they are

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Name 3 ways of authenticating a user

A
  • Usernames & passwords
  • Biometrics
  • PIN number
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Name 4 ways of making a program maintainable

A

Using:

  • Comments
  • Naming conventions
  • Indentation
  • Using subprograms
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What are the two types of subprogram?

A
  • Functions
  • Procedures
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What is the difference between a function and a procedure?

A

Functions return a value, procedures do not

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What is the purpose of testing?

A

To ensure the program runs as intended by removing all syntax and logic error

17
Q

What are the two types of testing?

A
  • Iterative testing
  • Final testing
18
Q

What is another name for final testing?

A

Terminal testing

19
Q

When is iterative testing done?

A

When a program is being developed

20
Q

When is final testing done?

A

When a program is complete

21
Q

How does iterative testing work?

A
  • After a module of code is written it is tested
  • The code will then be edited
  • This process repeats until the module works as intended
22
Q

What is final testing?

A

When the entire program is tested to see if it works as intended

23
Q

What are the 4 different data types used in testing?

A
  • Normal data
  • Boundary data
  • Invalid data
  • Erroneous data
24
Q

What is normal test data?

A

Data which should be accepted by the program without causing errors

25
Q

What is boundary data?

A

Data of the correct type which is on the very edge of being valid

26
Q

What is invalid test data?

A

Data of the correct type which should be rejected by a computer system

27
Q

What is erroneous data?

A

Data of the incorrect type which should be rejected by a computer system

28
Q

How can you record testing?

A

With a test table

29
Q

What columns should be on a test table?

A
  • Test number
  • Description of what is being tested
  • Test data being used
  • Type of test data
  • Expected result
  • Actual result