How to Hand Trace Through Software Code
Divide a sheet of paper into columns., Write the starting value of each variable as the first item in its column., Go through each statement in your code and whenever the value of a variable is changed, write the new value underneath the old value...
Step-by-Step Guide
-
Step 1: Divide a sheet of paper into columns.
Each column is a variable the code you are tracing through will use.
Write the name of the variable at the top of each column. -
Step 2: Write the starting value of each variable as the first item in its column.
Don't write a value if the variable isn't initialized right away. , Hopefully, this will help you see what is wrong with your program. , Test the code, and if it still contains the bug, retrace through the code if nothing else works. -
Step 3: Go through each statement in your code and whenever the value of a variable is changed
-
Step 4: write the new value underneath the old value in its column.
-
Step 5: Fix your program's problem and recompile the code.
Detailed Guide
Each column is a variable the code you are tracing through will use.
Write the name of the variable at the top of each column.
Don't write a value if the variable isn't initialized right away. , Hopefully, this will help you see what is wrong with your program. , Test the code, and if it still contains the bug, retrace through the code if nothing else works.
About the Author
Carol Turner
Professional writer focused on creating easy-to-follow lifestyle tutorials.
Rate This Guide
How helpful was this guide? Click to rate: