Visualizing Code Execution

The Java CallGraph class offers a small set of methods for augmenting Java code so that various forms of call graphs can be generated by utilizing the GraphViz system.

Based purely on anecdotal evidence from using these call graphs during teaching, this way of visualizing complex function calls (often involving recursion) is of great help to new programmers. The ability to fine-tune the types of information shown (calls, returns, and comments), and the amount of information in each node, makes the CallGraph class a useful tool.

The paper included here describes the class using the Fibonacci function as an example. There are also brief discussions of applying CallGraph to the n-queens problem and mergesort.

The zipped file contains the source and many more examples.

Downloads