Testing and Documenting Solutions Flashcards
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
b, c and d.
If you were storing a name what variable type would it be?
String Variable (text)
Name the 3 types of testing data.
Normal, Extreme and Exceptional
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?
Extreme, because it is testing the boundaries.
List examples of normal, extreme and exceptional data for a programme checking scores on a test marked out of 10.
Normal > 3, 7, 6
Extreme > 0, 10
Exceptional > 200, -30, 5.7, hello, 11
Name the 3 types of errors.
Syntax error, Logic error, Execution/Runtime error.
What is a Syntax error?
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 “”.
What is a Logic error?
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.
What is an Execution/Runtime error?
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 can code be made more readable?
Indentation, white space, internal commentary (comments), meaningful varaiable names.
What is internal commentary?
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.
What is indentation?
Indentation is moving text slightly to the right so it is more readable.
What is white space?
This
is white space. Leaving gaps in code up and down the way, like having returns between paragraphs.
What are the differences between meaningful variable names and non meaningful variable names?
Pupil_Name P
Score 2
How would you initialise a variable called “Student_Name” at the start of a LiveCode programme?
Put “” into Student_Name