2.2 Producing Robust Programs Flashcards

1
Q

What is a check digit?

A

he last one or two digits in a code are used to check the other digits are correct

E.g. bar code readers in supermarkets use check digits.

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

What is a format check?

A

Checks that the data is the correct format.

E.g. National Insurance Number in the form LL 99 99 99 L where L is any letter and 9 is any number.

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

What is a length check?

A

Checks that the data isn’t too short or too long.

E.g. a password needs to be more than 8 characters.

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

What is a lookup table?

A

Looks up acceptable values in a table.

E.g. there are only 7 possible days of the week.

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

What is a presence check?

A

Checks that data has been entered into a field.

E.g. in most databases, a key field card can’t be left blank.

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

What is a range check?

A

Checks that a value falls within a specific range.

E.g. number of hours worked (h):
0 < h < 50

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

What is a spell check?

A

Looks up words in a dictionary.

E.g. Microsoft Word underlines incorrectly spelled words in red.

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

Define authentication

A

A coding method to check that a user is who they say they are and allowed to accesses the program.

The program checks a huge table and reports back to see if the information matches up, if it does then the access is granted

E.g.biometrics, key cards or email.

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

Define input sanitisation

A

Ensures that the input is correct and contains only the permitted characters letters and symbols.

E.g. Dave not Dav%e so the % would be removed.

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

Define maintainability

A

If a program is to be defensive against attacks, then it has to be maintained and up to date.

Informs the reader of a bug or issues.
Explains the code and its function in more detail.
Stop a line of section of code from executing.

E.g. comments and indentation/spacing.

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

Define misuse

A

Maybe in the form of a brute force attack on the program.

Unauthorised acts with intent to impair the operation of the computer.

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

Define iterative testing

A

Testing the code as you create it.

E.g. line by line or a section at a time.

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

Define final testing

A

Carried out at the end of the program when it has been written.

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

Define syntax errors

A

Mistakes in the formatting (the way in which the code is written).

E.g. SPAG mistakes or unneeded capital letters.

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

Define logic errors

A

A bug in a program that causes it to operate incorrectly, but not to terminate or crash (not as intended).

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

Define validation

A

A check made by a computer to ensure that the data entered is sensible or reasonable and within certain limits and rules.

17
Q

What should you consider in defensive design?

A

When data is entered into a program, it’s important that it’s valid, in order for the program to work correctly.

18
Q

When are runtime errors detected?

A

Errors which may cause program errors or the computer to crash, even if there appears to be nothing wrong with the program.

E.g. running out of memory.