<!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>Integrating Technical Debt into MDE</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Faber D. Giraldo</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Sergio Espan~a</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Manuel A. Pineda</string-name>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>William J. Giraldo</string-name>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Oscar Pastor</string-name>
          <email>opastorg@pros.upv.es</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>PROS Research Centre, Universitat Politecnica de Valencia</institution>
          ,
          <country country="ES">Spain</country>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>System and Computer Engineering, University of Quind o</institution>
          ,
          <country country="CO">Colombia</country>
        </aff>
      </contrib-group>
      <fpage>145</fpage>
      <lpage>152</lpage>
      <abstract>
        <p>The main goal of this work is to evaluate the feasibility to calculate the technical debt (a traditional software quality approach) in a model-driven context through the same tools used by software developers at work. The SonarQube tool was used, so that the quality check was performed directly on projects created with Eclipse Modeling Framework (EMF) instead of traditionals source code projects. In this work, XML was used as the model speci cation language to verify in SonarQube due to the creation of EMF metamodels in XMI (XML Metadata Interchange) and that SonarQube o ers a plugin to assess the XML language. After this, our work focused on the de nition of model rules as an XSD schema (XML Schema De nition) and the integration between EMF-SonarQube in order that these metrics were directly validated by SonarQube; and subsequently, this tool determined the technical debt that the analyzed EMF models could contain.</p>
      </abstract>
      <kwd-group>
        <kwd>Model-driven engineering</kwd>
        <kwd>technical debt</kwd>
        <kwd>EMF</kwd>
        <kwd>SonarQube</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>-</title>
      <p>Two representative trends for the software development industry that appeared
in the nineties were the model-driven initiative and the technical debt metaphor.
Both trends promote software quality each in its own way: high abstract levels
(models) and software process management (technical debt). However, despite
the wide exposition of these trends in the literature, there are not more
indications about the combination of them into software development scenarios; each
initiative is implemented in a separated way.</p>
      <p>
        In traditional software development projects (those involving manual
programming), technical debt is mainly focused in quality assurance processes over
source code and related services (e.g. common quality metrics are de ned over
source code). However, model-driven engineering (MDE) promotes for modelling
instead of programming [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ]. A review of the literature reveals that there is
currently no application of the technical debt concept to environments outside the
traditional software development. There exist approaches to the measurement
of model quality [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ][
        <xref ref-type="bibr" rid="ref8">8</xref>
        ][
        <xref ref-type="bibr" rid="ref9">9</xref>
        ][
        <xref ref-type="bibr" rid="ref10">10</xref>
        ], but these do not include technical debt calculus.
Therefore, we claim that dealing with technical debt in MDE projects is an open
problem.
      </p>
      <p>
        Two issues pose challenges to the inclusion of technical debt into MDE. (i)
Di erent authors provide con icting conceptions of quality in model
management within MDE environments[
        <xref ref-type="bibr" rid="ref5">5</xref>
        ]. (ii) The MDE literature often neglects
techniques for source code analysis and quality control3. Therefore, in model-driven
developments it is di cult to perform an analysis of the state of the project that
is important for technical debt management: establishing what has been done,
what remains to be done, how much work has been left undone. Also, other
speci c issues that belong to model theory such as: number of elements in the
metamodel, coverage for the views, complexity of the models, the relationship
between the abstract syntax and the concrete syntax of a language, quantity of
OCL veri cation code, among others, contribute to increase the technical debt
in model-driven projects.
      </p>
      <p>The main contributions of this paper are the following: (i) A demonstration
of a integration between model-driven and technical debt tools for supporting
a technical debt calculus process performed over conceptual models. (ii) The
operationalization of a recognized framework for evaluating models.
2</p>
      <p>Implementation of a technical debt plugin for EMF
We implemented an Eclipse plugin for integrating the EMF enviroment with
SonarQube; so that, results of the technical debt can be shown directly on
the Eclipse work area instead of changing the context and opening a browser
with the SonarQube report. We used con guration options belonging to EMF
XMIResource objects to export the XMI le as an XML without the speci c
XMI information tags.
2.1</p>
    </sec>
    <sec id="sec-2">
      <title>De nition of an XSD for SonarQube</title>
      <p>
        One of the most critical issues in a technical debt program is the de nition of
metrics or procedures for deducting technical debt calculations; in works like [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ][
        <xref ref-type="bibr" rid="ref6">6</xref>
        ]
it is highlighted the absence of technical debt values (established and accepted),
and features such as the kinds of technical debt. Most of the technical debt
calculation works are focused on software projects without an applied
modeldriven approach; some similar works report the use of high level artifacts as
software architectures[
        <xref ref-type="bibr" rid="ref12">12</xref>
        ], but they are not model-driven oriented. Emerging
frameworks for de ning and managing technical debt [
        <xref ref-type="bibr" rid="ref13">13</xref>
        ] are appearing, but
they focus on speci c tasks of the software development (not all the process
itself).
3 Neglecting the code would seem sensible, since MDE advocates that the model is
the code [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ]. However, few MDE tools provide full code generation and manual
additions of code and tweakings are often necessary.
      </p>
      <p>
        From one technical perspective, the SonarQube tool demands an XSD (XML
Scheme Document) con guration le that contains the speci c rules for
validating the code; or in this case, a model. Without this le, the model could be
evaluated like a source code by default. In order to de ne these rules, we chose
one of the most popular proposals for validating models (Physics of notations of
Moody [
        <xref ref-type="bibr" rid="ref11">11</xref>
        ]) due to its relative easiness to implement some of its postulates in
terms of XSD sentences.
      </p>
      <p>In the case of this work, visual notation was taken as the textual information
managed by XMI entities from EMF models (text are perceptual elements too),
focusing that each item meets syntactic rules to display each information eld
regardless about what is recorded as a result of the EMF model validation. The
analysis does not consider the semantic meaning of the model elements to be
analyzed.</p>
      <p>The operationalization of Moody principles over the XSD le posteriorly
loaded in SonarQube was de ned as follows:
{ Visual syntax - perceptual con guration: in the XSD le, it is ensured that all
elements and/or attributes of the modelled elements are de ned according
to the appropriate type (the consistence between the values of attributes and
its associated type is validated).
{ Visual syntax - attention management: a validation order of the elements is
speci ed by the usage of order indicadors belonging to XML schemes.
{ Semiotic clarity - redundant symbology: a node in the model can only be
checked by an XSD element.
{ Semiotic clarity - overload symbology: an XSD element type only validates
a single model node type.
{ Semiotic clarity - excess symbolism: a metric to validate that there are no
blank items was implemented (for example, we could create several elements
of Person type, but its data does not appear).
{ Semiotic clarity - symbology de cit: a validation that indicates the presence
of incomplete information was made (e.g., we could have the data of a Person
but we don't have his/her name or identi cation number). For this rule, we
made constraints with occurrence indicators to each attribute.
{ Perceptual discriminability: in the XML model, nodes must be organized in
a way that they can be di erentiated, e.g., one Project element does not
appear like a Person element. This is ensured by reviewing in the XSD that
it does not contain elements exactly alike, and in the same order.
{ Semantic transparency: this was done by putting restrictions on the names
of the tags, so that the tags correspond to what they must have, e.g, a data
label must be of data type.
{ Complexity management: this was done by the minOccurs and maxOccurs
occurrence indicators. With these indicators it is possible to de ne how many
children one node can have.
{ Cognitive integration: this was done using namespaces in the XSD le, so
that it is possible to ensure the structure for the nodes independent from
changes in the model design.
Perceptual
discriminability
Complexity
management
Semiotic clarity –
symbology deficit
&lt;complexType name= Person &gt;
&lt;attribute name= lastname type= string /&gt;
&lt;attribute name= firstname type= string /&gt;
&lt;complexType&gt;
&lt;complexType name= Project &gt;
&lt;attribute name= shortname type= string /&gt;
&lt;attribute name= longname type= string /&gt;
&lt;complexType&gt;
&lt;choice maxOccurs= 5 minOccurs= 0 &gt;
&lt;element name= Persons type= Person /&gt;
&lt;element name= Projects type= Project /&gt;
&lt;/choice&gt;
&lt;xs:simpleType Name= NoNullString &gt;
&lt;restriction base= String &gt;
&lt;minLength value= 1 /&gt;
&lt;/restriction&gt;
&lt;/simpleType&gt;
{ Dual codi cation: this was done by measuring the quantity of commented
code lines with respect to the XML lines that de ne the elements of the
model.
{ Graphic economy: we established a limit for di erent items that can be
handled in the XSD, and reporting when di erent elements are found marking
the mistake when these data types are not found in the schema.
{ Cognitive t: this was done by creating several XSD les where each one is
responsible for reviewing a speci c view model.</p>
      <p>Figure 1 exposes a portion of the XSD code implemented for some Moody
principles.
2.2</p>
    </sec>
    <sec id="sec-3">
      <title>Veri cation of technical debt from EMF models</title>
      <p>In order to demonstrate the integration of both tools (EMF-SonarQube), a
sample metamodel (Figure 2) was made in EMF4. We introduce some errors like
capital letters, blank spaces, and others, to evidence abnormalities not covered
with model conceptual validation approaches like OCL.</p>
      <p>Once the validation option had been chosen (by the SonarQube button or
menu), we obtain a report similar to Figure 3. Part A indicates the number of
lines of code that have been tested, comment lines, and duplicate lines, blocks
or les. Also, part B of this gure reports the total of errors that contain the
project (in this case the EMF model), as well as the technical debt graph (part
C), which shows the percentage of technical debt, the cost of repair, and the
4 this metamodel was extracted from a web tutorial about EMF; source:
http://tomsondev.bestsolution.at/2009/06/06/galileo-emf-databinding-part-1/
number of men needed to x errors per day (this information was not con gured
for this case).</p>
      <p>SonarQube o ers an issues report where it indicates the number of errors
found; and consequently, the error list distributed in order of importance from
highest to lowest:
{ Blocker: they are the most serious errors; they should have the highest
priority to review.
{ Critical: they are design errors which a ect quality or performance of the
project (model errors can be classi ed in this category).
{ Major: although these errors do not a ect performance, they require to be
xed for quality concerns.
{ Minor: they are minor errors that do not a ect the operation of the project.
{ Info: they are reporting errors, not dangerous.</p>
      <sec id="sec-3-1">
        <title>Conclusions</title>
        <p>
          In this work we show the technical feasibility to integrate a technical debt tool
like SonarQube with a model-driven development enviroment such as the Eclipse
modelling framework. We present an example of technical debt validation applied
over a sample metamodel implemented for testing purposes. Thereby, we
demonstrate the technical feasibility for measuring any artefact used in an model-driven
engineering process [
          <xref ref-type="bibr" rid="ref3">3</xref>
          ]. However, the main challenge is the de nition of the model
quality metrics and the operationalization of the model quality frameworks
reported in terms of expressions that can generate metrics, and its association with
a model-driven development process.
        </p>
      </sec>
      <sec id="sec-3-2">
        <title>Acknowledgments</title>
        <p>F.G, thanks to Colciencias (Colombia) for funding this work through the
Colciencias Grant call 512-2010, and the Pan-American Software Quality Institute
(PASQI) for the participation and feedback received in the PASQI Workshop
2013. F.G. and M.P. thanks to David Racodon (david.racodon@sonarsource.com)
and Nicla Donno (nicla.donno@sonarsource.com) for their suppport with the
SQALE plugin for SonarQube. This work has been supported by the
Spanish MICINN PROS-Req (TIN2010-19130-C02-02), the Generalitat Valenciana
Project ORCA (PROMETEO/2009/015), the European Commission FP7 Project
CaaS (611351), and ERDF structural funds.</p>
      </sec>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <given-names>Marco</given-names>
            <surname>Brambilla</surname>
          </string-name>
          , Jordi Cabot, and
          <string-name>
            <given-names>Manuel</given-names>
            <surname>Wimmer</surname>
          </string-name>
          .
          <source>Model-Driven Software Engineering in Practice. Synthesis Lectures on Software Engineering</source>
          . Morgan &amp; Claypool Publishers,
          <year>2012</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <surname>David</surname>
            <given-names>W.</given-names>
          </string-name>
          <string-name>
            <surname>Embley</surname>
            , Stephen W. Liddle, and
            <given-names>Oscar</given-names>
          </string-name>
          <string-name>
            <surname>Pastor</surname>
          </string-name>
          .
          <article-title>Conceptual-model programming: A manifesto</article-title>
          . In David W. Embley and Bernhard Thalheim, editors,
          <source>Handbook of Conceptual Modeling</source>
          , pages
          <fpage>3</fpage>
          <lpage>{</lpage>
          16. Springer Berlin Heidelberg,
          <year>2011</year>
          . ISBN 978-3-
          <fpage>642</fpage>
          -15864-3.
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <surname>Bertoa</surname>
            Manuel F. and
            <given-names>Vallecillo</given-names>
          </string-name>
          <string-name>
            <surname>Antonio</surname>
          </string-name>
          .
          <article-title>Quality attributes for software metamodels</article-title>
          .
          <source>In Proc. of 13th TOOLS workshop on quantitatives approaches in objectoriented software engineering. QAAOSE</source>
          <year>2010</year>
          .
          <article-title>July 2nd</article-title>
          .
          <string-name>
            <surname>Malaga</surname>
          </string-name>
          , Spain,
          <year>February 2010</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <given-names>D.</given-names>
            <surname>Falessi</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.A.</given-names>
            <surname>Shaw</surname>
          </string-name>
          ,
          <string-name>
            <given-names>F.</given-names>
            <surname>Shull</surname>
          </string-name>
          ,
          <string-name>
            <given-names>K.</given-names>
            <surname>Mullen</surname>
          </string-name>
          , and
          <string-name>
            <given-names>M.S.</given-names>
            <surname>Keymind</surname>
          </string-name>
          .
          <article-title>Practical considerations, challenges, and requirements of tool-support for managing technical debt</article-title>
          .
          <source>In Managing Technical Debt (MTD)</source>
          ,
          <year>2013</year>
          4th International Workshop on, pages
          <volume>16</volume>
          {
          <fpage>19</fpage>
          ,
          <year>2013</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <given-names>Peter</given-names>
            <surname>Fettke</surname>
          </string-name>
          , Constantin Houy,
          <string-name>
            <surname>Armella-Lucia Vella</surname>
            , and
            <given-names>Peter</given-names>
          </string-name>
          <string-name>
            <surname>Loos</surname>
          </string-name>
          .
          <article-title>Towards the reconstruction and evaluation of conceptual model quality discourses - methodical framework and application in the context of model understandability</article-title>
          .
          <source>In Ilia Bider, Terry A. Halpin</source>
          , John Krogstie, Selmin Nurcan, Erik Proper, Rainer Schmidt, Pnina So er, and Stanislaw Wrycza, editors,
          <source>BMMDS/EMMSAD</source>
          , volume
          <volume>113</volume>
          <source>of Lecture Notes in Business Information Processing</source>
          , pages
          <volume>406</volume>
          {
          <fpage>421</fpage>
          . Springer,
          <year>2012</year>
          . ISBN 978-3-
          <fpage>642</fpage>
          -31071-3.
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <given-names>C.</given-names>
            <surname>Izurieta</surname>
          </string-name>
          ,
          <string-name>
            <surname>I.</surname>
          </string-name>
          <article-title>Gri th, D. Reimanis, and</article-title>
          <string-name>
            <given-names>R.</given-names>
            <surname>Luhr</surname>
          </string-name>
          .
          <article-title>On the uncertainty of technical debt measurements</article-title>
          .
          <source>In Information Science and Applications (ICISA)</source>
          ,
          <source>2013 International Conference on, pages 1{4</source>
          ,
          <year>2013</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7.
          <string-name>
            <given-names>John</given-names>
            <surname>Krogstie</surname>
          </string-name>
          .
          <article-title>Quality of models</article-title>
          .
          <source>In Model-Based Development and Evolution of Information Systems</source>
          , pages
          <fpage>205</fpage>
          {
          <fpage>247</fpage>
          . Springer London,
          <year>2012</year>
          . ISBN 978-1-
          <fpage>4471</fpage>
          - 2935-6.
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          8.
          <string-name>
            <given-names>C.F.J.</given-names>
            <surname>Lange</surname>
          </string-name>
          and
          <string-name>
            <given-names>M.R.V.</given-names>
            <surname>Chaudron</surname>
          </string-name>
          .
          <article-title>Managing Model Quality in UML-Based Software Development</article-title>
          .
          <source>In Software Technology and Engineering Practice</source>
          ,
          <year>2005</year>
          . 13th IEEE International Workshop on, pages
          <volume>7</volume>
          {
          <fpage>16</fpage>
          ,
          <year>2005</year>
          . LCCN 0029.
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          9. Beatriz Mar n, Giovanni Giachetti, Oscar Pastor, and
          <string-name>
            <given-names>Alain</given-names>
            <surname>Abran</surname>
          </string-name>
          .
          <article-title>A quality model for conceptual models of mdd environments</article-title>
          .
          <source>Adv. Soft. Eng.</source>
          ,
          <year>2010</year>
          :
          <volume>1</volume>
          :
          <issue>1</issue>
          {1:
          <fpage>17</fpage>
          ,
          <year>January 2010</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          10.
          <string-name>
            <given-names>Parastoo</given-names>
            <surname>Mohagheghi</surname>
          </string-name>
          and
          <string-name>
            <given-names>Vegard</given-names>
            <surname>Dehlen</surname>
          </string-name>
          .
          <article-title>Developing a quality framework for model-driven engineering</article-title>
          . In Holger Giese, editor,
          <source>Models in Software Engineering</source>
          , volume
          <volume>5002</volume>
          of Lecture Notes in Computer Science, pages
          <volume>275</volume>
          {
          <fpage>286</fpage>
          . Springer Berlin Heidelberg,
          <year>2008</year>
          . ISBN 978-3-
          <fpage>540</fpage>
          -69069-6.
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          11. Daniel L. Moody. The '
          <article-title>physics' of notations: Toward a scienti c basis for constructing visual notations in software engineering</article-title>
          .
          <source>IEEE Transactions on Software Engineering</source>
          ,
          <volume>35</volume>
          (
          <issue>6</issue>
          ):
          <volume>756</volume>
          {
          <fpage>779</fpage>
          ,
          <year>2009</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          12.
          <string-name>
            <surname>R.L. Nord</surname>
            ,
            <given-names>I. Ozkaya</given-names>
          </string-name>
          ,
          <string-name>
            <given-names>P.</given-names>
            <surname>Kruchten</surname>
          </string-name>
          , and
          <string-name>
            <given-names>M.</given-names>
            <surname>Gonzalez-Rojas</surname>
          </string-name>
          .
          <article-title>In search of a metric for managing architectural technical debt</article-title>
          .
          <source>In Software Architecture (WICSA) and European Conference on Software Architecture (ECSA)</source>
          ,
          <year>2012</year>
          Joint Working IEEE/IFIP Conference on, pages
          <volume>91</volume>
          {
          <fpage>100</fpage>
          ,
          <year>2012</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          13.
          <string-name>
            <given-names>Carolyn</given-names>
            <surname>Seaman</surname>
          </string-name>
          and
          <string-name>
            <given-names>Yuepu</given-names>
            <surname>Guo</surname>
          </string-name>
          . Chapter 2
          <article-title>- measuring and monitoring technical debt</article-title>
          . volume
          <volume>82</volume>
          of Advances in Computers, pages
          <volume>25</volume>
          {
          <fpage>46</fpage>
          .
          <string-name>
            <surname>Elsevier</surname>
          </string-name>
          ,
          <year>2011</year>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>