<!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>Embedding Defect and Traceability Information in CIM- and PIM-Level Software Models</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Jörg Rech</string-name>
          <email>Joerg.Rech@iese.fraunhofer.de</email>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Mario Schmitt</string-name>
          <email>Mario.Schmitt@iese.fraunhofer.de</email>
        </contrib>
      </contrib-group>
      <abstract>
        <p>Additional information about software models comes in different forms such as defects detected, design patterns used, traceability information to other abstraction levels, etc. In this paper, we present how additional information about defects, context, traceability, etc. can be embedded into UML- and BPMN-based PIM- and CIM-level software models. Furthermore, we present a tool that uses the information about quality defects within a PIM to visualize defects directly in the diagrams of a software model.</p>
      </abstract>
      <kwd-group>
        <kwd>Quality Defects</kwd>
        <kwd>PIM</kwd>
        <kwd>CIM</kwd>
        <kwd>Traceability</kwd>
        <kwd>Defect Annotation</kwd>
        <kwd>Traceability Annotation</kwd>
        <kwd>Embedded Information</kwd>
        <kwd>Software Models</kwd>
        <kwd>MDSD</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>-</title>
      <p>Introduction
Business users together with business analysts and architects generate the basic
characteristics of a software system that result in computation independent models (CIM),
including, e.g., role, product, or process models. In order to support the traceability of
elements and of decisions made on the CIM-level to the PIM-level as well as the
traceability of problems identified at the PIM-level to the CIM-level, we have to store
additional information about the software model along with the software model.</p>
      <p>Additional information about elements in a software model such as a PIM or CIM
comes in different forms such as quality defects detected, patterns (roles) used,
traceability information to other abstraction levels, etc. This information is documented by
users or automated mechanisms and has to be visualized in standard or special views
of a modeling tool, made available to other systems for further analysis (e.g. impact
analyses), or persisted over a long period of time.</p>
      <p>
        Kolovos et al. [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ] differentiate between external and embedded traceability
information and decided on using an external approach. They argue against the embedded
approach (based on stereotypes), as it does not support inter-model relations, pollutes
the models, and degrades uniformity.
      </p>
      <p>
        However, while several other options are possible beside stereotypes, storing
additional complex information in a metamodel such as the UML [
        <xref ref-type="bibr" rid="ref11">11</xref>
        ] for PIM level is not
straightforward. An extension of the UML metamodel would result in non-standard
models that are not exchangeable between tools. Besides, in order to apply similar
mechanisms to models at different abstraction levels based on different (or previously
unknown) metamodels, we need a generic approach that can be easily adapted to and
complies with a broad range of metamodels.
      </p>
      <p>
        In our context, the de-facto metamodel on the PIM level is UML [
        <xref ref-type="bibr" rid="ref11">11</xref>
        ], which is
built using the OMG’s Meta Object Facility (MOF) meta-metamodel. MOF is a
common modeling language kernel providing a unified basis for all OMG metamodels.
On the CIM level, modeling focuses on business process modeling using mostly the
Business Process Modeling Notation BPMN [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ] and the Business Process Definition
Metamodel BPDM [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ]. While BPMN provides just a graphical notation for process
orchestration, BPDM is a CIM-level metamodel for business process modeling, using
BPMN as the graphical notation. Similar to UML, BPDM is based on the MOF [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ]
meta-metamodel.
      </p>
      <p>
        Several solutions to the abovementioned problem of embedding information into
software models are possible. In order to store the information in an Eclipse-based
IME for PIMs, such as Topcased [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ], and for CIMs, such as the BPMN-Editor of the
SOA Tools Platform (STP) [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ], we can persist information as:
• Markers/Properties in/of the software model that are managed and stored by the
tool, but cannot easily be shared between users or across a versioning system (e.g.,
CVS)
• MOF Tag, a construct in MOF that enables the multiple “tagging” of MOF model
elements with attribute-value pairs and can be shared across a versioning system,
• Comment, a construct of MOF and many other metamodels (e.g., “Text
Annotations” in BPMN) similar to MOF Tag for storing a single additional information
item (i.e., text field) per element, but, typically, is used for developer
documentation,
• UML Profile/Stereotype, an extension mechanism in UML that can be used to
integrate additional elements into the UML. However, the information might be
confused with, domain-specific stereotypes for example and could flood the user
with too much information, not necessary in day-to-day work,
• External files, similar to diagram interchange [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ] files in Topcased, which use a
semantic bridge to refer to elements of the software model(s). However, these files
need to be used by the tools at work in order to synchronize changes to the model
elements.
      </p>
      <p>In order to enable the annotation of elements in a MOF-based software model, with
respect to providing easily synchronizable and versionable information, we selected
MOF Tags to persist information about defects detected, context factors, and
traceability information. Furthermore, the tagging mechanism allows embedding complex
information within a software model using an XML schema to describe and structure
the specific content for every specific annotation. The XML schema represents a
metamodel that allows us to define the substructures for the information on defects,
traceability, etc.
2</p>
      <p>A Metamodel for Defect and Traceability Annotations
While traceability and context information has to be annotated manually (for now),
defects are identified by diagnostic mechanisms that analyze the system and find
typical recurring problems, that have a negative effect on internal quality aspects
(e.g., maintainability, portability, or usability).</p>
      <p>The five types of defect-related embedded information are: Defect Annotations
(with information about the diagnosed quality defects), Context Annotations (with
context information on design patterns and roles applied or on special stereotypes,
used to differentiate the diagnosis), Decision Annotations (with decisions such as
“ignore” for individually diagnosed quality defects in case they are wrongly
diagnosed or not removable in this specific location), Symptom Annotations (with
information on the identified symptoms), and Treatment Annotations (which are used
to store the treatments applicable for removing the diagnosed quality defects).</p>
      <p>Traceability information uses just one type of annotation (Trace Annotations) that
realizes traces from one element to one or more other elements (e.g., from one CIM
element to multiple PIM elements (downwards), from one PIM to multiple CIM
elements (upwards), or from one PIM to multiple other PIM elements (sidewards)).
Multiple types of references can be used between abstractions and within abstractions.</p>
      <p>Furthermore, while single-location defects are enclosed within one abstraction at
one element, multi-location defects refer to other elements (resp. annotations) within
the same model, and all defects might refer to elements on another abstraction level to
document rationales for not removing a defect or to pinpoint a cause or (design)
decision (e.g., in a CIM).</p>
      <p>Figure 1 shows different aspects. On the OMG-specification-side (right), it outlines
the generic approach as proposed by MOF for annotating model elements with
additional information (metainformation) using the Tag entity. It introduces the base
model elements of BPMN-based CIMs (BPDM::Element) and UML-based PIMs
(UML::Element) both deriving from MOF::Element, which acts as common model
element abstraction. Eclipse provides for these concepts either an OMG-conformant
implementation or analog concepts that can be easily mapped (center of Figure 1) to
OMG. For MOF, the element MOF::Element is mapped to the Ecore element
Ecore::EModelElement of the Eclipse Modeling Framework (EMF) and MOF::Tag is
mapped to Ecore::EAnnotation. Similarily, for CIM-modeling, the BPMN element
BPDM::Element is mapped to the SOA Tools Platform (STP) project object
STP::BPMN::NamedBpmnObjects. Finally, the element UML::Element of OMG’s
UML is implemented (as a one-to-one representation) by the Model Development
Tools (MDT) project’s UML2 MDT::UML2::Element.</p>
      <p>
        Furthermore, Figure 1 presents an XML-based metamodel (left) for defect- and
traceability-oriented model metainformation and shows how actual metainformation
is embedded using the tagging mechanism/within annotations. A metamodel similar
to the traceability information metamodel is used by Feng et al. [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ] for external
traceability models.
      </p>
      <p>A model element may have multiple annotations (EAnnotations) associated with it,
each consisting of a source URI denoting an annotation’s type and an arbitrary
number of key/value pairs. Following the structure of annotations, we bundle all model
metainformation in a single annotation element, but internally distribute information
to multiple key/value pairs according to the information’s scope/type (e.g.
«Traceablity» or «Quality»). That is, key determines the type/scope of the XML-based
metainformation assigned to value.</p>
      <p>Figure 2 gives a simplified, exemplary XMI serialization of a UML-based PIM
model with a model element annotated with quality information. Quality information
consists of quality model and defect detection information. According to the
(nonfunctional) requirements a software system has to meet, a quality model defines and
prioritizes mandatory quality aspects and thus, is the basis for interpreting/verifying
the quality of a software model. In the context of VIDE-DD, determining the quality
of a software model focuses on detecting quality defects. A quality defect represents a
system-independent defect at one or more model elements with a negative impact on
certain quality aspects. Defects are diagnosed on the basis of one or more quantifiable
characteristics of a model or its model elements, so-called symptoms. The intensity
with which symptoms promote related defects differs and amongst other things,
largely depends on the characteristic’s deviation from previously defined threshold(s).
For removing a defect or mitigating a defect’s (negative) impact on certain quality
aspects, treatments refer to available techniques (e.g. refactorings). The exemplary
annotation in Figure 2 illustrates the concept of defect detection information: A Lazy
Class defect has been diagnosed for the PIM-level class Opportunity based on the
Number of Operations. Hence, a negative impact on the declared quality aspect
Maintainability is expected, treatable by applying an Inline Class refactoring.</p>
      <p>
        Furthermore, we distinguish single- from multi-location defects [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ]. A
singlelocation defect (e.g. Lazy Class) affects one model element (e.g., a class), whereas
multi-location defects apply to more than one element within the same model. For
example, a Shotgun Surgery defect is present when, due to strong coupling of classes,
a change in one class requires many subsequent changes in other classes. As each
concerned class is annotated with defect information, it is necessary to interrelate this
information, e.g. in order to elicit and apply adequate treatments. Thus, urlToDefects
(cf. Figure 1) allows for referencing related defects in other model elements.
      </p>
      <p>
        A model element’s traceability information comprises one to many traces to
elements, both at different and at same abstraction levels. As presented in Figure 3, the
key component of a trace is urlToElement for identifying related elements using a
URL reference. The URL syntax is a path to the containing model repository,
followed by a model identifier (the model’s name) and the XMI-id of the model element.
To qualify the relation of two elements linked by a trace, different types of references
can be assigned to a) traces between abstractions, such as “realizes / is realized by”,
“refines / is refined by”, “specifies / is specified by“, “requires / is required by”, etc.
and b) traces within abstractions, such as “includes / is part of”, “verifies / is verified
by”, “defines / is defined by”, “constrains / is constrained by”, etc. (see [
        <xref ref-type="bibr" rid="ref12">12</xref>
        ] or [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ]).
&lt;uml:Model&gt;
...
&lt;packagedElement xmi:type="uml:Class" xmi:id="_CyIsaF-fEdySHqlLXw_Tew"
name="Opportunity"&gt;
&lt;eAnnotations source="http://www.iese.fraunhofer.de/ModelMetaInformation"&gt;
&lt;details key="TraceabilityInformation" value="
&lt;!-- BEGIN: Embedded Traceability Information XML-string --&gt;
&lt;TraceabilityInformation&gt;
&lt;Trace
urlToElement="http://iese.fhg.de/SalesOpportunity_CIM.bpmn#_TG7coT3iEd2hQ-HeytPXvA"
type="realizes"
rationale="Implementation of Opportunity data object"
traceCreation="automatic" transitionAutomation="automatic"/&gt;
&lt;/TraceabilityInformation&gt;
&lt;!-- END: Embedded Traceability Information XML-string --&gt;
"/&gt;
&lt;/eAnnotations&gt;
&lt;/packagedElement&gt;
&lt;/uml:Model&gt;
      </p>
      <p>As generative model-driven development relies on model transformations between
abstraction levels, the information about whether a trace creation or transition
between two related elements has been carried out manually, semi-automatically, or
automatically is of interest, e.g. for evaluating the quality of model
transformations/model generators or for determining the overall level of automation. The XMI
serialization of traceability information between an Opportunity data object at the
CIM level and its implementation class at the PIM level is exemplified in Figure 3
(PIM-to-CIM) and Figure 4 (CIM-to-PIM).
&lt;bpmn:BpmnDiagram&gt;
...
&lt;artifacts xmi:type="bpmn:DataObject" xmi:id="_TG7coT3iEd2hQ-HeytPXvA"
name="Opportunity"&gt;
&lt;eAnnotations source="http://www.iese.fraunhofer.de/ModelMetaInformation"&gt;
&lt;details key="TraceabilityInformation" value="
&lt;!-- BEGIN: Embedded Traceability Information XML-string --&gt;
&lt;TraceabilityInformation&gt;
&lt;Trace
urlToElement="http://iese.fhg.de/SalesOpportunity_PIM.uml#_CyIsaF-fEdySHqlLXw_Tew"
type="isRealizedBy"
rationale="Implementation of Opportunity data object"
traceCreation="automatic" transitionAutomation="automatic"/&gt;
&lt;/TraceabilityInformation&gt;
&lt;!-- END: Embedded Traceability Information XML-string --&gt;
"/&gt;
&lt;/eAnnotations&gt;
&lt;/artifacts&gt;
...</p>
      <p>&lt;/bpmn:BpmnDiagram&gt;
Figure 4 Serialization of Traceability Information Annotation in CIM
3</p>
      <p>
        Visualizing (Defect) Annotations in Modeling Environments
The information stored within the annotations can be used, for example, by the
diagram visualizer to enrich the standard UML diagrams with information about the
defects. As presented in Figure 5, the VIDE Defect Detector (VIDE-DD) extends the
Topcased modeling environment [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ] and decodes the information within the
annotation in order to decorate an element (e.g., a class) with a defect icon or list all
annotations for the user (see 6). This tool is aimed at enriching the visualization of the
models in order to inform designers and maintainers about potential threats to model
quality.
We presented how additional information about defects, context, or traceability can be
embedded in a UML- or BPMN-based software model (PIM or CIM) using
Annotations. To structure the information within these annotations, we used an XML-based
metamodel that supports single- and multi-location annotations from CIM-to-PIM,
within PIM, and from PIM-to-CIM. Furthermore, we presented a tool that integrates
quality defect diagnosis into the contemporary modeling environment Topcased and
uses the annotations to present them in standard diagrams.
      </p>
      <p>In the future, more tools for defect diagnosis and traceability support will be
developed and integrated into software development tools that have to overcome the
challenges of synchronization and versioning. This is especially important for tools on the
model level, as these have to support quality assurance in and traceability between
multiple software and transformation models.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <surname>BPDM-Beta1</surname>
          </string-name>
          ,
          <article-title>Business Process Definition MetaModel (BPDM), Beta 1</article-title>
          ,
          <string-name>
            <given-names>OMG</given-names>
            <surname>Adopted</surname>
          </string-name>
          <string-name>
            <surname>Specification</surname>
          </string-name>
          , OMG, dtc/07-07-01,
          <year>2007</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2. BPMN-
          <volume>1</volume>
          .1,
          <string-name>
            <given-names>Business</given-names>
            <surname>Process</surname>
          </string-name>
          Modeling Notation,
          <year>V1</year>
          .1,
          <string-name>
            <surname>OMG</surname>
          </string-name>
          ,
          <year>2008</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3. DI-
          <volume>1</volume>
          .0,
          <string-name>
            <given-names>UML</given-names>
            <surname>Diagram Interchange</surname>
          </string-name>
          <string-name>
            <surname>Specification</surname>
          </string-name>
          , version
          <volume>1</volume>
          .0,
          <string-name>
            <surname>Specification</surname>
          </string-name>
          , Object Management Group, Inc. (OMG), Needham, MA, USA,
          <year>2006</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <surname>EMF</surname>
          </string-name>
          ,
          <article-title>"Eclipse Modeling Framework (EMF),"</article-title>
          http://www.eclipse.org/modeling/emf/,
          <source>last accessed on 1. April</source>
          <year>2008</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <given-names>A.</given-names>
            <surname>Espinoza</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P. P.</given-names>
            <surname>Alarcon</surname>
          </string-name>
          , and
          <string-name>
            <given-names>J.</given-names>
            <surname>Garbajosa</surname>
          </string-name>
          ,
          <article-title>Analyzing and Systematizing Current Traceability Schemas</article-title>
          , In Annual IEEE/NASA Software Engineering Workshop (SEW), pp.
          <fpage>21</fpage>
          -
          <lpage>32</lpage>
          ,
          <year>2006</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <given-names>Y.</given-names>
            <surname>Feng</surname>
          </string-name>
          , G. Huang,
          <string-name>
            <given-names>J.</given-names>
            <surname>Yang</surname>
          </string-name>
          , and
          <string-name>
            <given-names>H. M.</given-names>
            <surname>Mei</surname>
          </string-name>
          ,
          <article-title>Traceability between Software Architecture Models</article-title>
          ,
          <source>In 30th Annual International Computer Software and Applications Conference (COMPSAC)</source>
          , pp.
          <fpage>41</fpage>
          -
          <lpage>44</lpage>
          ,
          <year>2006</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7.
          <string-name>
            <given-names>D. S.</given-names>
            <surname>Kolovos</surname>
          </string-name>
          ,
          <string-name>
            <given-names>R. F.</given-names>
            <surname>Paige</surname>
          </string-name>
          , and
          <string-name>
            <given-names>F. A. C.</given-names>
            <surname>Polack</surname>
          </string-name>
          ,
          <article-title>On-Demand Merging of Traceability Links with Models</article-title>
          ,
          <source>In 2nd EC-MDA Workshop on Traceability</source>
          ,
          <year>2006</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          8. MOF-
          <volume>2</volume>
          .0,
          <string-name>
            <given-names>Meta</given-names>
            <surname>Object Facility (MOF) Core</surname>
          </string-name>
          <string-name>
            <surname>Specification</surname>
          </string-name>
          , version
          <volume>2</volume>
          .0,
          <string-name>
            <surname>Specification</surname>
          </string-name>
          , Object Management Group, Inc. (OMG), Needham, MA, USA, formal/06-01-01,
          <year>2006</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          9.
          <string-name>
            <given-names>J.</given-names>
            <surname>Rech</surname>
          </string-name>
          and
          <string-name>
            <given-names>A.</given-names>
            <surname>Spriestersbach</surname>
          </string-name>
          ,
          <article-title>Quality Defects in Model-driven Software Development, Deliverable, Fraunhofer Institute for Experimental Software Engineering (IESE), Kaiserslautern</article-title>
          ,
          <source>D4.1</source>
          ,
          <year>2007</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          10.
          <string-name>
            <surname>TopCased</surname>
          </string-name>
          , "
          <string-name>
            <surname>Topcased</surname>
            <given-names>IDE</given-names>
          </string-name>
          ," http://www.topcased.org/,
          <source>last accessed on 27 November</source>
          <year>2007</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          11. UML-
          <volume>2</volume>
          .1.1,
          <string-name>
            <surname>Unified</surname>
            <given-names>Modeling Language</given-names>
          </string-name>
          (UML),
          <source>version 2.1</source>
          .1, Object Management Group, Inc. (OMG), Needham, MA, USA,
          <year>2007</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          12. A. von Knethen,
          <article-title>Change-Oriented Requirements Traceability</article-title>
          .
          <source>Support for Evolution of Embedded Systems PhD Thesis</source>
          . Kaiserslautern: University of Kaiserslautern, Department of Computer Science,
          <year>2002</year>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>