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:xycounter
83
92
100
1217
1312
141
1299
1370
142

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:

https://www.bbc.co.uk/bitesize/guides/zg4j7ty/test