2.3 Robust Programming Flashcards

1
Q

Defensive Design Considerations

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

Authentication

A

Verifying the identity of a user.

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

Examples of Authentication

A

Username, password or biometrics

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

Anticipating Misuse

A

Designing a program in a way that is resilient to potential misuse.

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

Types of Anticipating Misuse

A
  • Division by 0
  • Communication error
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Validation

A

Checking input data is sensible and in the right format.

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

Types of Input Validation

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
8
Q

Type Check

A

Is the input the correct data type?
E.g. Inputting an integer where it asks for a name.

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

Range Check

A

Is the input within range?
E.g. Inputting 1000 where it asks for age

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

Presence Check

A

Has required data been entered?
E.g. Mandatory questions on google form

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

Format Check

A

Correct format?
E.g. DD/MM/YYYY

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

Length Check

A

Does the input have the correct number of characters?
E.g. 8 character password

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

Advantages of Input Validation

A
  • Make a program more robust
  • More user friendly
  • Prevents further errors later on
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Maintainability

A

The process of ensuring that a program is easy to understand, modify and update.

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

Maintainability Techniques

A
  • Use of subprograms
  • White space
  • Indentation
  • Relevant variable names
  • Comments
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Use of subprograms

A

They give the code structure and make the purpose of the code clear.

17
Q

White space

A

Separates sections of code to make them visually clearer.

18
Q

Indentation

A

Makes it clear which lines of code are part of iteration statements.

19
Q

Relevant variable names

A

Appropriate variable names mean that understanding the purpose of the variable will be easier.

20
Q

Comments

A

Provide information about what the different parts of the program do.

21
Q

Purpose of Testing

A

To remove bugs and to ensure that the program functions as intended.

22
Q

Types of Testing

A
  • Iterative testing
  • Terminal testing
23
Q

Iterative Testing

A

Carried out while a program is being developed. The programmer writes a section of code (module) then tests it.

24
Q

Terminal / Final Testing

A

Carried out after all the modules are complete to ensure the code functions as it should.

25
Q

Syntax Error

A

Errors which break the grammatical rules of the programming language and stop it from being run.

26
Q

Logic Error

A

Errors which produce unexpected output.

27
Q

Normal Test Data

A

Sensible, possible data that a program should accept and be able to process.

28
Q

Boundary Test Data

A

Valid data that falls at the boundary of any possible ranges.

29
Q

Erroneous Test Data

A

Data that a program cannot process and should not accept.