Presentation is loading. Please wait.

Presentation is loading. Please wait.

Tracing What, How, and Why Copyright © Curt Hill, 2004-2006.

Similar presentations


Presentation on theme: "Tracing What, How, and Why Copyright © Curt Hill, 2004-2006."— Presentation transcript:

1 Tracing What, How, and Why Copyright © Curt Hill,

2 What? Tracing is the simulation of a computer program or part of a computer program We “play computer” The results should be the same as if the program were executed on a real machine The simulation needs to cover every relevant aspect of the computation Copyright © Curt Hill,

3 Elbonian Computers Copyright © Curt Hill,

4 Why? Essential debugging tool Important learning technique
A correct trace demonstrates that you understand the fundamentals We will have tracing exercises in class and on tests Copyright © Curt Hill,

5 How? Find the first statement to be executed
Write down all the variables Used to record their current value As new variables are encountered they may be added to the list For each statement that is encountered: Determine its action Record changes to any variables Show the final values when execution is complete Copyright © Curt Hill,

6 An example Java Console C++ Java Window
Copyright © Curt Hill,

7 Right and Wrong There is a right way and a wrong way to do tracing
The right way is this The wrong way is to attempt to analyze this algebraically That approach does not allow for a change in variables Copyright © Curt Hill,


Download ppt "Tracing What, How, and Why Copyright © Curt Hill, 2004-2006."

Similar presentations


Ads by Google