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...

5 Steps 1 min read Medium

Step-by-Step Guide

  1. 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.
  2. 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.
  3. Step 3: Go through each statement in your code and whenever the value of a variable is changed

  4. Step 4: write the new value underneath the old value in its column.

  5. 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

C

Carol Turner

Professional writer focused on creating easy-to-follow lifestyle tutorials.

62 articles
View all articles

Rate This Guide

--
Loading...
5
0
4
0
3
0
2
0
1
0

How helpful was this guide? Click to rate: