Testing and Documenting Solutions Flashcards

1
Q

Which of the following names would be valid in LiveCode? (There may be more than one answer)

a) Student name
b) Studentname
c) Student_name
d) studentname

A

b, c and d.

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

If you were storing a name what variable type would it be?

A

String Variable (text)

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

Name the 3 types of testing data.

A

Normal, Extreme and Exceptional

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

If a programme is checking scores on a test marked out of ten, and a score is entered which is 10, what type of testing data is this?

A

Extreme, because it is testing the boundaries.

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

List examples of normal, extreme and exceptional data for a programme checking scores on a test marked out of 10.

A

Normal > 3, 7, 6
Extreme > 0, 10
Exceptional > 200, -30, 5.7, hello, 11

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

Name the 3 types of errors.

A

Syntax error, Logic error, Execution/Runtime error.

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

What is a Syntax error?

A

Where your code breakes a ‘rule’ of the coding language you are using. For example spelling mistakes of a key word or missing punctutation such as “”.

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

What is a Logic error?

A

This is an error that causes the programme to operate incorrectly, but it will not crash. For example using and AND instead of an OR.

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

What is an Execution/Runtime error?

A

This is an error when the programme is running, for example the user inputting the wrong type of variable, this will either cause the programme to crash or just to operate incorrectly.

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

How can code be made more readable?

A

Indentation, white space, internal commentary (comments), meaningful varaiable names.

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

What is internal commentary?

A

Internal commentary is comments in a code which make the code more readable for both the person who wrote it and others, it also makes it easier to identify where errors are.

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

What is indentation?

A

Indentation is moving text slightly to the right so it is more readable.

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

What is white space?

A

This

is white space. Leaving gaps in code up and down the way, like having returns between paragraphs.

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

What are the differences between meaningful variable names and non meaningful variable names?

A

Pupil_Name P

Score 2

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

How would you initialise a variable called “Student_Name” at the start of a LiveCode programme?

A

Put “” into Student_Name

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

How would you ask and store someones name in LiveCode?

A

ask “Please enter your age.”

put it into Age

17
Q

How would you add a comment in LiveCode?

A

// This is a comment.

18
Q

Why should a programme be tested?

A

So you know there are no errors and the programme works as it should do.