Defensive Design Flashcards

(16 cards)

1
Q

What is the purpose of defensive design?

A

Ensure a program is secure and robust

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

Name the 6 defensive design considerations

A

Anticipating misuse, input sanitisation, validation, verification, authentication, maintainable code

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

What is validation?

A

Process to check that data is reasonable or sensible before it is accepted

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

What is a range check?

A

Checks data is within a certain range

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

What is a type check?

A

Checks data is a certain type

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

What is a format check?

A

Checks data is entered in a certain way

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

What is a presence check?

A

Checks that data has actually been entered and not left blank

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

What is a lookup table?

A

A table of acceptable entries, also known as a list

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

What is a length check?

A

Checks the length of the input is within a certain amount

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

What is maintainability and why should it be used?

A

Programs should be written in a way that makes maintaining and understanding them as straightforward as possible

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

List the 5 ways of keeping maintainability in a program

A

Subprograms (modularisation), appropriate variable names, indentation, comments, constants

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

Modularisation

A

Using subprograms to reuse code and make them easier to test

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

Indentation

A

Improves readability and clearly shows each ‘block’ of code

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

Comments

A

Enable a programmer to understand the purpose of each line of code; it is crucial when working in a team

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

Appropriate variable names

A

Using a naming convention ensures the purpose of a variable is immediately understood

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

Constants

A

Keeps the program code consistent, which makes it easier to read and debug a program