Visualization for Software Engineering: Debugging

    Jim Seymour, March 1, 1998

Debugging compiled programs has traditionally been a complex endeavor. The point of error often must be deduced since the observable symptom may be  many program instruction executions from the point of error.   To make such deductions, the troubleshooter must be able to relate several static and dynamic views of  a  program.  But, given the limitations of human cognition and complexity of the information, it is important to exploit the natural ways people assimilate information. For example, people's brains are "hard-wired" to associated things which are spatially  close. Also, understanding is facilitated by showing different graphical representations of the same information. Unfortunately, traditional debugging tools are text-based and independent, requiring the user to manually associate the state of one tool with that of others. This in not only inconvenient, but it taxes the user's short-term memory. This paper discusses two tools that provide some interesting enhancements to help manage the complexity of debugging:   FIELD (Friendly Integrated Environment for Learning and Development) and ZStep 95. Also discussed is VIPS (Visualization and Interactive Programming Support), which exploits the human's ability to understand changes through animation.

FIELD integrates a number of UNIX development tools into a common environment. Each tool presents a unique view of the program under development; if the program changes, the views change accordingly.  The views can be partitioned into static and dynamic views.  The static views have to do with creation and management of the source code and includes source code  display, symbol cross-reference, and configuration manager. The dynamic views include the call stack, break-point status, and the source-code at the current step position.

In general, information can be assimilated easier by the user if a simple, familiar metaphor can used to represent several views. An example of this is the Annotation Editor tool which serves as both a text editor (static view) and also registers the debug step status (dynamic view). FIELD  also provides  the familiar graph metaphor to represent the relationships between data structures during program execution and  the static relationships between program modules. The affect of this integration is that it enables a user to control and analyze the debugging process from the most appropriate view and the underlying environment keeps the views coherent automatically.   A particularly information-dense view is the FIELD class browser. This tool displays the complex state of a C++ class hierarchy using icons and colors. It has some control for collapsing the hierarchy and hiding/enabling various attributes. As with any complex and concise syntax, it is confusing to look at until the syntax is learned.

ZStep 95 is a reversible, animated source code stepper. ZStep 95 is philosophically similar to FIELD in that static and dynamic views are integrated. But, ZStep 95 has a  more sophisticated display and user interaction capabilities. The most dramatic of these capabilities is the ability to step backward through the program. This  feature significantly increases the ability of the user to deduce the point of error. For example, the program can be stopped at the first sign of trouble, and execution can be backed up until anomalous data is set. Because the complete history of the program execution is saved, the tool offers the user the ability to scroll through the complete history of functions.

ZStep 95 goes future than FIELD at putting information in the user's field of vision. Different views are related intuitively by placing various views of the program physically close to each other. For example, when a breakpoint halts  program execution, the values of the expression holding the  breakpoint is displayed next to the source code along with a graphical display of the program's major data structure. There a number of step modes including the ability to replay back to the point a graphic was drawn by simply selecting the graphic. Because the complete history of the program execution is saved, the tool offers the user the ability to scroll through the complete history of function (variable) values. The user can revert the state of execution associated with one of the values in the history list.

Both FIELD and ZStep 95 demonstrate interesting features for debugging. But, FIELD is the more practical for a  production environment given the current state of technology. In fact, a number of IDEs (Integrated Development Environments) use similar techniques (e.g., Visual C++ and Cafe for Java). The features of ZStep 95 more closer to an  ideal  debugging environment, but is not a production-grade tool. It only targets Lisp 2.0 and the authors claim adapting to C would be challenging.

A feature of both Field and ZStep 95 is the dynamic view of a program's data structures. Related work in this area is VIPS (Visualization and Interactive Programming Support). Like a number of other systems, VIPS  dynamically displays linked lists as the program executes,  but VIPS has an additional feature of animation, rather than instantaneous re-arrangement. The  graph  changes shape such that the user can easily comprehend how the linked list has been modified. This exploits the feature of human perception that is tuned change recognition through physical movement. As one would expect, VIPS has facilities for managing scale by enabling the user to magnify areas of a collapsed list, etc.