<!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>
      <journal-title-group>
        <journal-title>Workshops, OpenRE, Posters and
Tools Track, and Doctoral Symposium, Essen, Germany</journal-title>
      </journal-title-group>
    </journal-meta>
    <article-meta>
      <title-group>
        <article-title>Hanfor: Semantic Requirements Review at Scale</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Samuel Becker</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Daniel Dietsch</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Nico Hauf</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Elisabeth Henkel</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Vincent Langenfeld</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Andreas Podelski</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Bernd Westphal</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Department of Computer Science, University of Freiburg</institution>
          ,
          <country country="DE">Germany</country>
        </aff>
      </contrib-group>
      <pub-date>
        <year>2021</year>
      </pub-date>
      <volume>1</volume>
      <fpage>2</fpage>
      <lpage>04</lpage>
      <abstract>
        <p>[Context &amp; Motivation] Formal analysis of requirements finds relevant problems (overlooked in reviews), but needs formal requirements. [Question/Problem] We address the problem of tool support for a semantical review of readily elicited requirements, that is based on formal analysis. [Pricipal ideas/results] Dedicated tool support for a semantical review process supports the delegation of the formalisation task to less experienced workers. [Contribution] We present Hanfor, a web based tool used to support formalisation in several industry projects. A video demonstration is available at struebli.informatik.uni-freiburg.de/refsq2021.</p>
      </abstract>
      <kwd-group>
        <kwd>eol&gt;Formal Requirements Analysis</kwd>
        <kwd>Structured Requirements Review</kwd>
        <kwd>Tool supported Review</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>1. Introduction</title>
      <p>
        Well-known issues with the properties from IEEE 830 and 29148 are that they are
characterised informally and that the standard documents do not provide a practical
procedure to ensure the absence of undesired properties. Recent works have proposed
formal characterisations of properties such as consistency and vacuity and provide
automated analyses of sets of formal requirements for these properties (e.g., [
        <xref ref-type="bibr" rid="ref6 ref7 ref8">6, 7, 8</xref>
        ]).
Still, one issue remains: Today’s requirements are provided in natural language and the
procedures named above need formal, mathematical requirements descriptions.
      </p>
      <p>
        The Dietsch-Langenfeld-Process (DLP) [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ]
is a process model for a semantic review of re- rreaqw. Hanfor report
quirements through their formalisation, hence
addressing the latter issue. A DLP client (cf. ℬ ℬ
Figure 1) provides a set of informally described Client Supervisor Worker Supervisor Client
requirements, the so-called raw requirements, Figure 1: Dietsch-Langenfeld-Process.
and receives a report on semantic issues
(including a formalisation of the raw requirements). The review is conducted by persons
assuming supervisor and worker roles. The supervisor receives the raw requirements
from the client, oversees the formalisation and analysis of requirements done by the
workers, and delivers the report on semantic issues to the client. A worker is assigned a
set of requirements and for each requirement proposes a formalisation (using a pattern
language such as [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ]). If all stakeholders agree on this formalisation, the formal analysis
backend(s) are applied to the coded requirements.
      </p>
      <p>In this paper, we describe Hanfor, a web-based tool that supports the supervisor and
worker role in the DLP. A main design goal of Hanfor was to ease the formalisation of
large requirements sets by people who are particularly trained for their work (rather than
addressing the casual user). The tool consists of a light-weight selection of requirements
management features, a formalisation editor, and a powerful analysis back-end.</p>
    </sec>
    <sec id="sec-2">
      <title>2. Workflow and Interaction with Hanfor</title>
      <p>Following Figure 1, this section describes how Hanfor supports the DLP.</p>
      <p>Pre-Processing of Raw Requirements. In the DLP context, a raw requirement consists
of a unique identifier , a textual description, and a type as in (Req_3, Apply power
supply standard EN50163, Info). Form of identifiers and types are not constrained
by Hanfor to support any type conventions on the client’s side. The raw requirements
undergo a first sight check by the supervisor supported by the client where both agree
on a set of types and their meaning and obvious issues are resolved. Type ‘Info’ may,
e.g., label requirements that are included in the requirements document but should not
be subject to formalisation.</p>
      <p>Formalisation. In DLP, the formalisation of the pre-processed raw requirements is
conducted by workers. Hanfor’s main page (see Figure 2) is the central workspace for
them. The workspace is a tabular view on requirements, where the raw requirement
triples are shown in columns ‘Id’, ‘Description’, and ‘Type’ (‘Pos’ is added as a unique
Hanfor identifier to retain the original ordering).</p>
      <p>The DLP assigns each requirement a status (cf. Figure 3). Ideally, each
requirement reaches the status ‘Done’, indicating that the requirement has been formalised
and its formalization is agreed on. Initially, all requirements have status ‘Todo’ and
may alternate between ‘Todo’ and ‘Review’. Workers try to propose a formalisation
and change the status to ‘Review’. If there are issues during formalisation (e.g.
unclear mapping to variables, or properties not expressible in the considered pattern
language), the worker uses Hanfor tags to document the issue (e.g., row 3 in Figure 2).
Requirements with status ‘Review’ and issue tags are
setxaatmusincehdanbygetshbeascukpteorv‘iTsoordoa’n;dw,iitfhroeustolivsesdu,e tthaegisr • TodroeamdodveisosiksuseuetatgRageview ok Done
they are scheduled for the formal analysis (like row
0 in Figure 2). That is, intuitively, the formalisation Figure 3: Requirement status model.
activity is about transforming rows like 1 and 3 in Figure 2 to the appearance of the
other rows by filling in ‘Tags’, ‘Status’, and ‘Formalisation’.</p>
      <p>Pattern Editor. Formalisation (or coding) of a raw requirement with a pattern
catalogue means to understand the constraints that the raw requirement expresses, to
choose the corresponding pattern, and to provide values for the pattern’s parameters such
as expressions over variables or durations. Consider requirement Req_2 for example. It
states a constraint on the observation of particular values for (boolean) variable Activate
and (enumeration type) variable State with a time bound. The matching pattern is
a bounded response ( responds to  ) with upper bound  . To formalise Req_2, one
opens its editor by clicking on its ‘Id’. Figure 4a shows the initial editor form with the
description repeated. To add a formalisation (some requirements need more than one),
one clicks on one of the green ‘+’-buttons, which open the form shown in Figure 4b.
Here, the pattern is instantiated with blanks for the values  ,  , and  below1.</p>
      <p>
        Analysis. Once a set of requirements has a formalisation and no issue tags, it can be
passed to the formal analysis back-end ReqCheck [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ], which checks for inconsistency,
rtinconsistency, and vacuity. If any of these undesired properties are detected, ReqCheck
provides diagnostic input in form of a minimal core set of inconsistent requirements,
1Pattern in [
        <xref ref-type="bibr" rid="ref3 ref4 ref5">3, 4, 5</xref>
        ] also supportscopes e.g., apply constraints only between two time points  and  .
      </p>
      <p>(a) Initial view.
a timing diagram, and the set of vacuous requirements, respectively. The results are
considered by the supervisor and presented to the client (cf. Figure 1) in a proper
document including raw requirements, formalisation, and findings. If the client is able to
resolve some of the issues, the process may be iterated.</p>
      <p>Hanfor Support for Large Requirements Sets. One design goal for Hanfor was
to support workers in processing large sets of requirements (10s or 100s) conveniently,
eficiently, and efectively. To this end, Hanfor ofers a rich selection of eficient tools to
navigate the table (sort by column, search whole table or selected columns (partial and
exact match), filter by status, tag, type, etc.). Diferent actions can be applied to batches
of requirements, e.g., to change the status of all requirements of type ‘Info’ to ‘Done’.</p>
      <p>The pattern editor provides auto-completion, e.g., for variables and tags, on-the-fly
creation of variables (including type inference), and can suggest a pattern based on
matching the raw requirements (most useful if the client side states requirements in
some standardised grammar). Note that suggestions are supposed to support the human
workers rather than replace them as the DLP is about human natural language processing,
not automatic NLP. Already in the editor, light-weight checks such as type checking are
applied. Existing variables can be searched, sorted, and imported (tab ‘Variables’), and
tags can be searched, sorted, and customised (name, colour, description; tab ‘Tags’). In
addition, the Hanfor repository is fully versioned (top right corner of Figure 2).</p>
    </sec>
    <sec id="sec-3">
      <title>3. Architecture and Inner Workings</title>
      <p>Hanfor is a web application built with Python 3, the Flask web application toolkit, and
JavaScript. Fig. 5 shows the architecture of Hanfor and its companion tool Ultimate
ReqCheck2. Each Hanfor session stores raw requirements provided as .csv file for each
revision together with specific attributes, e.g., the tags associated with a requirement or
the formalisation, in flat files on disk. This session storage also contains meta information
about tags, and all typed variables and their constraints. In a review session, a ‘Worker’
selects raw requirements, adds tags, and formalises it by a pattern. The pattern is selected
manually or picked from the recommendations of the guesser component. Instantiation
of patterns (with expressions over variables) is guarded by the syntax and type checker
2Both tools are available at ultimate-pa.github.io/hanfor under the LGPLv3 open source license.
ℬ</p>
      <p>Req</p>
      <p>Tags</p>
      <p>Variables
Configuration</p>
      <p>Pattern
Expr.</p>
      <p>Grammar
Typing
Rules
Workflow
Req
Hanfor
Manual
Worker
Guesser</p>
      <sec id="sec-3-1">
        <title>Pea2 BPL Boogie BPL</title>
        <p>Boogie Prepr.</p>
      </sec>
      <sec id="sec-3-2">
        <title>Icfg ICFG Trace</title>
        <p>Builder Abstr.</p>
        <p>Tags
Formal Req</p>
        <p>Tag &amp;
Formalize</p>
        <p>Tags
Syntax
Checker</p>
        <p>Tags
Variables
Typecheck.
&amp; Infer.</p>
        <p>Report</p>
        <p>ℬ
Client
components that inform the worker about possible errors. The type inference component
infers types for new variables from their usage. If a new version of the raw requirements
is submitted by the client, Hanfor automatically identifies changed, added, or removed
requirements, changes their status and tags them for re-review.</p>
        <p>
          A set of formalised requirements can be exported for analysis by ReqCheck.
Ultimate ReqCheck is a software model checking tool that extends Ultimate
Automizer [
          <xref ref-type="bibr" rid="ref11">11</xref>
          ] with two components: ReqParser (cf. Fig. 5) parses formalised requirements
and transforms them via Duration Calculus [
          <xref ref-type="bibr" rid="ref12">12</xref>
          ] to Phase Event Automata (PEA) [
          <xref ref-type="bibr" rid="ref6">6</xref>
          ] and
Pea2Boogie transforms a network of PEAs into a Boogie [
          <xref ref-type="bibr" rid="ref13">13</xref>
          ] program, which encodes
requirement properties as program analysis task [
          <xref ref-type="bibr" rid="ref6">6</xref>
          ]. A modified version of Automizer
(represented by the remaining three components in Fig. 5) verifies the resulting Boogie
program and performs post-processing steps to isolate reasons for possible property
violations, which are then collated into a report. Through Hanfor’s configuration, the
supervisor can add or remove patterns, types, and extend the expression language (which
is a subset of Boogie expressions) with new functions or operators.
        </p>
      </sec>
    </sec>
    <sec id="sec-4">
      <title>4. Conclusion</title>
      <p>
        We have presented Hanfor, a web-based tool for requirements formalisation and semantic
analysis. A novelty of Hanfor is its co-development with a defined review process, the
DLP [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ]. By its architecture, Hanfor supports research into the expressiveness and
applicability of pattern languages, into the ergonomics of requirements formalisation at
large(r) scale, and tool-based semantic review of requirements as a service, which is the
very goal of the DLP.
      </p>
      <p>
        We have used (and continuously improved) Hanfor on industrial requirements sets
of between 20 and 1000 raw requirements from the automotive and railway domain
(cf. [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ]). The worker role has been assumed by diferent workers (including PhD and
graduate students with diferent previous knowledge) and a post-doc as supervisor. In the
experiments, the tabular representation and the powerful filtering and sorting features
were found adequate. Most formalisations can be done on a requirement by requirement
basis, and the ones that are harder to formalise often benefit from eficient access to
the neighbouring requirements and meta information. Hanfor features such as
autocompletion, and type inference and checking enable efective and eficient formalisation:
Auto-completion allows the workers to focus on the formalisation at hand, and type
inference suggests many variable types after only few requirements have been formalised
and thus gives an additional consistency check with immediate feedback to the worker.
These light-weight analyses also prevent roadblocks due to careless mistakes in the
subsequent formal analysis. Overall we learned, that, with a tool supporting the process
an preventing careless mistakes, the formalisation of a set of requirements can be done
by workers with a basic understanding of requirements engineering and the requirements
patterns. Our clients were fond of the information supplied by the reports aggregated
from the tags applied during the formalisation process as well as the analysis results.
      </p>
    </sec>
    <sec id="sec-5">
      <title>Acknowledgments</title>
      <p>Author B. Westphal was supported by the DFG under reference no. WE 6198/1-1.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1] IEEE,
          <string-name>
            <surname>Recomm</surname>
          </string-name>
          .
          <source>Practice for Software Requirements Specifications</source>
          ,
          <year>1998</year>
          .
          <volume>830</volume>
          :
          <year>1998</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          <source>[2] IEEE, Systems and software eng</source>
          . - Requirements engineering,
          <year>2018</year>
          .
          <volume>29148</volume>
          :
          <year>2018</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <given-names>A.</given-names>
            <surname>Post</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Hoenicke</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Podelski</surname>
          </string-name>
          ,
          <article-title>Vacuous real-time requirements</article-title>
          , in: RE, IEEE,
          <year>2011</year>
          , pp.
          <fpage>153</fpage>
          -
          <lpage>162</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <given-names>A.</given-names>
            <surname>Post</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Hoenicke</surname>
          </string-name>
          ,
          <string-name>
            <surname>A.</surname>
          </string-name>
          <article-title>Podelski, rt-inconsistency: A new property for real-time requirements</article-title>
          ,
          <source>in: FASE</source>
          , volume
          <volume>6603</volume>
          <source>of LNCS</source>
          , Springer,
          <year>2011</year>
          , pp.
          <fpage>34</fpage>
          -
          <lpage>49</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <given-names>A.</given-names>
            <surname>Post</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Hoenicke</surname>
          </string-name>
          ,
          <article-title>Formalization and analysis of real-time requirements</article-title>
          ,
          <source>in: VSTTE</source>
          , volume
          <volume>7152</volume>
          <source>of LNCS</source>
          , Springer,
          <year>2012</year>
          , pp.
          <fpage>225</fpage>
          -
          <lpage>240</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [6]
          <string-name>
            <given-names>V.</given-names>
            <surname>Langenfeld</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            <surname>Dietsch</surname>
          </string-name>
          ,
          <string-name>
            <given-names>B.</given-names>
            <surname>Westphal</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Hoenicke</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Post</surname>
          </string-name>
          ,
          <article-title>Scalable analysis of real-time requirements</article-title>
          , in: RE, IEEE,
          <year>2019</year>
          , pp.
          <fpage>234</fpage>
          -
          <lpage>244</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [7]
          <string-name>
            <given-names>A.</given-names>
            <surname>Moitra</surname>
          </string-name>
          ,
          <string-name>
            <given-names>K.</given-names>
            <surname>Siu</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A. W.</given-names>
            <surname>Crapo</surname>
          </string-name>
          , et al.,
          <article-title>Towards development of complete and conflict-free requirements</article-title>
          , in: RE, IEEE,
          <year>2018</year>
          , pp.
          <fpage>286</fpage>
          -
          <lpage>296</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          [8]
          <string-name>
            <given-names>A. W.</given-names>
            <surname>Fifarek</surname>
          </string-name>
          , et al.,
          <source>SpeAR v2</source>
          .
          <article-title>0: Formalized past LTL specification and analysis of requirements</article-title>
          , in: NFM, volume
          <volume>10227</volume>
          <source>of LNCS</source>
          ,
          <year>2017</year>
          , pp.
          <fpage>420</fpage>
          -
          <lpage>426</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          [9]
          <string-name>
            <given-names>D.</given-names>
            <surname>Dietsch</surname>
          </string-name>
          ,
          <string-name>
            <given-names>V.</given-names>
            <surname>Langenfeld</surname>
          </string-name>
          ,
          <string-name>
            <given-names>B.</given-names>
            <surname>Westphal</surname>
          </string-name>
          ,
          <article-title>Formal requirements in an informal world</article-title>
          , in: FORMREQ, IEEE,
          <year>2020</year>
          , pp.
          <fpage>14</fpage>
          -
          <lpage>20</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          [10]
          <string-name>
            <given-names>A.</given-names>
            <surname>Post</surname>
          </string-name>
          ,
          <string-name>
            <surname>I. Menzel</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Podelski</surname>
          </string-name>
          ,
          <article-title>Applying restricted english grammar on automotive requirements - does it work?</article-title>
          ,
          <source>in: REFSQ</source>
          ,
          <year>2011</year>
          , pp.
          <fpage>166</fpage>
          --
          <lpage>180</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          [11]
          <string-name>
            <given-names>M.</given-names>
            <surname>Heizmann</surname>
          </string-name>
          ,
          <string-name>
            <given-names>Y.</given-names>
            <surname>Chen</surname>
          </string-name>
          , et al.,
          <article-title>Ultimate automizer and the search for perfect interpolants</article-title>
          ,
          <source>in: TACAS (2)</source>
          , volume
          <volume>10806</volume>
          <source>of LNCS</source>
          , Springer,
          <year>2018</year>
          , pp.
          <fpage>447</fpage>
          -
          <lpage>451</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          [12]
          <string-name>
            <given-names>Z.</given-names>
            <surname>Chaochen</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M. R.</given-names>
            <surname>Hansen</surname>
          </string-name>
          , Duration Calculus,
          <string-name>
            <surname>MTCS</surname>
          </string-name>
          , Springer,
          <year>2004</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          [13]
          <string-name>
            <surname>K. R. M. Leino</surname>
          </string-name>
          , This is Boogie 2,
          <string-name>
            <surname>Manuscript</surname>
            <given-names>KRML</given-names>
          </string-name>
          178 (
          <year>2008</year>
          ).
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>