Software DD (Testing) Flashcards
Types of testing, Types of errors, Debugging
Normal Data
Data that the program should be expected to use in normal operation
(accepted)
From RGC Aberdeen website
Extreme Data
Data at the edge of what is acceptable, such as high and low limits or boundaries
(accepted)
From RGC Aberdeen website
Exceptional Data
This is invalid data. Robust programs should reject this
(not accepted)
From RGC Aberdeen website
Syntax error
These are mistakes in the programming ‘grammar’ e.g. Forgetting to put a semi colon or close a bracket.
Programs will fail translation so won’t run
From RGC Aberdeen website
Execution error
These are errors detected during run-time. Divide by zero etc.
Programs will usually fail during runtime
From RGC Aberdeen website
Logic error
These are errors in the design of the program
Passing the wrong data into a function
Programs will usually fail during runtime or produce incorrect output.
From RGC Aberdeen website
4 main Debugging Techniques
- Dry Runs
- Trace Tables/Tools
- Breakpoints
- Watchpoints
From RGC Aberdeen website
Dry Run
A dry run is when you manually stepping through the lines of code without the need for executing the program. Can be useful for logic errors.
A dry run may also be used in conjunction with a trace table.
From RGC Aberdeen website
Trace Table
When you create a trace table you list the variables and then populate it as you work through the algorithm or after each iteration through a loop e.g.
From RGC Aberdeen website
Breakpoints
You set breakpoints to stop execution of the code at specific lines of code. At this point the contents of variables can be examined.
This can be a method to ascertain if a piece of code is actually being executed, obviously useful for debugging conditional statements. As you can check if the variables match the conditions you think they do.
From RGC Aberdeen website
Watchpoints
Watchpoints are similar to breakpoints but they are assigned to variables. They then stop the execution of the program when a variable changes or when the contents of a specific variable(s) or expression meets a particular condition. This can be at any point in the execution of the code.
This can be useful for example if file import is failing at record 1200/2000 you could stop the program when the counter variable is equal to 1199 so that you can examine variable contents at that point.
Or you may want to halt the program only when a variable changes.
From RGC Aberdeen website