<!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>Measuring Model Transformation in Model Driven Development</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Motoshi Saeki</string-name>
          <email>saeki@se.cs.titech.ac.jp</email>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Haruhiko Kaiya</string-name>
          <email>kaiya@cs.shinshu-u.ac.jp</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Dept. of Computer Science, Shinshu University Wakasato</institution>
          <addr-line>4-17-1, Nagano 380-8553</addr-line>
          ,
          <country country="JP">Japan</country>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>Dept. of Computer Science, Tokyo Institute of Technology Ookayama</institution>
          <addr-line>2-12-1, Meguro-ku, Tokyo 152</addr-line>
          ,
          <country country="JP">Japan</country>
        </aff>
      </contrib-group>
      <fpage>77</fpage>
      <lpage>80</lpage>
      <abstract>
        <p>In this paper, we propose the technique to define the metrics of model transformation using a meta-modeling technique and a graph rewriting techniques in a Model Driven Development (MDD) context.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>1 Introduction</title>
      <p>
        In Model Driven Development (MDD), model transformation is one of the key
technologies [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ] and the transformations that can improve the quality of models are
significant. One of the problems in MDD is how to identify what transformations can improve
the quality of models. If a metrics value can express the quality of a model, increasing
the metrics values before and after a model transformation can show the improvement of
the model quality. It means that the formal definition of a transformation should include
the definition of metrics of model quality so that the metrics can be calculated during
the transformation. Although we could find excellent techniques to formalize model
transformation of MDD until now, there are quite few arguments on the significance of
clarifying and defining the quality metrics of model transformation [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ].
      </p>
      <p>In this short paper, we propose a technique to solve the problem on how to define
metrics of model transformation. To realize this technique, we should have a technique
to specify metrics according to models, i.e. model-specific metrics, because the metrics
of model transformation can be defined from the metrics of the models that appear
in the transformation. We can summarize the approaches that we adopt as follows; 1)
Using a meta modeling technique to specify model-specific metrics and 2) Using a
graph rewriting system to formalize model transformation, whose essential points will
be explained in sections 2 and 3 respectively.
A meta model specifies the structure or data type of the models and in this sense, it can
be considered as an abstract syntax of the models. In our technique, we adopt a class
diagram of UML for specifying meta models and Object Constraint Language (OCL)
for constraints on models. The example of the meta model of the simplified version of
class diagrams is shown in Figure 1 (a). As shown in the figure, it has the concepts
“Class”, “Operation” and “Attribute” and all of them are defined as classes and these
concepts have associations representing logical relationships among them. For instance,
the concept “Class” has “Attribute”, so the association “has Attribute” between “Class”
and “Attribute” denotes this relationship.</p>
      <p>generalization</p>
      <p>ClassDiagram</p>
      <p>Class</p>
      <p>aggregation
has_Attribute</p>
      <p>Attribute
has_Operation
+owned_Operation</p>
      <p>Operation
+owner_WMC
has_WMC</p>
      <p>StructuralComplexity</p>
      <p>TNMvalue : Integer</p>
      <p>WMC
value : Integer</p>
      <p>NOC
DIT
(a) Meta Model of Class Diagram
(b) Meta Model of</p>
      <sec id="sec-1-1">
        <title>Structural Complexity Metrics</title>
        <p>
          We can embed metrics and their calculation methods into a meta model in the
same way. More concretely, metrics such as WMC (Weighted Methods per Class),
DIT (Depth of an Inheritance Tree) and NOC (Number of Children) of CK metrics
[
          <xref ref-type="bibr" rid="ref3">3</xref>
          ] are defined as classes having the attribute “value” in the meta model as shown in the
Figure 1 (b). The “value” has the metrics value and its calculation is defined as a
constraint written with OCL. For example, WMC is associated with each class of a class
diagram through the association “has WMC” and the role names “owner WMC” and
“owned Operation” are employed to define the value of WMC with OCL. Intuitively
speaking, the value of WMC is the number of the methods in a class when we make
weighted factors 1 and we take this simple case. It can be defined as follows.
context WMC::value : Integer
derive: owner WMC.owned Operation -&gt; size()
WMC and the other CK metrics are for a class not for a class diagram, and in this
example, we take the sum total of WMCs for the class diagram, and the attribute TNMvalue
of StructuralComplexity holds it as shown in Figure 1 (b). The technique of using OCL
on a meta model to specify metrics was also discussed in [
          <xref ref-type="bibr" rid="ref2 ref4">2, 4</xref>
          ].
3
        </p>
      </sec>
    </sec>
    <sec id="sec-2">
      <title>Metrics on Model Transformation</title>
      <p>The model following its meta model is represented with an attributed typed graph and
it can be transformed by applying the rewriting rules. We call this graph instance graph
in the sense that the graph is an instance of the meta model. We can design graph
rewriting rules considering the nodes of the metrics and their values. Figure 2 depicts
the overview of a model transformation process based on graph rewriting. After a model
is converted into an instance graph notation following its meta model, it is transformed
into an instance graph of a new model by applying a rewriting rule. At that time, the rule
specifies the metrics value m1 is transformed into m2 in the figure, and the value 0.5 of
the model is changed into 0.8 at the new model. That is to say, the metrics values of the
model after the transformation can be related to the value of the older model before the
transformation.</p>
      <p>Model#1</p>
      <p>parse
instantiate
transform
0.5</p>
      <p>0.8
apply
m1</p>
      <p>m2</p>
      <sec id="sec-2-1">
        <title>Transformation Rule</title>
      </sec>
      <sec id="sec-2-2">
        <title>Model#2</title>
        <p>unparse
instantiate</p>
      </sec>
      <sec id="sec-2-3">
        <title>Meta Model#1</title>
        <p>Metrics#1</p>
      </sec>
      <sec id="sec-2-4">
        <title>Meta Model#2</title>
        <p>Metrics#2</p>
        <p>See an example of a transformation rule shown in Figure 3. Two conditions x2 &gt; a
and x3 &lt; y3 are attached to the rule for rewriting the graph G1 with G2 and these
conditions should be satisfied before the rule is applied. This rule includes two nodes
for metrics; one is the metrics for G1 and another is for G2. The first condition x2 &gt; a
expresses that the rule cannot be applied until the value of the metrics m2 before the
rewriting is greater than a certain value, i.e. “a”. It means that this model transformation
is possible when the model has a quality higher than a certain standard. The second
condition x3 &lt; y3 specifies monotonic increasing of the metrics m3 in this transformation.
This formula has both values of metrics before and after the transformation as
parameters and it can specify the characteristics of the transformation, e.g. a specific metrics
value is increasing by the transformation. As shown in the figure, the calculation of the
metrics n2 uses the metrics m1 of the model before the transformation, and this
calculation formula of n2 shows that the metrics value of G1 is propagated to G2. The
quality of a transformation can be formally specified by using this approach. In Figure
3, we can calculate how much the quality could be improved with the transformation
by using the metrics values of the model before the transformation and those after the
transformation. The function g in the figure calculates the improvement degree of the
quality. This is a basic idea of the quality metrics of model transformation.
metrics for G1</p>
        <p>G1
metrics for G2</p>
        <p>G2
quality of the transformation: g(x1,x2,x3,..., y1,f(x1),y3,...)</p>
      </sec>
    </sec>
    <sec id="sec-3">
      <title>Conclusion and Future Work</title>
      <p>In this paper, we propose the technique to specify the metrics of model
transformations based on graph rewriting systems. In addition to the development of supporting
tools, one of the future research agenda can be collecting useful definitions of metrics.
Although the aim of this research project is not to find or collect useful and effective
quality metrics, making a kind of catalogue of metrics definitions and specifications is
important in the next step. The assessment of the collected metrics is also a research
agenda.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <given-names>OMG</given-names>
            <surname>Model</surname>
          </string-name>
          <article-title>Driven Architecture</article-title>
          . http://www.omg.org/mda/.
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <given-names>F. B.</given-names>
            <surname>Abreu</surname>
          </string-name>
          .
          <article-title>Using OCL to Formalize Object Oriented Metrics Definitions</article-title>
          .
          <source>In Tutorial in 5th International ECOOP Workshop on Quantitative Approaches in Object-Oriented Software Engineering (QAOOSE</source>
          <year>2001</year>
          ),
          <year>2001</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <given-names>S.</given-names>
            <surname>Chidamber</surname>
          </string-name>
          and
          <string-name>
            <given-names>C.</given-names>
            <surname>Kemerer</surname>
          </string-name>
          .
          <article-title>A Metrics Suite for Object-Oriented Design</article-title>
          .
          <source>IEEE Trans. on Software Engineering</source>
          ,
          <volume>20</volume>
          (
          <issue>6</issue>
          ):
          <fpage>476</fpage>
          -
          <lpage>492</lpage>
          ,
          <year>1994</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <given-names>M.</given-names>
            <surname>Saeki</surname>
          </string-name>
          .
          <source>Embedding Metrics into Information Systems Development Methods: An Application of Method Engineering Technique. In Lecture Notes in Computer Science (Proc. of CAiSE</source>
          <year>2003</year>
          ), volume
          <volume>2681</volume>
          , pages
          <fpage>374</fpage>
          -
          <lpage>389</lpage>
          ,
          <year>2003</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <given-names>M.</given-names>
            <surname>Saeki</surname>
          </string-name>
          and
          <string-name>
            <given-names>H.</given-names>
            <surname>Kaiya</surname>
          </string-name>
          .
          <source>Model Metrics and Metrics of Model Transformation: Materials of 1st Workshop on Quality in Modeling: MoDELS2006 Conference</source>
          . http://www.ituniv.se/ miroslaw/QiM.htm,
          <year>2006</year>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>