IMMV: An Interactive Multi-Matrix Visualization
for Program Comprehension
Ala Abuthawabeh and Dirk Zeckzer
TU Kaiserslautern, Germany
Email: {abuthawa, zeckzer}@informatik.uni-kl.de
Abstract—Many visualization techniques are used by software
engineers to understand and to analyze the static structure of
software systems, with the static structure being extracted from
the source code. However, the need for scalable visualizations,
which take into account the increasing number of code entities
(classes and interfaces) and different types of code couplings (relations between them) in software systems, is still not sufficiently
fulfilled. In this paper, we extend the design of an existing multimatrix visualization approach to represent the static structure of
software systems in a scalable way. First, we extended the data
model and the algorithms. Second, we added more visualization
and interaction elements. Finally, we incorporated the folding
(collapsing) and the unfolding (expanding) of the package hierarchy, which have quadratic time complexity and quadratic space
complexity in the number of nodes. This extended approach can
be applied to support program comprehension and to analyze
the static structure of software systems.
I. I NTRODUCTION AND R ELATED W ORK
Analyzing the static structure of software systems is important for understanding the relationship between the different
entities, especially for legacy systems. The entities of these
systems—classes and interfaces—have many different types
of relations (code couplings). Therefore, discerning multiple
types of edges is important for analyzing the graph having the
entities as nodes and the relations as edges.
Many recent studies have addressed analyzing these multiple types of edges using different visualization approaches [1],
[2], [3], [4], [5], [6]. As a result of the increasing number of
entities and the relations between them in software systems,
scalability is a big challenge in software visualization. The
multi-matrix visualization (MMV) approach [4] shows a high
scalability capability in using the available screen space. It
visualizes the classes and interfaces of the software system
and the relations between them using an adjacency matrix
representation of the underlying graph. In MMV [4], relations
such as inheritance, aggregation, implementation, method call,
parameter, return-Type, and throws between classes, or classes
and interfaces were considered. We decided to base our
approach on MMV [4] because of its scalability in visually
discerning edges having different types in graphs.
The goal of this paper is to extend the MMV approach [4]
by adding more visualization and interaction elements:
• Show the package structure using icicle plots [7], [8]
(Section II-B)
• Allow folding and unfolding of package hierarchies [9]
(Section II-C)
,(((
Add relation summaries, labels, tool tips, a color legend,
and highlighting (Section II-B)
Figure 1 shows the JHotDraw system [10] structure using the
extended multi-matrix visualization.
•
II. T HE IMMV
The Multi-Matrix Visualization [4] supports analyzing
graphs [11], p.2 with multiple relations (edges) of different
types (maximal one edge per type) between vertices in the
domain of software engineering. Let c be the constant number
of distinct edge types. An example is a software system,
where the vertices are the classes and the interfaces of a
system and the relations (code couplings) are, e.g., inheritance,
aggregation, implementation, method call, parameter, returntype, and throws. Every cell of the matrix is divided into
sub-cells, each sub-cell representing a different edge type.
A colored sub-cell appears in the matrix if an edge of the
respective type from the vertex in the current row to the vertex
in the current column exits. To be able to distinguish the types
more clearly, a different color is used for each type.
Definition 1. Let T the tree associated with a graph G such
that the leaves of T are the vertices V of G. A “level” in the
tree contains all elements of the tree having the same depth
(distance to the root) in the tree. Let d be the maximal depth
of a vertex in the tree.
As shown in Figure 1, the MMV approach [4] was extended
by adding more visualization and interaction elements. In
Section II-A, MMV’s data model and algorithm extensions
are described briefly. In Section II-B, the matrix visualization
is combined with icicle plots and the mapping from the
package structure to the icicle plots is shown. In addition, the
proposed visualization is supported by using levels in icicle
plots, relation summaries, labels, tool tips, a color legend, and
highlighting. After that, Section II-C describes the folding and
the unfolding of hierarchies.
A. Data model and algorithm
The implementation of MMV [4] was modified to include
icicle plots and to extend the interaction of the current visualization. The environment of the implementation consists of
Windows 7, Java 6, and Eclipse SDK 3.6.2. The original data
structure was simplified by combining classes, and a GraphML
data importer and two preprocessing steps were added:
Fig. 1. IMMV showing code couplings from the JHotDraw software system [10]. The magnified cell in the matrix shows four different types of code
couplings between the source class/interface in the current row and the destination class/interface in the current column; blue: usage couplings; red: code
clone couplings; green: semantic couplings; brown: aggregation couplings.
1) Importing GraphML files: A new importer was added for
reading and parsing GraphML [12] files and for inspecting its
attributes.
2) Path Compression: Path compression was used to enhance the icicle plot. It compresses those inner vertices (vertices between the root and the leafs), which have only one
child, to get more compact icicle plots.
3) Bipartite Graph: The original graph is transformed
into a bipartite graph [11], p.11 by duplicating the vertices of the graph to identify the source and the destination
classes/interfaces for each edge. The purpose of this transformation is to be able to fold and unfold the source and
destination packages separately.
B. Visualization and Interaction
Figure 1 shows the new visualization and the new interface.
Code-couplings from JHotDraw [10] were extracted and are
shown in Figure 1. The matrix main diagonal is highlighted
with gray. The annotations in Figure 1 indicate the related
features:
1) Icicle plot representing the hierarchy: Two icicle plots
are attached to the left (source) and the top (destination) of
the matrix visualization to display the package hierarchies of
the software system. The root and each inner cell of the icicle
plot represent a package, while the leaf cells represent classes
and interfaces, or folded packages.
2) Levels in Icicle Plots: Each level in the top and in the
left icicle plot is represented with a white square in the upper
left corner of the view.
3) Relation summaries: Relation summaries were added to
the icicle plots to provide an overview of relations. The relation
summaries of the rows are placed inside the leaf cells of the
left icicle plot, while the relation summaries of the columns
are placed inside the leaf cells of the top icicle plot. The cells
representing the packages contain relation summaries of their
children.
4) Labels: Inside the icicle plots, cells have labels, if
enough screen space is available.
5) Tool Tips: In case we have a large tree, the names of
packages, classes, and interfaces might be too large to fit the
width of its cell. Therefore, tool tips were added to show these
names when a user moves the mouse over its respective cell
in the icicle plot.
6) Enhanced Color Legend: The color legend is used to
show the color mapping of the code couplings and their
positions inside the matrix cells. The default color mapping
assigns bright colors to the corner subcells and dark colors to
the other subcells.
7) Highlighting folded packages: Highlighting was added
to a folded package to distinguish it from other packages in
the icicle plot. All sides of the folded package cell are painted
with red color in both top and left icicle plots to highlight a
folded package (if they were folded together). In the matrix,
the background color of the folded package column and row
are highlighted with gray.
8) Highlighting selected rows, columns, and cells: Scanning selected rows, columns and cells can be performed
easily using highlighting. A row in the matrix visualization
is highlighted, if a class/interface or a package in the left
icicle plot is selected. All sides of the selected cell of a
class/interface or a package in the left icicle plot and the row
in the matrix visualization are painted with black. A column in
the matrix visualization is highlighted analogously. Both row
and column are highlighted with a black border, if a cell in
the matrix visualization is selected.
Application examples of the tool can be found in [13].
C. Folding and unfolding hierarchies
Folding and unfolding allow an efficient exploration of
the dataset [9]. Thus, the granularity of the analysis can be
determined interactively. Further, it allows to analyse larger
datasets increasing the scalability. Folding and unfolding of
(the package) hierarchies were added to the multi-matrix
visualization. Figure 2 shows the basic idea of folding and
unfolding operations. If package 1 is folded by mouse double
clicking on its respective cell in the icicle plot, the relations between the classes/interfaces of the source and the
destination package will be combined. The original vertices
(classes/interfaces) and edges (relations) are removed from
the graph and new vertices representing the packages and the
combined edges (relations) are added to the graph. Eventually,
the new matrix and icicle plots are shown. The folding can be
performed for the source package only, the destination package
only, or for both the source and the destination package.
When a package is unfolded, either the previous state is
reconstructed or the level below the unfolded package (its
child packages) will be unfolded. In the latter case, the (child)
packages will be folded, if they were unfolded.
Unfolded packages are represented by a white square in
the upper left corner of the view, while folded packages
are represented by a black square. To fold/unfold a level in
the icicle plot, the corresponding white/black square can be
selected by mouse double clicking.
The folding and unfolding algorithms are described next.
1) Folding source - destination package: For folding and
unfolding, the children of the selected vertex of the tree
(package) have to be considered. We define:
Definition 2. Sub-package: any package vertex, which is
contained inside the subtree of a package.
Definition 3. Sub-leaf: any leaf vertex, which is contained
inside the subtree of a package.
Definition 4. Last folded sub-package vertex: any folded subpackage vertex that has no folded predecessor (that is, there
Fig. 2. Folding and unfolding hierarchies in icicle plots and matrix visualization (top). Folding combines relations between software entities of the source
and the destination package, while unfolding retrieves the previous relations.
The image at the bottom shows the vertex-link representation.
is no other folded sub-package vertex having this folded subpackage vertex in its subtree).
To fold a destination package in the top icicle plot separately, the folding algorithm (Algorithm 1) is performed.
The current package is marked as folded. Then (Line 2), a
new vertex is added to the graph for representing the folded
package. After that (Line 3), all the sub-leaf vertices that
have no folded predecessor and all the last folded sub-package
vertices are extracted. Line 5 calls the algorithm for handling
incoming edges for all extracted leaf vertices and all last folded
package vertices. After that (Line 6), the incoming lists of all
extracted leaf vertices and last folded package vertices are
cleared. At the end (Line 7), all extracted leaf vertices and
last folded package vertices are removed from the graph.
Algorithm 1 Folding Algorithm
1: Change the fold flag of the current package to true
2: Add a new vertex to the graph for representing the folded
package
3: Extract all the sub-leaf vertices that have no folded predecessor and extract all the last folded sub-package vertices
4: for all Extracted leaf vertices and last folded package
vertices do
5:
Call Incoming(vertex)
6:
Clear Incoming list of vertex
7:
Remove the vertex from the graph
8: end for
The algorithm handling incoming edges for each extracted
leaf vertex and each last folded package vertex (Line 5)
aggregates all incoming edges of the vertex into the new
incoming folded edges of the folded package and explicitly
removes them from the graph.
TABLE I
C OMPLEXITY ANALYSIS OF THE FOLDING AND UNFOLDING ALGORITHMS .
n: NUMBER OF NODES, e: NUMBER OF EDGES, d: DEPTH OF
THE HIERARCHY TREE, AND c: NUMBER OF DISTINCT EDGE
TYPES ( CONSTANT )
Algorithm
Folding algorithm
Unfolding algorithm
Time complexity
O(d · c · n2 )
O(d2 · c · n2 + d · e)
Space complexity
O(c · n2 )
O(c · n2 + e)
Folding a source package in the left icicle plot works analogously to the folding a destination package (Algorithm 1).
Both source and destination packages can also be folded
simultaneously.
2) Unfolding source - destination package: We only describe the unfolding of one level. In this case, the level below
the selected package is shown. Unfolding to the previous state
is also possible.
The unfolding algorithm (Algorithm 2) is used to unfold a
destination package in the top icicle plot for only one level.
Unfolding for one level means that all the children of the
unfolded package will be folded, if they are package vertices.
Line 1 marks the current package as unfolded package. Then,
lines 2-6 mark the children of the unfolded package as folded
packages, if the child is a package. Line 7 calls the unfolding
incoming algorithm. At the end (Line 8), the unfolded package
vertex is removed from the graph.
Algorithm 2 Unfolding Algorithm
1: Change the fold flag of the unfolded package to false
2: for all Children of the unfolded package do
3:
if The child is package then
4:
Change the fold flag of the child to true
5:
end if
6: end for
7: Call UnFoldIncoming(package)
8: Remove the unfolded package vertex from the graph
Calling the unfolding incoming algorithm (Line 7) implies
the following steps. First, all edges that are stored inside all the
folded incoming edges of the unfolded package are retrieved.
After that, the retrieved edges are directly used, if the end
vertex is a direct child of the unfolded package. Otherwise, the
edge is aggregated similar to folding the direct child package.
Unfolding a source package in the left icicle plot works
analogously to unfolding a destination package (Algorithm 2).
Further, source and destination packages can be unfolded
simultaneously.
3) Complexity Analysis: The time complexity and the space
complexity of the folding and the unfolding algorithms are
given in Table I. They are dominated by Incoming (folding)
and UnFoldIncoming (unfolding) algorithms. As the depth of
the package hierarchy is normally low, the time and the space
complexity is quadratic in the number of vertices n.
III. C ONCLUSION
In this paper, the MMV approach [4] visualizing the static
structure of software systems was extended to facilitate the
analysis of the static structure of software systems. Icicle
plots were added on the top side and on the left side of
the matrix visualization to represent the hierarchy of the
package structure. Relation summaries, labels, tool tips, a color
legend, and highlighting provide additional information about
the visual elements in the IMMV. Interaction techniques—
especially folding and unfolding of package hierarchies—
ease the analysis of software structures. Future work will
focus on exploring tasks and visual structures in the software
engineering field and improving the design based on empirical
evaluations.
IV. ACKNOWLEDGEMENTS
We would like to thank Fabian Beck and the anonymous
reviewers for their valuable comments on previous versions of
this paper. This research was partially supported by the IRTG
1131 that is funded by the DFG (German Science Foundation)
and by the BMBF (project ViERforES).
R EFERENCES
[1] M. Balzer, A. Noack, O. Deussen, and C. Lewerentz, “Software
landscapes: visualizing the structure of large software systems,” in
Proceedings of the Sixth Joint Eurographics - IEEE TCVG conference on
Visualization, ser. VISSYM’04. Aire-la-Ville, Switzerland, Switzerland:
Eurographics Association, 2004, pp. 261–266.
[2] F. van Ham, “Interactive visualization of large graphs,” Ph.D. dissertation, Technische Universiteit Eindhoven, 2005.
[3] A. J. Pretorius and J. J. van Wijk, “Visual Inspection of Multivariate
Graphs,” Computer Graphics Forum, vol. 27, no. 3, pp. 967–974, 2008.
[4] D. Zeckzer, “Visualizing software entities using a matrix layout,” in
SOFTVIS ’10: Proceedings of the ACM 2010 Symposium on Software
Visualization, 2010, pp. 207–208.
[5] F. Beck, R. Petkov, and S. Diehl, “Visually exploring multi-dimensional
code couplings,” in Visualizing Software for Understanding and Analysis
(VISSOFT), 2011 6th IEEE International Workshop on, Sept. 2011, pp.
1 –8.
[6] U. Erdemir, U. Tekin, and F. Buzluca, “E-quality: A graph based object
oriented software quality visualization tool,” in Visualizing Software for
Understanding and Analysis (VISSOFT), 2011 6th IEEE International
Workshop on, Sept. 2011, pp. 1 –8.
[7] T. Barlow and P. Neville, “A Comparison of 2-D Visualizations of
Hierarchies,” in Proceedings of the IEEE Symposium on Information
Visualization 2001 (INFOVIS’01).
Washington, DC, USA: IEEE
Computer Society, 2001, pp. 131–138.
[8] F. Beck and S. Diehl, “Visual Comparison of Software Architectures,”
in SOFTVIS ’10: Proceedings of the ACM 2010 Symposium on Software
Visualization. ACM, 2010, pp. 183–192.
[9] N. Elmqvist and J.-D. Fekete, “Hierarchical Aggregation for Information
Visualization: Overview, Techniques, and Design Guidelines,” IEEE
Transactions on Visualization and Computer Graphics, vol. 16, pp. 439–
454, 2010.
[10] IFA Informatik and Erich Gamma, “JHotDraw,” 1996, 1997, http://www.
jhotdraw.org/; Online; accessed 12-December-2012.
[11] J. Gross and J. Yellen, Graph Theory & Its Applications, ser. Discrete
Mathematics And Its Applications. Crc, 1999.
[12] GraphML Working Group, “GraphML,” 2000, http://graphml.
graphdrawing.org/; Online; accessed 12-December-2012.
[13] A. Abuthawabeh, F. Beck, D. Zeckzer, and S. Diehl, “Finding structures
in multi-type code couplings with node-link and matrix visualizations,”
in Proceedings of the first IEEE Working Conference on Software
Visualization 2013 (to appear), ser. VISSOFT 2013. IEEE Computer
Society, 2013.
© Copyright 2026 Paperzz