Logo AHome
Logo BIndex
Logo CACM Copy

DoctoralTable of Contents


Visualizing Patterns in the Execution of Object-Oriented Programs

Dean F. Jerding
Graphics, Visualization, and Usability Center
College of Computing
Georgia Institute of Technology
Atlanta, GA 30332-0280
E-mail: dfj@cc.gatech.edu
URL: http://www.cc.gatech.edu/gvu/people/Phd/Dean.Jerding/

Copyright on this material is held by the author(s).

ABSTRACT

The purpose of this research is to assist with the development and maintenance of object-oriented software by visualizing patterns of behavior in program executions. These patterns are manifested as repeated sequences of messages between objects and recurring instantiation of objects. It is hypothesized that interactive visualizations of the dynamic patterns in object-oriented systems will increase program understanding, allowing programmers to better perform design recovery and reengineering tasks.

Keywords

Software visualization, information visualization, object-oriented programming, design patterns

INTRODUCTION

Object-oriented (OO) methodologies provide software developers with a powerful means for designing and implementing applications. Programmers have adopted the object-oriented approach to take advantage of better data abstraction, improved encapsulation and modularity, polymorphism, and code and design reuse. These characteristics can potentially benefit both software development and software maintenance.

However, the object-oriented paradigm is somewhat of a double-edged sword. The powerful features of inheritance, dynamic binding, and polymorphism make object-oriented programs harder to understand and maintain. Functionality is distributed among classes, often through collaborations that may not be implicit in the static code. The behavior of object-oriented systems can only be completely determined at run-time. It is the dynamics of the program, in terms of object interactions, associations, collaborations, or whatever you want to call them that are of first-class importance.

Recent research in the area of program comprehension has identified the important role of program understanding in debugging, testing, maintenance, reuse, and reverse engineering of software. In the object-oriented arena, program understanding typically evolves from an analysis of the relationships or dependencies between objects in the program, often in terms of inheritance, aggregation, and association. Current tools that provide such information do so through textual lists and graphs. Graphical visualization techniques, which have proven useful for depicting information about computer algorithms, multi-dimensional data, networks, etc., have not yet been fully exploited in this area.

This work proposes that visualizing patterns in the dynamic behavior of object-oriented systems can increase program understanding. By analyzing program executions, patterns of interaction can be uncovered. These patterns are manifested as repeated sequences of messages and recurring instantiation of objects. Message patterns will occur when similar semantic operations are performed on the same or different objects, or as a result of iteration. (Recent work in uncovering pattern languages in program design corroborates the existence of these implementation patterns[1].)

Using various filtering and abstraction techniques, the high-level program behavior can be abstracted from the low-level patterns. Interactive visualizations can present this voluminous information much more effectively than textual representations, allowing the user to control the filtering and abstraction of available information. Visualizations of abstract behavior can then be compared with design level information, such as execution scenarios or interaction diagrams. Through the interactive views of the program, understanding may then proceed in a selective top-down manner as high-level behavior is broken down into successively lower-level patterns.

PROPOSED THESIS

This research seeks to support understanding of object-oriented software by visualizing interaction and instantiation patterns in a program's execution. To narrow the focus of the work, two related design recovery and reengineering tasks which require program understanding have been chosen: 1) reverse engineering design level concepts from the current implementation, looking for possible refactorings and optimizations, and 2) comparing existing design or mental model specifications with design-level specifications reverse engineered from the implementation. It should be noted that this work concentrates more on the dynamic aspects of the design, as opposed to the more static aspects of the architecture.

The following list summarizes goals of this research:

Task Benefits

The visualization tools which result from this work will provide a means for reverse engineering design level concepts from an existing implementation, exposing the mapping from design to implementation. This will allow the implementation to be verified with respect to design scenarios, candidates for refactoring and optimization to be identified, dependencies and inter-relationships to be exposed, parts of the design and implementation to be identified as reusable, and the mapping from design to implementation to be explained.

Process

The visualization of interaction and instantiation patterns requires several steps. First, the subject program must be statically analyzed and annotated to allow the tracing of interesting events that occur during its execution. Second, the dynamic events must be generated and stored in a trace file or data structure. Next, the program information must be analyzed. The final stage is the interactive visualization of the program information, to support the user's program understanding tasks.

CURRENT STATUS

Three generations of object-oriented program visualizations have been built thus far. The first prototype was a single animated view which showed the message passing between objects in small, toy programs. The source code of the program was annotated by hand in order to trace interesting events that occur during execution. These events were stored in a trace file which was read by the visualization.

The second generation used multiple views to present various aspects of the program, including inheritance and association relationships between classes, message traffic, and object instantiation[2]. This system was still animated, and while the gathering of the static and dynamic program information was still done by hand, larger programs were used.

In the third generation it was recognized that step-wise animation of program execution is not really required to understand the program's behavior. It is more important to have views that inherently capture the historical nature of the execution by displaying information about the entire execution. To handle real-world sized software systems, this requires a means for displaying large amounts of information in the limited space on the screen.

As one means to accomplish this, a display and navigation technique for large information spaces called the Information Mural has been developed[3]. An Information Mural is a reduced representation of an entire information space that fits entirely within a display window or screen. Intensity, pixel size, and color variation are used along with anti-aliasing techniques to encode the overlap and compression of information as it is scaled into the available space. An Information Mural should convey the same visual patterns as would a view of the entire information space, if one could be created.

Information Murals have been used to display and navigate several different types of information, not only related to software. Murals of sun spot numbers, river flows, and stock market prices show large amounts of data in a small space without discarding information. A Mural of a text file drawn in a scrollbar can be used to display the position of various attributes throughout the entire file. A Mural of an entire data set in a "data slider" gives the observer a feel for the distribution of data visible in the focus area relative to the rest of the data not currently shown on the screen.

Most of the current prototypical views utilize the Information Mural technique. The Execution Mural shows a graphical depiction of the messages sent during the program's execution. A Mural is used to present a global overview of this sequence, which can easily number in the hundreds of thousands. A Pattern Mural view depicts the execution in terms of message patterns rather than individual messages. These patterns are repeated sequences of messages that are automatically identified in the message trace. In order to relate the higher level abstractions found in the views back to the source code, a Code View shows the source code of the system at the class and function level. All of the views are interdependent; interaction with one view can be seen in the others as well.

REFERENCES

  1. Erich Gamma, Richard Helm, Ralph Johnson, and John Vlissides. Design Pattterns: Elements of Reusable Object-Oriented Software. Addison-Wesley, 1995.

  2. Dean F. Jerding and John T. Stasko. Using Visualization to Foster Object-Oriented Program Understanding. Technical Report GIT-GVU-94-33, Georgia Institute of Technology, July 1994.

  3. Dean F. Jerding and John T. Stasko. The Information Mural: A Technique for Displaying and Navigating Large Information Spaces. In Proceedings of the IEEE Visualization `95 Symposium on Information Visualization, pages 43-50, Atlanta, GA, October 1995.