8.2 Defensive design Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

What is data validation?

A

A routine that ensures that data entered is of the right types - for example an integer

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

Give the different types of validation checks

A

Range check, type check, length check, presence check, format check

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

Range check

A

A number or date is within a sensible/ allowed range

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

Type check

A

Data is of the right type

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

Length check

A

Text entered is not too long or too short

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

Presence check

A

Checks that data has been entered

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

Format check

A

Checks that the format of the input is correct

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

Difference between Validation and verification

A

Validation can only check that data entered is reasonable. Verification is used to double-check that the data has been typed in correctly

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

Authentication routines

A

Authentication routines are used to make sure a person is who they claim to be

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

Why should you maintain programs?

A

To improve code, fix bugs or add new features to the program

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

What can you do with your code to improve maintability?

A

Subprograms, using appropriate naming conventions, indentation and commenting

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

Give examples of subprograms

A

Functions and procesdures

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

What are comments usually written for

A

Parts of a program that are difficult to understand. At the start of a function or procedure to explain what it does

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

When to not use comments

A

Every line of code. To explain parts that are obvious. To explain syntax used in the programming language

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