( 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:
- The user quits the program without entering data.
- The user enters normal data (ensure that all branches of code are tested)
- Data that allows to enter loops
- Different sets of data that allows for conditions in selection statements (if..then..) to be tested when true and false
- Data that test “Divide by zero errors if possible”
- 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
Task/Exercise
Download the files here: https://drive.google.com/drive/folders/1kKuCWbUajYe52ME_obPRSjxbyqxHEprg?usp=sharing
Use the file “Problem Solving and Programming – Demo – 04 Filled Tables” to complete
- 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)
- 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:
© 2021 Vedesh Kungebeharry. All rights reserved.