<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE article PUBLIC "-//TaxonX//DTD Taxonomic Treatment Publishing DTD v0 20100105//EN" "../../nlm/tax-treatment-NS0.dtd">
<article xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:tp="http://www.plazi.org/taxpub" article-type="research-article" dtd-version="3.0" xml:lang="en">
  <front>
    <journal-meta>
      <journal-id journal-id-type="publisher-id">109</journal-id>
      <journal-id journal-id-type="index">urn:lsid:arphahub.com:pub:3dc5f44e-8666-58db-bc76-a455210e8891</journal-id>
      <journal-title-group>
        <journal-title xml:lang="en">JUCS - Journal of Universal Computer Science</journal-title>
        <abbrev-journal-title xml:lang="en">jucs</abbrev-journal-title>
      </journal-title-group>
      <issn pub-type="ppub">0948-695X</issn>
      <issn pub-type="epub">0948-6968</issn>
      <publisher>
        <publisher-name>Journal of Universal Computer Science</publisher-name>
      </publisher>
    </journal-meta>
    <article-meta>
      <article-id pub-id-type="doi">10.3217/jucs-020-05-0746</article-id>
      <article-id pub-id-type="publisher-id">23190</article-id>
      <article-categories>
        <subj-group subj-group-type="heading">
          <subject>Research Article</subject>
        </subj-group>
        <subj-group subj-group-type="scientific_subject">
          <subject>D.2.3 - Coding Tools and Techniques</subject>
          <subject>D.2.7 - Distribution</subject>
          <subject> Maintenance</subject>
          <subject> and Enhancement</subject>
          <subject>D.3.4 - Processors</subject>
        </subj-group>
      </article-categories>
      <title-group>
        <article-title>A Catalogue of Refactorings to Remove Incomplete Annotations</article-title>
      </title-group>
      <contrib-group content-type="authors">
        <contrib contrib-type="author" corresp="yes">
          <name name-style="western">
            <surname>Medeiros</surname>
            <given-names>Flavio</given-names>
          </name>
          <email xlink:type="simple">flaviomedeiros@copin.ufcg.edu.br</email>
          <xref ref-type="aff" rid="A1">1</xref>
        </contrib>
        <contrib contrib-type="author" corresp="no">
          <name name-style="western">
            <surname>Ribeiro</surname>
            <given-names>Márcio</given-names>
          </name>
        </contrib>
        <contrib contrib-type="author" corresp="no">
          <name name-style="western">
            <surname>Gheyi</surname>
            <given-names>Rohit</given-names>
          </name>
          <xref ref-type="aff" rid="A2">2</xref>
        </contrib>
        <contrib contrib-type="author" corresp="no">
          <name name-style="western">
            <surname>Fonseca</surname>
            <given-names>Baldoino</given-names>
          </name>
          <xref ref-type="aff" rid="A3">3</xref>
        </contrib>
      </contrib-group>
      <aff id="A1">
        <label>1</label>
        <addr-line content-type="verbatim">Federal University of Campina Grande, Campina Grande, Brazil</addr-line>
        <institution>Federal University of Campina Grande</institution>
        <addr-line content-type="city">Campina Grande</addr-line>
        <country>Brazil</country>
      </aff>
      <aff id="A2">
        <label>2</label>
        <addr-line content-type="verbatim">Campina Grande, , Brazil</addr-line>
        <institution>Campina Grande</institution>
        <country>Brazil</country>
      </aff>
      <aff id="A3">
        <label>3</label>
        <addr-line content-type="verbatim">Federal University of Alagoas, Maceio, Brazil</addr-line>
        <institution>Federal University of Alagoas</institution>
        <addr-line content-type="city">Maceio</addr-line>
        <country>Brazil</country>
      </aff>
      <author-notes>
        <fn fn-type="corresp">
          <p>Corresponding author: Flavio Medeiros (<email xlink:type="simple">flaviomedeiros@copin.ufcg.edu.br</email>).</p>
        </fn>
        <fn fn-type="edited-by">
          <p>Academic editor: </p>
        </fn>
      </author-notes>
      <pub-date pub-type="collection">
        <year>2014</year>
      </pub-date>
      <pub-date pub-type="epub">
        <day>01</day>
        <month>05</month>
        <year>2014</year>
      </pub-date>
      <volume>20</volume>
      <issue>5</issue>
      <fpage>746</fpage>
      <lpage>771</lpage>
      <uri content-type="arpha" xlink:href="http://openbiodiv.net/35C56D97-53C5-5EF4-9858-9E9A7CDDE8D2">35C56D97-53C5-5EF4-9858-9E9A7CDDE8D2</uri>
      <uri content-type="zenodo_dep_id" xlink:href="https://zenodo.org/record/5505119">5505119</uri>
      <history>
        <date date-type="received">
          <day>28</day>
          <month>07</month>
          <year>2013</year>
        </date>
        <date date-type="accepted">
          <day>15</day>
          <month>02</month>
          <year>2013</year>
        </date>
      </history>
      <permissions>
        <copyright-statement>Flavio Medeiros, Márcio Ribeiro, Rohit Gheyi, Baldoino Fonseca</copyright-statement>
        <license license-type="creative-commons-attribution" xlink:href="" xlink:type="simple">
          <license-p>This article is freely available under the J.UCS Open Content License.</license-p>
        </license>
      </permissions>
      <abstract>
        <label>Abstract</label>
        <p>Developers use the C Preprocessor (CPP) to handle portability and variability in program families of different sizes and domains. However, despite the widely use of the CPP in practice, it is often criticised due to its negative impact on code quality and maintainability, tool development, and its error-prone characteristics. In particular, developers aggravate these problems when using incomplete annotations, i.e., directives encompassing only parts of syntactical units. In a previous work, we performed an empirical study on 41 C program family releases and found that almost 90% of syntax errors occur in incomplete annotations. There are some refactorings to remove incomplete annotations proposed in the literature. However, they clone code and increase Lines of Code (LOC). To avoid incomplete annotations and their intrinsic problems, in this article we propose a catalogue of refactorings that converts incomplete annotations into complete ones without cloning code. We implement an Eclipse plug-in to help developers applying our refactorings automatically. To evaluate our catalogue, we performed a study to analyse questions related to code cloning, LOC, and number of directives. To answer our research questions, we analyse releases of 12 C program families of different domains ranging from 4.9 thousand to 1.5 million LOC. The results show that our catalogue can remove all incomplete annotations without cloning code, and increasing only in 0.04% the LOC and in 2.10% the number of directives.</p>
      </abstract>
    </article-meta>
  </front>
</article>
