<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>Visualization in the Context of Model Driven Engineering</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>R. Ian Bull</string-name>
          <email>irbull@cs.uvic.ca</email>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Jean-Marie Favre</string-name>
          <email>Jean-Marie.Favre@imag.fr</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>LSR-IMAG, University of Grenoble</institution>
          ,
          <country country="FR">France</country>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>University of Victoria</institution>
          ,
          <addr-line>Victoria, BC</addr-line>
          ,
          <country country="CA">Canada</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>Understanding and maintenance of complex information spaces is often supported through visual interfaces. These interfaces must be highly flexible in order to adapt to both the user's role and their current task. Program comprehension tools are one class of tools that make heavy use of information visualization techniques, and Software Engineers use these tools to help understand and maintain software systems. This paper presents a model-driven approach to address the customization requirements of visual user interfaces, and does so in the domain of program comprehension.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>-</title>
      <p>
        The software industry requires visualization tools that can be adapted
to (1) many different sources of information such as source code,
configuration management data, documentation, user requirements,
(2) various kinds of visualizations, including source code views,
tables, trees, tree maps, graphs, nested-graphs, pie-charts,
kiviatdiagrams, and so on, and (3) many different user roles including
not only developers but also architects, software testers, members
of the quality assurance teams, managers, business architects and
so on. Moreover, experience has shown that in order to increase the
likelyhood of adoption among visualization tools, the tools should
not be standalone monolithic applications, but instead they should
integrated in the developer’s preferred development environment.
Few visualization tools support the level of customization required
to create tailored interfaces, and the tools that do support a high
level of customization, do so at the cost of complexity, or like Hy+
[
        <xref ref-type="bibr" rid="ref10 ref6">6, 10</xref>
        ] they are monolithic and can’t be integrated with other tools.
While “coding” is the current way of building visualization tools
this method lacks the ease of customization required. This paper
advocates for the use of Model Driven Engineering to achieve
customizable interfaces by composing small model-driven
visualization components. This paper focuses on the use of metamodels
and transformations to ease the creation of views from arbitrary
models of information. This paper does not address view
composition. While the examples in this paper center around program
comprehension, the techniques can be generalized to any structured
data including knowledge management, business processes,
financial data, etc.
      </p>
      <p>The rest of the paper is structured as follows. Section 2 introduces
the notion of model-driven visualization. A simple example is
presented in Section 3 to illustrate the approach. Section 4 outlines
our future work and finally, Section 5 presents some concluding
remarks.
2.</p>
    </sec>
    <sec id="sec-2">
      <title>MODEL DRIVEN VISUALIZATION</title>
      <p>Model driven engineering is based on the systematic use of
metamodels and transformations. In the context of software
visualization, both the information extracted from the software, and
information about visualization should be formally defined. While most
tools in software engineering are based on implicit metamodels,
it has been recognized recently that information metamodels (also
called schemas) should be expressed formally. Figure 1 describes
a metamodel for a subset of the Java language.</p>
      <p>When building visualization tools, the “visualization metamodel”
should also be explicitly defined. If tool is formally defined, then
software visualization simply becomes a matter of describing the
transformation from one model to another. In the remainder of this
section, we present some examples of metamodels and then
discusses formal transformations.</p>
    </sec>
    <sec id="sec-3">
      <title>2.2 Visualization MetaModels</title>
      <p>
        GUI components designed for visualizing data sets, such as Tree
and Table controls, have an implicit metamodel. A metamodel
formally describes the structure of the information the component can
visualize. For example, SHriMP Views [
        <xref ref-type="bibr" rid="ref14">14</xref>
        ] a popular nested graph
viewer, is excellent at visualizing large hierarchical datasets with
non-hierarchical relationships between the nodes. Common
visualization tools such as Tree Controls or Space Trees [
        <xref ref-type="bibr" rid="ref13">13</xref>
        ] are used
extensively to show graph based data in the form of a tree. The
metamodels for these components are rarely described formally.
The details of how the data must be structured in order to visualize
it using one of these tools must be inferred from reading
documentation such as JavaDoc or Man Pages.
      </p>
      <p>Visualization tools are commonly built by researchers as
monolithic applications, complete with a parser, application windows,
menu system and tool bars. Tools such as these usually have a
predefined XML schema for the data they can parse. While this
provides a formal metamodel, these tools are hard to re-use in existing
applications. Since these tools defined their own menu system, tool
bars and set of actions, it is difficult to incorporate these
visualizations into existing environments. In order to provide a set of
reusable components, we advocate that visualization components
should adhere to the API specification of the widget toolkit they
were implemented with, and provider a similar set of interfaces as
the other views in the toolkit. For example, the views should expose
item selection, notifications, view instantion, etc, in the same
manner as existing views. For each view, a formal metamodel should
also be defined.</p>
      <p>Often there are multiple ways to define a data model. In a table
view, the table can be defined as several rows, each row
containing a fixed number of cells. An equally valid definition would be
to define the table as a set of columns, each column containing a
fixed number of cells. In order to keep our approach generalizable,
several data models have been designed for each component. The
implementation of each view will read any model that conforms
to one of the pre-defined metamodels. By defining several
metamodels for single components, those who use the component can
choose the most appropriate metamodel for their data.</p>
      <sec id="sec-3-1">
        <title>2.2.1 Tree View</title>
        <p>The Tree View is widely used to present hierarchical data by listing
children below their parents. Sub-trees can often be expanded and
collapsed. The wide spread adoption of the tree control can
partially be attributed to the fact that many widget toolkits include the
control as a standard component. Figure 2 shows an example of a
Tree View’s metamodel.</p>
      </sec>
      <sec id="sec-3-2">
        <title>2.2.2 Graph View</title>
        <p>
          Graph Views display information as a set of nodes connected with
edges to show dependencies among the nodes. Despite the positive
feedback researchers have received from several implementation
of graph based views [
          <xref ref-type="bibr" rid="ref9">9</xref>
          ], the views have not received wide spread
adoption in Common Of the Shelf (COTS) Software. Toolkits exist
to help developers create these views [
          <xref ref-type="bibr" rid="ref2">2</xref>
          ], however, graph views
themselves are not widely available as standard components. The
Zest toolkit [
          <xref ref-type="bibr" rid="ref5">5</xref>
          ] has been designed to addres this problem for SWT,
a widget toolkit for Java.
        </p>
        <p>Graph Views can be defined in terms of their nodes and edges or
simply defined in terms of their nodes. Using the later approach,
the edges can be determined implicitly based on how the nodes are
related to one another. An example of each structure is presented
in Figure 3.</p>
        <p>Metamodels for several other views have also been defined
formally. Most notably, metamodels have been defined for Nested
Graph Views, Table Views, Matrix Views and Table-Tree Views.</p>
      </sec>
    </sec>
    <sec id="sec-4">
      <title>2.3 Visualization Transformations</title>
      <p>In order to visualize a partial dataset using one the structures
described above, application programmers must develop data
traversal algorithms and apply them to their data model. The traversal
algorithms are used to walk the data structure, extracting the
“interesting” information and using this information to populate the
views. While traversing the data structures, some information is
discarded and new information is deduced. For example, a
common Java model will include interactions between Methods.
However, when attempting to understand a section of source code, a
developer may wish to see how the classes relate to one another. In
order to do this, the method nodes must be discarded and the
relationships between them lifted to the Class level. Using a declarative
language for these transformations is often more concise, and easier
to maintain, then writing the traversal algorithms in source code.</p>
    </sec>
    <sec id="sec-5">
      <title>2.4 Techniques</title>
      <p>
        A framework for Model Driven Visualization has been implemented
within Eclipse [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ]. The models have been designed using EMF [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ].
EMF was used because of its ability to generate working code from
a model, and because it is able to generate XML serialization /
deserialization capabilities and an XSD. Each of the visualizations
described in Section 2.2 have also been implemented for Eclipse
using SWT. The JFace Tree and Table controls were used for the
Tree and Table views, while the Zest project was used for the
graphical views.
      </p>
      <p>
        The Atlas Transformation Language (ATL) [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ] was used to specify
the transformations. ATL is a transformation language for MDE
and is able to translate EMF models using both declarative and
imperative constructs. The transformations are described as a set of
transformation rules and the ATL virtual machine uses these rules
to generate an output model from a given input model.
      </p>
    </sec>
    <sec id="sec-6">
      <title>3. CASE STUDY</title>
      <p>In order to demonstrate our approach, we have built a small class
browser for Eclipse. Two views were created, one to show the
class hierarchy, and the other to show method invocation between
classes. A Java metamodel was first defined using EMF, and then
using ATL, transformations were written to translate the Java model
to a view model. Finally, using our interactive visualization toolkit,
the view models were rendered.
1
2
3
4
5
6
7
The Java metamodel presented earlier (Figure 1) defines the JSys- 8
tem, JClass and JMethod elements. JMethods are related to one an- 9
ther through the calls reference and JClasses reference each other 10
through the extendedBy dependency. The left side of Figure 4 11
shows a Java model which conforms to the Java metamodel de- 12
scribed in Figure 1. The two horizontal arrows represent the model 1134
transformations. The two views on the right of Figure 4 show two 15
translated models. The one on top conforms to the TreeView meta- 16
model (Section 2.2.1) and the one below conforms to the GraphView
metamodel (Section 2.2.2).</p>
      <p>The transformation from the Java Model to the view models is
pero u t : g r a p h v i e w ! GraphView (
e n t i t i e s &lt;− j a v a ! J C l a s s . a l l I n s t a n c e s ( ) ,
e d g e s&lt;− j a v a ! J C l a s s . a l l I n s t a n c e s ()− &gt;</p>
      <p>c o l l e c t ( e | t h i s M o d u l e . r e s o l v e T e m p ( e , ’ e ’ ) )
n : g r a p h v i e w ! Node (</p>
      <p>l a b e l &lt;− c . name
)
) ,
e : d i s t i n c t g r a p h v i e w ! Edge
f o r e a c h ( s i n g l e C a l l i n c . m e t h o d s
− &gt; c o l l e c t ( m|m. c a l l s )− &gt; f l a t t e n ( ) ) (
s o u r c e &lt;− n ,
d e s t i n a t i o n &lt;− s i n g l e C a l l . p a r e n t</p>
      <p>Listing 2: Java to Graph Translation
formed using ATL. Listing 1 shows the ATL transformation
responsible for translating the Java model to a Tree View model
(Section 2.2.1). The main rule matches the Java System and creates
the TreeView’s Root Node. All the classes with no superclass
are listed as roots. The other rule matches the JClass elements.
Each of these elements are translated to TreeView’s Node and the
Label for each node is simply the Class name. Finally, the children
of a given element are determined by extendedBy relationship in
the model.</p>
      <p>The second transformation (Listing 2) shows a translation from the
Java model to a Graph Model (Section 2.2.2). The Graph Model
shows dependencies among classes if there is a call relationship
between them. The JSystem2GraphView rule matches the Java
System and creates a GraphView Root Node. The edges and
entities of the graph are attached to the GraphView. The second rule
creates all the Nodes and Edges. Each node directly maps to a
JClass element in the Java model. For each method call an edge is
created. The edge is lifted to the JClass level such the source of the
edge is the JClass that contains the JMethod, and the destination is
the JClass of the JMethod being invoked.</p>
      <p>Once the transformations is completed, our Visualization Toolkit is
used to read the view models and present the user with the Class
dependencies. Figure 5 shows the output of this tool.</p>
    </sec>
    <sec id="sec-7">
      <title>4. FUTURE WORK</title>
      <p>In the interest in saving space, only simple examples have been
presented here. Model-based visualization components are
commonly more sophisticated. Our approach has been used to generate
views using charts, interactive graphs, interactive nested graphs,
time-lines, spectrographs, interactive tree-maps and others. We are
currently continuing our work by creating a complete library of
visualization metamodels and model-driven visualization
components. The metamodels will be included in Zooomm, the
International Zoo of Metamodels, Schemas and Grammars. Model-based
visualization components are also to being developed for
integration within Eclipse using the EMF framework.</p>
    </sec>
    <sec id="sec-8">
      <title>5. CONCLUSION</title>
      <p>In this paper, Model Driven Engineering techniques have been
applied in the context of softare visualization tools. The techniques
presented here are not only applicable to software, but can be
generalized to any information space. While GUI components found
in traditional widget toolkits are well suited for visualizing small
to medium, rather “flat” information, visualization tools are very
good at exploring large datasets with complex structures. This
paper shows how metamodels can be used for describing the structure
of the visualization tool. Designing these metamodels is a difficult
task, but once these models have been created, the explicit
mappings between datasets and the model-based visualization
components can be easily described. The work in this paper focusses on
single visualization components, although we realize that software
exploration requires combining and synchronizing multiple views.
Clearly, sophisticated exploration environments in the future will
only be achieved by integrating know-how from Software
Exploration community, Model Driven Engineering community and the
User Interface community.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <surname>Eclipse</surname>
          </string-name>
          . http://www.eclipse.org.
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <given-names>Graphical</given-names>
            <surname>Editor Framework</surname>
          </string-name>
          . Website. http://www.eclipse.org/gef.
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <given-names>Freddy</given-names>
            <surname>Allilaire</surname>
          </string-name>
          and
          <string-name>
            <given-names>Tarik</given-names>
            <surname>Idrissi</surname>
          </string-name>
          . Adt:
          <article-title>Eclipse development tools for atl</article-title>
          .
          <source>In Proceedings of the Second European Workshop on Model Driven Architecture</source>
          (
          <article-title>MDA) with an emphasis on Methodologies and Transformations (EWMDA-2</article-title>
          ), Canterbury, England,
          <year>2004</year>
          . Computing Laboratory, University of Kent, Canterbury, Kent CT2 7NF, UK.
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <given-names>Frank</given-names>
            <surname>Budinsky</surname>
          </string-name>
          , David Steinberg, Ed Merks, Raymond Ellersick, and
          <string-name>
            <given-names>Timothy J.</given-names>
            <surname>Grose</surname>
          </string-name>
          . Eclipse Modeling Framework.
          <source>Addison Wesley</source>
          ,
          <year>2003</year>
          . http://www.eclipse.org/emf.
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <given-names>R.</given-names>
            <surname>Ian</surname>
          </string-name>
          <string-name>
            <surname>Bull</surname>
          </string-name>
          ,
          <string-name>
            <given-names>Casey</given-names>
            <surname>Best</surname>
          </string-name>
          , and
          <string-name>
            <surname>Margaret-Anne Storey</surname>
          </string-name>
          .
          <article-title>Advanced Widgets for Eclipse</article-title>
          .
          <source>In Proceedings of the 2nd Eclipse Technology Exchange</source>
          , pages
          <fpage>6</fpage>
          -
          <lpage>11</lpage>
          ,
          <year>2004</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [6]
          <string-name>
            <given-names>Mariano</given-names>
            <surname>Consens</surname>
          </string-name>
          , Alberto Mendelzon, and
          <string-name>
            <given-names>Arthur</given-names>
            <surname>Ryman</surname>
          </string-name>
          .
          <article-title>Visualizing and Querying Software Structures</article-title>
          .
          <source>In Proc of International Conference on Software Engineering</source>
          ,
          <year>1992</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [7]
          <string-name>
            <surname>J.-M Favre</surname>
            ,
            <given-names>F</given-names>
          </string-name>
          <string-name>
            <surname>Duclos</surname>
            ,
            <given-names>J</given-names>
          </string-name>
          <string-name>
            <surname>Estublier</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          <string-name>
            <surname>Sanlaville</surname>
            , and
            <given-names>J.-J.</given-names>
          </string-name>
          <string-name>
            <surname>Auffret</surname>
          </string-name>
          .
          <article-title>Reverse engineering a large component-based software product</article-title>
          .
          <source>In Proc. of Fifth European Conference on Software Maintenance and Reengineering</source>
          , pages
          <fpage>95</fpage>
          -
          <lpage>104</lpage>
          , Lisbon, Portugal,
          <year>2001</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          [8]
          <string-name>
            <given-names>J.M.</given-names>
            <surname>Favre</surname>
          </string-name>
          .
          <article-title>Towards a basic theory to model model driven engineering</article-title>
          . In Workshop on Software Model Engineering (WISME), Lisboa, Portugal,
          <year>2004</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          [9]
          <string-name>
            <given-names>Ivan</given-names>
            <surname>Herman</surname>
          </string-name>
          and Guy Melanc¸
          <article-title>on adn M. Scott Marshall. Graph Visualization and Navigation in Information Visualization: A Survey</article-title>
          .
          <source>IEEE Transactions on Visualization and Computer Graphics</source>
          ,
          <volume>6</volume>
          :
          <fpage>24</fpage>
          -
          <lpage>43</lpage>
          ,
          <year>2000</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          [10]
          <string-name>
            <given-names>Alberto</given-names>
            <surname>Mendelzon</surname>
          </string-name>
          and
          <string-name>
            <given-names>Johannes</given-names>
            <surname>Sametinger</surname>
          </string-name>
          .
          <article-title>Reverse Engineering by Visualizing and Querying</article-title>
          .
          <source>Software - Concepts and Tools</source>
          ,
          <volume>16</volume>
          :
          <fpage>170</fpage>
          -
          <lpage>182</lpage>
          ,
          <year>1995</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          [11]
          <string-name>
            <surname>Hausi</surname>
            <given-names>A.</given-names>
          </string-name>
          <string-name>
            <surname>Mu</surname>
          </string-name>
          <article-title>¨ller and Karl Klashinsy. Rigi: A system for programming-in-the-large</article-title>
          .
          <source>In Proc. of the 10th Intl. Conference on Software Engineering (ICSE-10)</source>
          , pages
          <fpage>80</fpage>
          -
          <lpage>86</lpage>
          , Singapore,
          <year>April 1988</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          [12]
          <string-name>
            <surname>Donald</surname>
            <given-names>A.</given-names>
          </string-name>
          <string-name>
            <surname>Norman</surname>
          </string-name>
          .
          <article-title>The Design of Everyday Things</article-title>
          . New York: Basic Books,
          <year>1998</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          [13]
          <string-name>
            <given-names>C.</given-names>
            <surname>Plaisant</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Grosjean</surname>
          </string-name>
          , and
          <string-name>
            <given-names>B.B.</given-names>
            <surname>Bederson</surname>
          </string-name>
          . Spacetree:
          <article-title>Supporting exploration in large node link tree, design evolution and empirical evaluation</article-title>
          .
          <source>In Proc. Of INFOVIS 2002. IEEE Symposium on Information Visualization</source>
          ,
          <year>2002</year>
          , pages
          <fpage>57</fpage>
          -
          <lpage>64</lpage>
          , Boston,
          <year>October 2002</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref14">
        <mixed-citation>
          [14]
          <string-name>
            <surname>M.-A. D. Storey</surname>
            and
            <given-names>H. A.</given-names>
          </string-name>
          <string-name>
            <surname>Mu</surname>
          </string-name>
          <article-title>¨ller. Manipulating and documenting software structures using SHriMP views</article-title>
          .
          <source>In Proceedings of the 1995 International Conference on Software Maintenance (ICSM '95)</source>
          (Opio (Nice),
          <source>France, October 16-20</source>
          ,
          <year>1995</year>
          ),
          <year>1995</year>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>