SBA-How to Approach a Dry run using test data and trace tables to uncover errors in your algorithm

( this content is AKA: SBA Guidance – Trace Tables And Dry Runs )

Choosing test data

Generally , we use the following as a guide when generating data for use with trace tables:

  1. The user quits the program without entering data.
  2. The user enters normal data (ensure that all branches of code are tested)
    1. Data that allows to enter loops
    2. Different sets of data that allows for conditions in selection statements (if..then..) to be tested when true and false
  3. Data that test “Divide by zero errors if possible”
  4. Optional: Data that tests for real numbers.  If numbers are to be processed, supply real test data (e.g 1.0 , 99.01) to uncover data type errors


Download the files here:

Use the file “Problem Solving and Programming – Demo – 04 Filled Tables” to complete

  1. Test 3 – (Hint: you may Fill in the table using the provided flowgorithm file as a guide, or you can perform a dry run by hand using the algorithm already documented above the trace tables in the document)
  2. Test 4 – (Hint: after you have created a script of data and perform this test using the trace table, it is likely that you would uncover a divide by 0 error. In this case you would have to modify the algorithm, and perform the test again using a trace table.

See the class video which offers a detailed explanation on the approach:

(Friday 17th May 2021)

© 2021  Vedesh Kungebeharry. All rights reserved. 

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s