Testing: Methods.
| Created | |
|---|---|
| Tags |
Dry Run:
- This is when the programmer takes a sheet of paper and works through the program line by line and follows the logic. This means that they can identify and root out logic errors.
- They might need to use a trace table in this to store the data in each variable.
A trace table for the following python program might be:
| Line: | x | y | counter |
| 8 | 3 | ||
| 9 | 2 | ||
| 10 | 0 | ||
| 12 | 17 | ||
| 13 | 12 | ||
| 14 | 1 | ||
| 12 | 99 | ||
| 13 | 70 | ||
| 14 | 2 |
And so on. Trace tables keep track of data stored in individual variables.
Breakpoints:
- As the name suggests, they “brake” the program, or they stop it at a specific point (line in the code)
- This means they are able to see the values in the variables (using a trace table or the IDE). Thonny allows you to do this for example.
This can also identify logic errors.
This is a breakpoint. This can check if the y value is updated correctly.
Watchpoints:
Unlike a Breakpoint, a Watchpoint stops when a variable reaches a certain number and concerns the changes in values. For example, stop and check the variables when score reaches 10 in a game.
URLS:


