An algorithm can be expressed by using a flowchart. This is a popular method for designers who can't program but understand how to solve a given problem.
Of course, we need to test that the program (even one represented by a flowchart) works correctly.
We need to test every path through the flowchart.
Again, we will use white box testing, including trace tables.
Let's have a look at a past paper question to see how to follow a flowchart to complete a trace table.
Have a go at completing a trace table for this flowchart and the set of test data below:
| 16 | 13 | -3 | 1 | 5 | 99 | -1 | 30 |