2.3 Defensive Design and Testin Flashcards

OCR GCSE Computer Science J277

1
Q

Data type check

A

Checks that the value entered is of the required data type
An age has been input as an integer, e.g. 21

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

Range check

A

Checks that the data is between an upper limit and a lower limit
A probability is between 0 and 1

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

Limit check

A

Used to check either the upper limit or the lower limit
The price of an item is not below the lower limit of 0.00

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

Length check

A

Checks that a specific number of characters or digits has been entered
A passport number is exactly 9 digits long

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

Format check

A

Used to check that the data is in a specified format. Regular expressions can be useful here to match a string against a pattern.
A date is in the format DD/MM/YYYY

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

Presence check

A

Checks that something has been entered into a field and the field has not been left blank
A ‘City’ field has not been left blank when a user is entering an address

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

Existence check

A

Used to check that a piece of data or the name of a file actually exists
The surname “Lau” exists in a customer record. The file name “highscores.csv” exists during file handling

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

Consistency check

A

Checks that pieces of data from two or more fields are compatible with each other
The number entered for the day of the month is not higher than 29 if the month chosen is February

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

Uniqueness check

A

Checks that a value entered is a new and original value
A username has not already been chosen when a user is creating a new account

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

Check digit

A

A digit that helps confirm that a code is correct
The last digit of a barcode is calculated from all of the numbers before it

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

Data Type

A

E.g. string, integer, character, float, Boolean. An attribute of a data item that determines the values that can be stored and the operations that can be carried out on the data item.

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

Casting

A

Changing the data type of a piece of data, for example converting a string to an integer

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

String

A

A sequence of characters, e.g. letters, numbers, spaces and other symbols

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

Integer

A

A whole number that is either positive or negative. Examples: 5, 14, -29

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

Float

A

A data type for a number with a decimal place. Stored as a floating point number.

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

Function

A

A named block of code that performs a task and returns one or more values

16
Q

Syntax

A

The precise way that program statements must be written to be understood by the computer. It is specific to the programming language in use.

17
Q

Syntax error

A

When the translator does not recognise the keywords or commands entered. Common errors of this type include mistyping a keyword or missing out brackets.

18
Q

Logic error

A

When code runs correctly but the program does not work as expected or produce the expected output.

19
Q

Runtime error

A

When an error occurs during the use of the program. Common errors of this type include trying to divide by zero or accessing an item in an array that does not exist.

20
Q

Testing

A

The systematic process of checking that a subroutine, program, or system works as expected

21
Q

Test data

A

Data that has been carefully selected for testing. It should include normal, boundary and erroneous values as appropriate

22
Q

Boundary data

A

Test data that is on the limit of the acceptable range of valid data

23
Q

Erroneous data

A

Test data that should be caught by validation and rejected by a system