T8 - Errors and testing Flashcards
A syntax error:
-code written doesn’t conform to the rules of the language
cannot be run until fixed
Why do syntax errors display
The compiler doesn’t know how to translate the program into machine code
Logical error:
The program will run, but it won’t work as the programmer intended
A trace table is useful for:
Determining the purpose of an algorithm
Finding the output of an algorithm
Finding errors in an algorithm
To draw a trace table, :
make a column for each variable used, in order
You don’t need to fill in a value for a variable which does not change in a particular row
Codes are tested with:
Normal data
Boundary data
Invalid data
Erroneous data
Normal data:
5 (checks a single digit), 14 (checks two digits)
Boundary data:
1 (checks lowest valid data), 100 (checks highest valid data)
Invalid data:
-50 (checks negative numbers), 173 (checks data of the correct type that is invalid), 0 (checks just below lower boundary), 101 (checks just above upper boundary)
Erroneous data
“ade”, “#$” (checks data of the wrong type
is rejected)
Iterative testing
tests modules and parts of a program as the program is developed
The programmer during iterative testing
the programmer will usually test the code with knowledge of how it works
iterative testing pro
quicker
less hassle to find errors
Final testing
tests the whole program at the end of production
final testing aka
terminal testing