industrial tools, such as the Embedded Specifier (BTC
Embedded Systems, 2015), where the manual iden-
tification and linking of variables to requirements is
used as a first step to formalize a requirement. Sev-
eral discussions (Sexton, 2013; Sebastian Siegl, 2014)
emphasize the value of this step to structure the pro-
cess of deriving formal requirements from informal
ones.
A disadvantage of manually establishing trace-
ability is that the process becomes increasingly error-
prone with larger projects. The requirements engi-
neer often has to process long lists of similar sound-
ing words and has to be very carefully not to make
mistakes, such as to link the wrong variables or create
duplicates of variables.
Our approach support such a identification process
by using a combination of different similarity mea-
sures between the model variables and the text pas-
sages, and to suggest the most similar terms to be
linked with a trace. In this article, we measure the
similarity by a textual difference (Levenshtein, 1966)
as well as by a semantic similarity (Wu and Palmer,
1994), derived from the WordNet ontology (Miller,
1995). Knowledge stored in other kinds of ontolo-
gies could also be used to improve the results. Our
goal is to support a requirements engineer by provid-
ing suggestions, since a fully automatic approach is
unreasonable in most cases due to subtle differences
in the meaning of natural language texts.
The theoretical background of our approach is
elaborated in Section 2 and its implementation in Sec-
tion 3. In Section 4 metrics to evaluate the provided
suggestions are discussed.
2 ALGORITHM
This section describes our algorithm for generating
suggestions for links to model variables. As a run-
ning example we use the following natural language
requirement which was the basis for the formal re-
quirement depicted in Figure 1:
Requirement: “If the window moves up and an ob-
stacle is detected, the window has to start moving
down in less than 10ms.”
Model variables: ObstacleObserved,
PassengerDownSwitchIsPressed,
WindowMovesDown,WinMovUp
In this simple case, we would like to estab-
lish a trace between the text passage “window
moves up” and the variable WinMovUp, a trace be-
tween the text passage “obstacle is detected” and
the variable ObstacleObserved, as well as be-
tween the text passage “window has to start mov-
ing down” and WindowMovesDown. The variable
PassengerDownSwitchIsPressed is not textually
mentioned in this requirement and therefore shall not
get a link. Instead of defining these traces manu-
ally, our algorithm generates suggestions, which can
be accepted to establish the trace. Suggestions are
proposed if a text passage within the requirement
is similar to any of the variables. In this example,
we illustrated several case which should be handled
by the algorithm. The text passage “obstacle is de-
tected” and the variable ObstacleObserved have the
same meaning, but use a different verb. This se-
mantic similarity should be perceived. The variable
WinMovUp should be referenced to the text passage
“window moves up”, although it is in an abbreviated
variable style. The text passage “window has to start
moving down” contains other information (“has to
start”, but should be referenced to the model variable
WindowMovesDown.
To measure the similarity illustrated in the exam-
ples above, our algorithm uses a textual similarity
measure as well as a semantical similarity by using
knowledge stored in an ontology. The top suggestions
with their respective scores are finally presented to the
engineer.
A suggestion is a pair of a text passage and a
model variable, accompanied by a score. The algo-
rithm for generating suggestions for a given require-
ment is outlined in Algorithm 1.
Algorithm 1: Generate Suggestion List for Requirement.
1: function GETSUGGESTIONS(text)
2: for each passage ∈ text do
3: for each var ∈ model do
4: score ← SIMILARITY(passage, var)
5: list.append((score,passage,var))
6: end for
7: end for
8: SORT(list)
9: for each suggestion ∈ list do
10: if NOOVERLAP(suggestion, sugList) then
11: sugList ← suggestion
12: end if
13: end for
14: sugList ← sugList[0..maxSuggestions]
15: return sugList
16: end function
Every possible combination of text passages and
variables is checked and rated with a score (line 4).
We don’t suggest overlapping text passages to avoid
cluttering the suggestion list with slight modifications
of the same text passage. Therefore, after identifica-
tion of the individual scores, the list is sorted by de-
Tracing of Informal and Formal Requirements through Model Variables - SKY 2015 Challenge
59