A Tool for Visual Understanding of Source Code Dependencies - Embedded.com

A Tool for Visual Understanding of Source Code Dependencies

Program comprehension is a necessary step in achieving objectives, such as fixing errors, changing or adding fea tures, or improving code and design. Program comprehension is a major cost factor in developing and maintaining software systems.

Vendors of integrated development environments ( e.g.,, Eclipse and Microsoft Visual Studio ), have built in search functionality, class and call hierarchy browsing, cross-reference browsing, etc. which help in basic program comprehension tasks.However, they lack adequate visual support for more advanced program comprehension tasks. Providing such support has been a key objective of research and tool vendors.

Several approaches and tools have been developed, for example, Rigi, Creole, CodeCrawler, or Imagix-4D. Most of these tools use graph-based visualizations where nodes represent source code entities, such as packages, classes, methods, and fields. Edges denote dependency relationships between them, such as class inheri- tance/subtyping, method calls, and field accesses.

Typically, these tools follow the extract-abstract-view metaphor. They first load all the information into the graph which then is queried, filtered, and edited by the user. For instance, Creole starts with an overview-graph on the package level whose package nodes can then be expanded to analyze source code details. While this approach is useful for getting an overview of the implementation, it has the problem that graphs get cluttered with irrelevant details.

In this paper we focus on Java source code and present DA4Java (Dependency Analyzer for Java), a graph-based visualization approach for understanding static dependencies between source code entities.

The main objective of DA4Java is to reduce the cognitive effort to understand dependency graphs. Large dependency graphs with many nodes and edges that overlap each other are usually not aesthetic and require more effort to understand. Our approach supports the creation of condensed, aesthetic graphs by showing only the information relevant to solve a given program comprehension task.

For this, DA4Java uses nested graphs and a set of features to add and filter nodes and edges. The adding features allow the user to incremen- tally compose the dependency graph. For instance, the ’Add callers’ feature adds methods that call a selected entity and only the corresponding method calls to the graph. Features for filtering are used to remove irrelevant information and stay focussed on the program comprehension task.

We demonstrate these features of DA4Java with a number of examples from the source code of the Eclipse JDT Debug plug-in. The examples show, that our approach allows the user to create condensed views on Java source code. They enable the understanding of the big picture by hiding details and the understanding of details by hiding the irrelevant parts of the system.

To read this external content in full, download the complete paper from the author online archives at the Alpen-Adria-University, Klagenfurt, Germany.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.