Professional Documents
Culture Documents
FSC1331/FDN1120
Topic 11 : Testing and Debugging
17/01/2016 1
10/06/2015 4
11.1 Program Errors
17/01/2016 2
11.1 Program Errors
printf(“Hello”)
*Missing semicolon
17/01/2016 3
11.1 Program Errors
*Wrong output
17/01/2016 4
11.1 Program Errors
Average = Total / 0;
*Infinite result
17/01/2016 5
11.2 Program Testing
17/01/2016 6
11.2 Program Testing
Testing Error?
Yes
Debug
17/01/2016 7
11.3 Debugging
17/01/2016 8
11.3 Debugging
17/01/2016 9
11.3 Debugging
17/01/2016 10
11.3 Debugging
• Debugging techniques
– Incremental testing
– Sanity checks “confirm/validate/accuracy of logic codes
and to continue testing”
– Boolean constants for turning debugging code on or off
“two states/value”
– Error variables for controlling program behaviour after
errors “measure deviation”
– Traceback techniques
17/01/2016 11