<!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>QuARS A NLP Tool for Requirements Analysis</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Stefania Gnesi</string-name>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Gianluca Trentanni</string-name>
        </contrib>
        <contrib contrib-type="author">
          <string-name>CNR-ISTI</string-name>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Italy stefania.gnesi@isti.cnr.it</string-name>
        </contrib>
        <contrib contrib-type="author">
          <string-name>gianluca.trentanni@isti.cnr.it</string-name>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Quality Analysis of NL Requirements: QuARS</string-name>
        </contrib>
      </contrib-group>
      <pub-date>
        <year>2019</year>
      </pub-date>
      <abstract>
        <p>QuARS (Quality Analyzer for Requirements Speci cations) is a tool able to perform an analysis of Natural Language (NL) requirements in a systematic and an automatic way by means of natural language processing techniques with a focus on ambiguity detection. QuARS allows the requirements engineers to perform an early analysis of the requirements for automatically detecting potential linguistic defects.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>Using QuARS</title>
      <p>QuARS performs a linguistic analysis of a requirement document in plain text format and points out the sentences
that are defective according to the expressiveness quality model according to the process depicted in Figure 1.</p>
      <p>The defect identi cation process is split in two parts: (i) the "lexical analysis" capturing optionality,
subjectivity, vagueness, and weakness defects by identifying candidate defective words that are identi ed into a
corresponding set of dictionaries; and (ii) the "syntactical analysis" capturing implicity, multiplicity and
underspeci cation defects.</p>
      <p>Optionality means that the requirement contains an optional part (i.e. a part that can or cannot be
considered) and example of Optionality-revealing words are: possibly, eventually, in case, if possible, if
appropriate, if needed, . . . .</p>
      <p>Subjectivity means that the requirement expresses personal opinions or feelings, i.e. similar, similarly, having
in mind, take into account, as [adjective] as possible,. . . .</p>
      <p>Vagueness means that the requirement contains words having a no uniquely quanti able meaning and
example of Vagueness-revealing words are: adequate, bad, clear, close, easy, far, fast, good, in front, near,
recent, signi cant, slow, strong, suitable, useful, . . . .</p>
      <p>Weakness means that the sentence contains a "weak" verb. A verb that makes the sentence not imperative
is considered weak (i.e. can, could, may, . . . ).</p>
      <p>Implicitly means that the requirement does not specify the subject or object by means of its speci c name but
uses a pronoun or other indirect reference. Demonstrative adjectives (this, these, that, those) or Pronouns
(it, they...) or terms having the determiner expressed by a demonstrative adjective (this, these, that, those)
or implicit adjective (i.e. previous, next, following, last...) or preposition (i.e. above, below...) are considered
implicity indicators.</p>
      <p>Multiplicity: the occurrence of multiplicity-revealing terms: and/or, or, ... is considered a multiplicity
indicator, as well as the presence of itemized lists.</p>
      <p>Under-speci cation means that the requirement contains a word identifying a class of objects without a
modi er specifying an instance of this class. The occurrence of wordings needing to be instantiated (i.e.
information, interface, that must be better de ned, ow instead of data ow, control ow, access instead of
write access, remote access, authorized access, testing instead of functional testing, structural testing, unit
testing, etc.) is considered an under-speci cation indicator.</p>
      <p>Negative Examples
the system shall be.., possibly without..
..in the largest extent as possible..
the C code shall be clearly commented..
the initialization checks may be reported..
the above requirements shall be veri ed..
the mean time..and restore service..</p>
      <p>..be able to run also in case of attack.</p>
      <p>In Table 1 we can see some examples of requirements that contain linguistic defects.</p>
      <p>
        When the analysis is performed, the list of defective sentences is displayed by QuARS and a log le is created.
The defective sentences can be tracked in the input requirements document and corrected, if necessary. Metrics
measuring the defect rate and the readability of the requirements document under analysis are calculated and
stored. The available metrics are the Coleman-Liau Formula readability metrics [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ] an the defect rate (i.e. the
number of defective sentences / the total number of sentences).
1.2
      </p>
    </sec>
    <sec id="sec-2">
      <title>Ambiguity versus Variability</title>
      <p>
        Ambiguity defects that are found in a requirements document may be due to, intentional or unintentional,
references made in the requirements to issues that may be solved in di erent ways, possibly envisioning a set of
di erent products rather than a slngle product. We therefore can use the analysis ability of QuARS to elicit
the potential variability hidden in a requirement document. Variability may be due to vagueness and vagueness
occurs whenever a requirement admits borderline cases, e.g., cases in which the truth value of the sentence
cannot be decided since vague terms are used in it. QuARS allows the creation of new dictionaries useful for
de ning new indicators characterising potential variability in requirements. Variability may be revealed by the
occurrence of variability-revealing terms such as: if, where, whether, when, choose, choice, implemented,
implement, implements, provided, provide, provides, available, feature, range, select, selected, selects, con gurable,
con gurate, . . . [
        <xref ref-type="bibr" rid="ref11">11</xref>
        ].
1.3
      </p>
    </sec>
    <sec id="sec-3">
      <title>QuARS User Interface</title>
      <p>The QuARS GUI is composed of three main frames. The Input Frame that allows to load, display and edit input
le containing the requirements to be analyzed (the supported le format is plain text). The Dictionary Frame
that allows the user to select, display and edit the dictionary corresponding to the type of analysis of interest.
The Output Frame where the results of the analysis are displayed. Figure 2 shows the QuARS GUI. Figure 3
reports the output of an analysis performed according to the vagueness criterion.
2</p>
      <p>
        QuARS: Application Experiences
QuARS has evolved from an initial prototype to the current reliable and user-friendly version after subsequent
experiments over several case studies aimed at evaluating the e ectiveness of the methodology and identifying
improvement opportunities in terms of both usability and provided functionalities. Some of the case studies [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ]
came from industrial projects and these belonged to several application domains. More recently, two di erent
experiences have been reported to automatically identify quality defects in natural language requirements in the
Railway Domain by using QuARS and the SREE tool, that is an extension of QuARS de ned by means of the
GATE tool in [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ] and [
        <xref ref-type="bibr" rid="ref12">12</xref>
        ].
      </p>
      <p>In [?, 10] QuARS has been instead used to study a classi cation of the forms of ambiguity that indicate variation
points starting from the analysis of documents describing real systems, since ambiguity or underspeci cation
at requirements level can in some cases give an indication of possible variability, either in design choices, in
implementation choices or con gurability.</p>
      <p>All these experiments provided us with feedbacks to evolve the tool itself, and allowed us to gather a record
of information on the:</p>
      <p>E ectiveness of the tool in nding defects: the number of defects found in the NL requirement document
depends more on the experience and skill of the requirements engineer than on the company maturity.
Frequency and typology of false positives: the presence of false positives has been observed in every case
study. It can be considered as a physiological side e ect of the application of the tool. The rate of false
positives respect to actual defects has been rarely over 10%.</p>
      <p>E ort required to apply the tool and to tailor the dictionaries for speci c application: the e ort required to
perform the analysis of a requirements document is relatively low. The main e ort is due to the preparation
of the input document since this has to be in plain text format.</p>
    </sec>
    <sec id="sec-4">
      <title>Acknowledgements</title>
      <p>This work was partially supported by the H2020 Shift2Rail project AstRAIL.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <given-names>Meri</given-names>
            <surname>Coleman</surname>
          </string-name>
          ,
          <string-name>
            <given-names>T. L.</given-names>
            <surname>Liau</surname>
          </string-name>
          ,
          <article-title>A computer readability formula designed for machine?scoring</article-title>
          .
          <source>Journal of Applied Psychology</source>
          ,
          <volume>60</volume>
          ,
          <fpage>283</fpage>
          -
          <lpage>284</lpage>
          .
          <year>1975</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <given-names>Fabrizio</given-names>
            <surname>Fabbrini</surname>
          </string-name>
          , Mario Fusani, Vincenzo Gervasi, Stefania Gnesi,
          <source>Salvatore Ruggieri: On Linguistic Quality of Natural Language Requirements. 4th REFSQ</source>
          ,
          <fpage>57</fpage>
          -
          <lpage>62</lpage>
          , Presses Universitaires de Namur,
          <year>1998</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <given-names>Fabrizio</given-names>
            <surname>Fabbrini</surname>
          </string-name>
          , Mario Fusani, Stefania Gnesi, Giuseppe Lami:
          <article-title>The linguistic approach to the natural language requirements quality: bene t of the use of an automatic tool</article-title>
          , 26th
          <source>Annual NASA Software Engineering Workshop</source>
          ,
          <fpage>97</fpage>
          -
          <lpage>105</lpage>
          , IEEE,
          <year>2001</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <given-names>Fabrizio</given-names>
            <surname>Fabbrini</surname>
          </string-name>
          , Mario Fusani, Stefania Gnesi,
          <string-name>
            <given-names>Giuseppe</given-names>
            <surname>Lami</surname>
          </string-name>
          ,
          <article-title>An automatic quality evaluation for natural language requirements</article-title>
          ,
          <source>7th REFSQ</source>
          ,
          <year>2001</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <given-names>Stefania</given-names>
            <surname>Gnesi</surname>
          </string-name>
          , Giuseppe Lami, Gianluca Trentanni:
          <article-title>An automatic tool for the analysis of natural language requirements</article-title>
          .
          <source>Computer. Systems: Science &amp; Engineering</source>
          .
          <volume>20</volume>
          (
          <issue>1</issue>
          ),
          <year>2005</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [6]
          <string-name>
            <surname>Daniel</surname>
            <given-names>M.</given-names>
          </string-name>
          <string-name>
            <surname>Berry</surname>
          </string-name>
          , Erik Kamsties, Michael M.
          <article-title>Krieger: From Contract Drafting to Software Speci cation: Linguistic Sources of Ambiguity</article-title>
          . University of Waterloo,
          <year>2017</year>
          . https://cs.uwaterloo.ca/~dberry/handbook/ ambiguityHandbook.pdf
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [7]
          <string-name>
            <surname>Daniel</surname>
            <given-names>M Berry</given-names>
          </string-name>
          , Antonio Bucchiarone, Stefania Gnesi, Giuseppe Lami,
          <string-name>
            <given-names>Gianluca</given-names>
            <surname>Trentanni</surname>
          </string-name>
          ,
          <article-title>A new quality model for natural language requirements speci cations</article-title>
          ,
          <source>Proceedings of the international workshop on requirements engineering: foundation of software quality, 12th REFSQ</source>
          ,
          <year>2006</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          [8]
          <string-name>
            <given-names>Antonio</given-names>
            <surname>Bucchiarone</surname>
          </string-name>
          , Stefania Gnesi, Gianluca Trentanni, Alessandro Fantechi:
          <article-title>Evaluation of Natural Language Requirements in the MODCONTROL Project</article-title>
          ,
          <source>ERCIM News</source>
          <year>2008</year>
          (
          <volume>75</volume>
          ),
          <year>2008</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          [9]
          <string-name>
            <given-names>Alessandro</given-names>
            <surname>Fantechi</surname>
          </string-name>
          , Stefania Gnesi, Laura Semini:
          <article-title>Ambiguity defects as variation points in requirements</article-title>
          . 11th VaMoS:
          <fpage>13</fpage>
          -
          <lpage>19</lpage>
          , ACM,
          <year>2017</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          [10]
          <string-name>
            <surname>Alessandro</surname>
            <given-names>Fantechi</given-names>
          </string-name>
          , Alessio Ferrari, Stefania Gnesi, Laura Semini:
          <article-title>Hacking an Ambiguity Detection Tool to Extract Variation Points: an Experience Report</article-title>
          , 12th VaMoS:
          <fpage>43</fpage>
          -
          <lpage>50</lpage>
          , ACM,
          <year>2018</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          [11]
          <string-name>
            <surname>Alessandro</surname>
            <given-names>Fantechi</given-names>
          </string-name>
          , Alessio Ferrari, Stefania Gnesi, Laura Semini:
          <article-title>Requirement Engineering of Software Product Lines: Extracting Variability using NLP</article-title>
          ,
          <source>26th RE</source>
          <year>2018</year>
          :
          <fpage>418</fpage>
          -
          <lpage>423</lpage>
          , IEEE,
          <year>2018</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          [12]
          <string-name>
            <surname>Benedetta</surname>
            <given-names>Rosadini</given-names>
          </string-name>
          , Alessio Ferrari, Gloria Gori, Alessandro Fantechi, Stefania Gnesi, Iacopo Trotta, Stefano Bacherini:
          <article-title>Using NLP to Detect Requirements Defects: An Industrial Experience in the Railway Domain</article-title>
          .
          <source>23rd REFSQ</source>
          , LNCS
          <volume>10153</volume>
          ,
          <fpage>344</fpage>
          -
          <lpage>360</lpage>
          ,
          <year>Springer 2017</year>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>