<!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>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Dimitra Giannakopoulou,</string-name>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Anastasia Mavridou, Julian Rhein,</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Johann Schumann, Nija Shi, KBR / NASA Ames Research Center</institution>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>Thomas Pressburger, NASA Ames Research Center</institution>
        </aff>
      </contrib-group>
      <pub-date>
        <year>2020</year>
      </pub-date>
      <abstract>
        <p>fret is a tool for writing, understanding, formalizing, and analyzing requirements. Users write requirements in an intuitive, restricted natural language, called fretish, with precise, unambiguous meaning. For a fretish requirement, fret: 1) produces natural language and diagrammatic explanations of its exact meaning, 2) formalizes the requirement in future-time and past-time temporal logic, and 3) supports interactive simulation of produced logic formulas to ensure that they capture user intentions. fret connects to analysis tools by facilitating the mapping between requirements and models/code, and by generating veri cation code. fret is available open source at https://github.com/NASA-SW-VnV/fret; a video can be accessed at: https://tinyurl.com/fretForREFSQ.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>Introduction</title>
      <p>
        Novelty. fret incorporates ideas from several existing approaches to requirements engineering. The structure
of fretish requirements includes features from temporal logic, the Speci cation Pattern System (SPS) [
        <xref ref-type="bibr" rid="ref4">5</xref>
        ], and
the Easy Approach to Requirements Syntax (EARS, [
        <xref ref-type="bibr" rid="ref12">13</xref>
        ]), implemented in tools like Prospec [
        <xref ref-type="bibr" rid="ref7">8</xref>
        ], SPIDER [
        <xref ref-type="bibr" rid="ref10">11</xref>
        ],
SpeAR [
        <xref ref-type="bibr" rid="ref6">7</xref>
        ], and EARS-CTRL [
        <xref ref-type="bibr" rid="ref11">12</xref>
        ]. In the commercial tool STIMULUS [
        <xref ref-type="bibr" rid="ref9">10</xref>
        ], requirements are built by assembling
phrases. The ASSERTTM [
        <xref ref-type="bibr" rid="ref3">4</xref>
        ] tool uses the constrained natural language SADL for formalizing domain ontologies,
and a requirements language SRL that expresses requirements as assignments to controlled variables conditioned
on (possibly temporal) conditions. The main goal of fret is to be an open source, extensible requirements
platform that can connect to external requirements analysis tools. As such, the fretish language and the
formalization capabilities aim at being inclusive, and for this reason are modular, and extensible. For example,
fret produces formalizations in both future-time and past-time metric linear temporal logic. Since we plan on
using fret in safety-critical contexts, ensuring correctness of the supported formalizations is key.
2
      </p>
    </sec>
    <sec id="sec-2">
      <title>Interacting with FRET</title>
      <p>
        This section describes a user's end-to-end interaction with fret through an example from the publicly-available
Lockheed Martin Cyber Physical Systems (LMCPS) challenge [
        <xref ref-type="bibr" rid="ref5">6</xref>
        ]. The application of fret to LMCPS is, to
date, the largest fret case study [15]. fret's entry point is a dashboard that summarizes the status of selected
projects, and provides a hierarchical view of all requirements, as shown in Figure 1 for LMCPS. The \Recent
Activity" tab summarizes requirements that were most recently edited, highlighting those that belong to the
selected project. Requirements can also be displayed in standard tabular form (see Figure 3).
      </p>
      <p>Requirements Elicitation. Figure 2 illustrates fret's requirements elicitation interface. fretish
requirement [AP-002a]:\in roll hold mode RollAutopilot shall always satisfy autopilot engaged &amp; no other lateral mode" expresses
the natural language description included in the \Rationale and Comments" eld. i.e., that the autopilot should
be engaged and no other lateral mode should be active when the Roll Autopilot is in roll hold mode. The
interface window consists of the editor, on the left, and a help tab on the right (gray background). The fretish
grammar, displayed as \railroad diagrams", is accessible from this view by clicking on the question mark.</p>
      <p>A fretish requirement description is automatically parsed into six sequential elds, with the fret editor
dynamically coloring the text corresponding to the elds as the requirement is typed in (Figure 2): scope,
condition, component , shall , timing , and response. Help and examples on each speci c eld can be displayed
in the help tab by clicking on the corresponding eld bubble. The mandatory component eld speci es the
component that the requirement applies to (RollAutopilot). The shall keyword states that the component
behavior must conform to the requirement. The response eld currently is of the form satisfy R, where R is a
non-temporal Boolean-valued expression.</p>
      <p>Field scope (optional) states that the requirement is only relevant in speci c scopes of the system behavior,
for example when the system is \in roll hold mode". The Boolean expression eld condition (optional) states that,
within the speci ed mode, the requirement becomes relevant only from the point where the condition becomes
true. When, as in our example, condition is omitted, there is no such restriction. Field timing (optional) speci es
at which points the response must occur, for example \always", meaning at all points where the system is \in
roll hold mode". Default timing is eventually .</p>
      <p>By clicking semantics, the help tab displays various explanations of the requirement, as well as temporal
formulas. The diagram of Figure 2 illustrates that the requirement is only relevant within the grayed box M (M
represents intervals where the Autopilot is in \roll hold" mode). The green band states that \autopilot engaged &amp;
no other lateral mode" is required to hold at all time points within the gray box.</p>
      <p>
        Requirements Visualization. Getting a requirement with temporal relationships right is a tricky and
subtle task. Errors and misunderstandings might creep into the formulation, resulting in a requirement that
does not correctly re ect the temporal interdependencies of the involved signals. Based upon the graphical
signal representation commonly used in digital electronics, we developed an interactive requirements visualizer
in fret, available by clicking simulate in the semantics view of the help tab (see Figure 2). Given a fret
requirement, it shows temporal traces of each of the signals (variables) involved as well as the valuation of the
requirement for each point in time (see Figure 4). The user can interactively modify the input signals; the
valuation of the requirement is updated automatically and thus makes it possible for the user to visually inspect
the temporal behavior of the requirement. The valuation is computed based on the construction of a nite state
machine from the input trace, which is then veri ed against the metric linear temporal logic (LTL) formalization
of the requirement, using the model checker NuSMV [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ].
      </p>
      <p>
        Requirements Analysis. fret's main purpose is to facilitate the
elicitation of unambiguous requirements. For analysis, it allows users to
export requirements in formats that can be digested by external analysis
tools. fret currently connects to the CoCoSim tool [3] for analysis of
Simulink models, and through CoCoSim to the Kind2 [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ], Zustre1, and
Simulink Design Veri er (SLDV) tools for analysis.
      </p>
      <p>To analyze requirements against an implementation as model or code,
one needs to associate the requirement variables, which are at a high
level, with variables in the model or code (signals in the case of Simulink).</p>
      <p>Moreover, fret needs to generate veri cation code that can be
understood by the target analysis tool. To connect with CoCoSim, fret
transforms requirements into CoCoSpec code. In this process, fret
supports the import of Simulink model information provided by CoCoSim,
and association of high-level requirements with target model signals and
components (see Figure 5).</p>
    </sec>
    <sec id="sec-3">
      <title>FRET architecture</title>
      <p>
        fret is implemented mainly in JavaScript as an Electron JS app. Electron JS2 is a framework for creating
desktop-suite applications by using web development programming languages. Electron JS uses two main
technologies: the Node.js runtime and the Chromium web browser. Its le system provided through the Node.js
API is compatible with Linux, Mac OS, and Windows. fret's interactive interface was developed with the
React JavaScript library3. fret uses PouchDB4as an in-browser database that also runs in Node.js. fret's
architecture is illustrated in Figure 6. This section reviews the main modules in the architecture.
O ine Formalization. Formalization of fretish requirements is performed by the formalizer component,
which is described in detail in [
        <xref ref-type="bibr" rid="ref8">9</xref>
        ]. Formalization is performed based on semantic template keys, which are
valuations of the elds that make up each fretish requirement. For example, the template key for requirement
[AP-002a] is [in, null, always], meaning that the scope is \in mode", condition is omitted, and timing is
\always". For each template key, the formalizer generates a variety of mathematical formulas, as well as
      </p>
      <sec id="sec-3-1">
        <title>1https://github.com/coco-team/zustre</title>
        <p>2https://electronjs.org/ 3 https://reactjs.org/</p>
      </sec>
      <sec id="sec-3-2">
        <title>4 https://pouchdb.com/learn.html</title>
        <p>English language explanations and diagrams, which are all saved in a cache. Note that all these artefacts are
templates that contain variables. These variables get instantiated by fret to capture the details of speci c
requirements, as will be described later.</p>
        <p>formalization verifier is a modular, extensible framework, which provides assurance that formulas
generated by the formalizer capture the intended semantics. It implements 1) a module that generates traces,
i.e., example executions over which to interpret formulas; 2) a module that, given a trace and a template key,
generates an expected value of true or false based on the semantics of the fretish language, 3) a module which
interprets formulas over traces and compares the outcome to expected values, and 4) a module that compares
future and past-time formulas generated for the same template key, for equivalence.</p>
        <p>s
y
e
k
te
a
l
p
m
te
e
s
l
a
F
/
e
u
r
T</p>
        <p>trace
generator
oracle
formalizer
formula
diagram
explanation</p>
        <p>cache
formalization verifier
seemvaalunatitcosr eqcuhiveackleenrce
fretish
parser
editor/elicitor LTL formulas
visualizer
simulator
template key
requirement elds</p>
        <p>analysis portal
architectural
data
requirements-model</p>
        <p>mapper
formula translator</p>
        <p>veri cation code + traceability data
instantiator
formalized requirement
(explanation + diagram + formulas)
Requirements Elicitation. The bulk of the work in formalizing fretish requirements is performed o ine
and cached. When users write a requirement, the parser identi es the corresponding template key, and the
values of the requirement elds, which instantiate the template key. The instantiator uses the template key
to fetch correct artefacts from the cache, and uses the requirement elds to appropriately instantiate them. The
produced LTL formulas can be explored interactively through the simulator.</p>
        <p>Analysis Portal. This component connects fret with analysis tools. The user needs to de ne mappings
between fretish variables and model variables, as well as additional information such as variable types, which
is not relevant at a high level. Module requirements-model mapper supports this process and stores the
provided information in a database. It is also able to import architectural data about model components and
signals, when available, to facilitate this task. Module formula translator currently uses information from
the mapper, and the past-time LTL formalization of a requirement, to generate CoCoSpec code, as well as
traceability data. The latter is used to report analysis results in the context of fretish requirements. This
component could also be used in the context of other tools, and is described in detail in [14].
4</p>
      </sec>
    </sec>
    <sec id="sec-4">
      <title>Applications and Future Work</title>
      <p>
        As mentioned, we have successfully applied fret to the LMCPS industrial case study; a detailed evaluation
is provided in [
        <xref ref-type="bibr" rid="ref5">6</xref>
        ]. fret is currently being used by a mission within the NASA Ames Research Center. We
are working closely with mission developers to help them with using the tool and get feedback regarding its
usability. We have noticed, for example, that developers initially need help from us to capture requirements in
fretish and understand the semantic nuances of the elds that are supported. However, their requirements
fall into recurring patterns, so they become e ective with the use of fretish quite fast. For this reason, we
are considering ways of supporting new fretish users, by, for example, displaying typical requirement patterns
within a domain or project, and allowing users to import patterns within the editor and customize as needed.
      </p>
      <p>More generally, now that fret has its basic features established, we are focusing on improving the interaction
with users both in editing and correcting requirements. Similarly, we are working on additional analysis
tools/algorithms to integrate with fret; for example, we have been developing support for checking requirements
realizability. In general, given fret's open source status, we hope to obtain feedback and contributions from the
wider research community. For example, we expect that as the tool gets used in various domains, fretish could
be extended or customized accordingly. Moreover, researchers could connect fret to issue and project tracking
systems, requirements management systems, assurance case environments, as well as additional analysis tools.
Acknowledgements. We thank David Bushnell and Tanja de Jong for working on early prototypes of fret.
This work was funded by the NASA ARMD System-Wide Safety Project.
[3] CoCo-team: CoCoSim { automated analysis framework for Simulink. the version used in this paper is a
closed source version of the tool at NASA Ames that is based on the open source version. https://github.com/
coco-team/cocoSim2
use</p>
      <sec id="sec-4-1">
        <title>EARS.</title>
      </sec>
      <sec id="sec-4-2">
        <title>IEEE</title>
        <p>Software
29(2),
17{18</p>
      </sec>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <surname>Champion</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Mebsout</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Sticksel</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Tinelli</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          :
          <article-title>The Kind 2 model checker</article-title>
          . In: Computer Aided Verication - 28th
          <source>International Conference, CAV 2016</source>
          , Toronto, ON, Canada,
          <source>July 17-23</source>
          ,
          <year>2016</year>
          , Proceedings, Part II. pp.
          <volume>510</volume>
          {
          <issue>517</issue>
          (
          <year>2016</year>
          ). https://doi.org/10.1007/978-3-
          <fpage>319</fpage>
          -41540-6 29
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <surname>Cimatti</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Clarke</surname>
            ,
            <given-names>E.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Giunchiglia</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Roveri</surname>
            ,
            <given-names>M.:</given-names>
          </string-name>
          <article-title>NuSMV: a new symbolic model checker</article-title>
          .
          <source>International Journal on Software Tools for Technology Transfer</source>
          <volume>2</volume>
          (
          <issue>4</issue>
          ),
          <volume>410</volume>
          {425 (Mar
          <year>2000</year>
          ). https://doi.org/10.1007/s100090050046
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [4]
          <string-name>
            <surname>Crapo</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Moitra</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>McMillan</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Russell</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          :
          <article-title>Requirements capture and analysis in ASSERT(TM)</article-title>
          .
          <source>In: 2017 IEEE 25th International Requirements Engineering Conference (RE)</source>
          . pp.
          <volume>283</volume>
          {
          <issue>291</issue>
          (Sep
          <year>2017</year>
          ). https://doi.org/10.1109/RE.
          <year>2017</year>
          .54
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [5]
          <string-name>
            <surname>Dwyer</surname>
            ,
            <given-names>M.B.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Avrunin</surname>
            ,
            <given-names>G.S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Corbett</surname>
            ,
            <given-names>J.C.</given-names>
          </string-name>
          :
          <article-title>Patterns in property speci cations for nite-state veri cation</article-title>
          .
          <source>In: Proceedings of the 21st International Conference on Software Engineering</source>
          . pp.
          <volume>411</volume>
          {
          <fpage>420</fpage>
          . ICSE '99,
          <string-name>
            <surname>ACM</surname>
          </string-name>
          , New York, NY, USA (
          <year>1999</year>
          ). https://doi.org/10.1145/302405.302672
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [6]
          <string-name>
            <surname>Elliott</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          :
          <article-title>On example models and challenges ahead for the evaluation of complex cyber-physical systems with state of the art formal methods V&amp;V, Lockheed Martin Skunk Works</article-title>
          . In: Laboratory,
          <string-name>
            <surname>A.F.R</surname>
          </string-name>
          . (ed.)
          <source>Safe &amp; Secure Systems and Software Symposium (S5)</source>
          ,
          <fpage>9</fpage>
          -
          <issue>11</issue>
          <year>July 2015</year>
          , Dayton, Ohio (
          <year>2015</year>
          ), http://mys5.org/ Proceedings/2015/Day_1/2015-S5-Day1_1405_Elliott.pdf
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [7]
          <string-name>
            <surname>Fifarek</surname>
            ,
            <given-names>A.W.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Wagner</surname>
            ,
            <given-names>L.G.</given-names>
          </string-name>
          ,
          <article-title>Ho man</article-title>
          ,
          <string-name>
            <given-names>J.A.</given-names>
            ,
            <surname>Rodes</surname>
          </string-name>
          ,
          <string-name>
            <given-names>B.D.</given-names>
            ,
            <surname>Aiello</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.A.</given-names>
            ,
            <surname>Davis</surname>
          </string-name>
          ,
          <string-name>
            <surname>J.A.</surname>
          </string-name>
          :
          <source>SpeAR v2</source>
          .
          <article-title>0: Formalized past LTL speci cation and analysis of requirements</article-title>
          .
          <source>In: NASA Formal Methods - 9th International Symposium, NFM</source>
          <year>2017</year>
          , Mo ett Field, CA, USA, May
          <volume>16</volume>
          -18,
          <year>2017</year>
          , Proceedings. pp.
          <volume>420</volume>
          {
          <issue>426</issue>
          (
          <year>2017</year>
          ). https://doi.org/10.1007/978-3-
          <fpage>319</fpage>
          -57288-8 30
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [8]
          <string-name>
            <surname>Gallegos</surname>
            ,
            <given-names>I.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Ochoa</surname>
            ,
            <given-names>O.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Gates</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Roach</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Salamah</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Vela</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          :
          <article-title>A property speci cation tool for generating formal speci cations: Prospec 2.0</article-title>
          . In: 20th International Conference on Software Engineering and Knowledge Engineering,
          <string-name>
            <surname>SEKE</surname>
          </string-name>
          <year>2008</year>
          . pp.
          <volume>273</volume>
          {
          <issue>278</issue>
          (01
          <year>2008</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          [9]
          <string-name>
            <surname>Giannakopoulou</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Pressburger</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Mavridou</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Schumann</surname>
          </string-name>
          , J.:
          <article-title>Generation of formal requirements from structured natural language</article-title>
          .
          <source>In: 26th Intl Working Conference on Requirements Engineering: Foundation for Software Quality (REFSQ-2020)</source>
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          [10]
          <string-name>
            <surname>Jeannet</surname>
            ,
            <given-names>B.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Gaucher</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          :
          <article-title>Debugging Embedded Systems Requirements with STIMULUS: an Automotive Case-Study</article-title>
          .
          <source>In: 8th European Congress on Embedded Real Time Software and Systems (ERTS</source>
          <year>2016</year>
          ). Toulouse, France (
          <year>Jan 2016</year>
          ), https://hal.archives-ouvertes.fr/hal-01292286
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          [11]
          <string-name>
            <surname>Konrad</surname>
            , S., Cheng,
            <given-names>B.H.C.</given-names>
          </string-name>
          :
          <article-title>Facilitating the construction of speci cation pattern-based properties</article-title>
          .
          <source>In: 13th IEEE International Conference on Requirements Engineering (RE</source>
          <year>2005</year>
          ),
          <volume>29</volume>
          August - 2
          <source>September</source>
          <year>2005</year>
          , Paris, France. pp.
          <volume>329</volume>
          {
          <fpage>338</fpage>
          . IEEE Computer Society (
          <year>2005</year>
          ). https://doi.org/10.1109/RE.
          <year>2005</year>
          .29
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          [12]
          <string-name>
            <surname>Lucio</surname>
            ,
            <given-names>L.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Rahman</surname>
          </string-name>
          , S., Cheng, C.H.,
          <string-name>
            <surname>Mavin</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          : Just Formal Enough?
          <source>Automated Analysis of EARS Requirements</source>
          . In: Barrett,
          <string-name>
            <given-names>C.</given-names>
            ,
            <surname>Davies</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            ,
            <surname>Kahsai</surname>
          </string-name>
          , T. (eds.)
          <source>NASA Formal Methods</source>
          . pp.
          <volume>427</volume>
          {
          <fpage>434</fpage>
          . Springer International Publishing,
          <string-name>
            <surname>Cham</surname>
          </string-name>
          (
          <year>2017</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          [13]
          <string-name>
            <surname>Mavin</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          : Listen, then https://doi.org/10.1109/MS.
          <year>2012</year>
          .36
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>