09-07-2012, 11:51 AM
Java Architecture for Bytecode Analysis (JABA)
Java Architecture.pdf (Size: 434.24 KB / Downloads: 87)
Introduction
The Java Architecture for Bytecode Analysis (JABA) of the Aristotle Research
Group at Georgia Tech provides static analysis of Java programs.
Besides others, JABA uses algorithms that determine inter-procedural control
flow caused by exceptions [3]. This means that JABA determines for
each throw statement of the program the methods visited on the way to
the finally statement or catch statement deactivating the thrown exception.
Note that for a given pair of throw catch statements there may be multiple
control flow paths through a program.
This Mini Project provides a general mechanism to visualize such interprocedural
control flow information, for example provided by JABA’s static
analysis. The mechanism is general in the sense that also other data sources
like the result of a dynamic analysis could be used.
Motivation
Let’s assume that most Java programmers, testers, and maintainers do not
leverage static or dynamic analysis tools to explore inter-procedural control
flow caused by exceptions. These people use their integrated development
environment to understand this control flow. First, they might statically
analyze their source code by browsing it, searching for corresponding throw
and catch constructs. Second, they might also dynamically analyze their
source code by watching a debugger execute it. Related to this, one can
E-mail: csallner[at]cc.gatech.edu
always analyze a program’s stack trace in case program execution is terminated
by an uncaught exception.
Static analysis tools like JABA can automatically discover inter-procedural
control flow caused by exceptions. Yet to become useful for a Java programmer,
tester, or maintainer, the result of such an analysis should be
presented compactly to the user. For example a textual representation of
inter-procedural control flow in the form of “method a of class b throws exceptions
of type e to be caught by method y of class z” could produce many
pages of text. A visualization system could support a user to understand
inter-procedural control flow.
Walker et al. have presented a system to visualize inter-procedural control
flow information gathered through dynamic analysis [4]. They have also
presented an algorithm to abstract from paths between low level code entities
to higher level architectural entities. In contrast to our visualization
mechanism though they do not take advantage of a space-filling visualization
technique like a treemap and therefore waste screen real estate. Screen
real estate is a scarce resource when visualizing programs of growing size.
Looking at other domains of information visualization, we are not aware
of any visualization system that combines a space filling visualization technique
with graph visualization. While scarce screen real estate motivates
a space filling technique, we need graph visualization to map control flow
information to screen.
The goal of this mini-project is to develop a mechanism for visualizing
a program’s inter-procedural control flow information. This mechanism
should be general so that it can later be used in specialized tools to support
programmers, testers, and maintainers.
Plan
Gammatella has been developed by the Aristotle Research Group at Georgia
Tech [1]. Besides others, it uses a treemap to visualize Java programs.
Figure 1 shows an example treemap.
A treemap is a space-filling visualization technique [2]. It recursively
maps a tree data structure to screen. The root node is mapped to the
entire space to be filled. Child nodes are then placed inside their parent
node, completely filling its space. In Gammatella, the treemap’s root node
represents the Java program’s root package. A direct child node is either a
direct Java sub-package or a Java class in that package. Each Java class is
a leaf node of the treemap tree.
Program visualization with Gammatella using a treemap. The
visualized program fragment resides in package jaba. It consists of two subpackages
jaba.sym and jaba.main. Package jaba.sym is expanded to show
its classes, for example jaba.sym.Method.
Our project plan consists of the following steps. First, play with Gammatella
to find out how it visualizes a Java program. Second, parse the
inter-procedural control flow information produced by JABA. Third, extend
Gammatella from the Java class level to the methods of a class. Then
each method will be a leaf node of Gammatella’s treemap tree. Fourth, implement
a prototype mechanism of displaying the exception control flow as
a graph on top of the treemap.
Results
We have both extended Gammatella to the method level and implemented
a general mechanism for drawing a graph on top of Gammatella’s treemap.
Figure 2 gives an example, in which exception propagation paths between
one pair of throw and catch blocks is drawn on top of a program visualization.
Discussion
Due to the early stage of development it remains unclear how useful the
implemented mechanism will be in practice. To answer this question one
needs to evaluate alternative interaction techniques based on our mechanism.