SlideShare a Scribd company logo
1 of 76
Download to read offline
Requirements Engineering:
focus on Natural Language
Requirements Processing
Alessio Ferrari1
1ISTI-CNR, Pisa, Italy
January 13, 2016
A. Ferrari (ISTI) Requirements Engineering 1 / 76
A. Ferrari (ISTI) Requirements Engineering 2 / 76
Objectives of the Course
Objectives: lesson 1
Understand what are requirements, specifications
and domain assertions
Understand the problems behind requirements elicitation
and SRS definition
Learn how to write a decent SRS
Objectives: lesson 2
Learn the basics of Natual Language Processing (NLP)
Learn the relation between NLP and Requirements
Learn the basics of GATE to detect NL ambiguities in
requirements
Learn the basics of Python NLTK (for further manipulation of NL
requirements)
A. Ferrari (ISTI) Requirements Engineering 3 / 76
Concepts: Requirement, Specification, Domain Assertion
A. Ferrari (ISTI) Requirements Engineering 4 / 76
Michael Jackson’s Model
When we build a SYSTEM we make a change in a portion of the
WORLD that we call ENVIRONMENT
ENVIRONMENT SYSTEM
WORLD
INTERFACE
The SYSTEM and the ENVIRONMENT interact through an
INTERFACE (i.e., sensors and actuators)
A. Ferrari (ISTI) Requirements Engineering 5 / 76
Concepts
ENVIRONMENT SYSTEM
WORLD
INTERFACE
RD S P M
Domain
Assertion
Requirement Specification Program Machine
A. Ferrari (ISTI) Requirements Engineering 6 / 76
Concepts
Domain assertions (D): all the conditions over phenomena of the
environment that we know (or presume) to be true, regardless of
the system
Requirements (R): all the conditions over phenomena of the
environment that we want to make true by developing the system
Specifications (S): description of conditions and actions
occurring at the interface between the environment and the
system. Provides enough information for a programmer to build
the system
Program (P): implementation of the specifications
Machine (M): hardware, sensors and actuators that support the
program
A. Ferrari (ISTI) Requirements Engineering 7 / 76
Example: Patient Monitoring System
ENVIRONMENT
SYSTEM
D1: there is always a nurse close enough
to hear the buzzer
D2: the sound from the heart below a
threshold T indicates that the heart is
about to stop
R: the system shall notify the nurse if the patient's heartbeat stops
S: if the sound from the sensor falls below a
threshold T, the system shall actuate the buzzer
P: the program
M_v: the sensor and the buzzer
M_h: the rest of the harware
A. Ferrari (ISTI) Requirements Engineering 8 / 76
Objective of Requirements Engineering
Identify R, S and D, so that if a system whose behaviour satisfies S is
installed in the environment, and the environment has the properties
described in D, then the environment will exhibit the properties
described in R.
D, S R
Read it as: The Specification S, under the constraints expressed
in D, satisfies the Requirements R
Requirements speak the language of the environment (i.e., the
domain – medical, public administration, etc.)
Specifications speak the language of the interface, and are
expressed in terms of shared phenomena
A. Ferrari (ISTI) Requirements Engineering 9 / 76
Observation
The formalisation is useful if I am using a formal language to
define requirements and specifications
The formalisation is only a guideline in practice, because the R
and D speak about the world, which is not formal!
In practice, requirements and specifications are rarely formal
Requirements and specifications are often expressed in Natural
Language (NL)
The formalisation is still useful, and, even when expressing R, S
and D in NL, you should keep it in mind
A. Ferrari (ISTI) Requirements Engineering 10 / 76
Requirements or Specifications?
1 Only authorised people shall be able to enter the park
2 The system shall allow only authorised people to enter the park
3 Only people who has payed the fee shall be able to enter the park
4 The system shall release a receipt, after the user has inserted coins, if
the user has introduced 3 coins
5 The system shall open the barrier, if 3 coins have been introduced
6 The system shall enter in state COUNT_COINS, when the coin sensor
senses the introduction of 1 coin, and the system is in state
WAIT_COINS
7 The system shall enter in state RELEASE_RECEIPT, if the user has
introduced 3 coins
A. Ferrari (ISTI) Requirements Engineering 11 / 76
Rule of Thumb
If a Customer can read it, it’s a Requirement
If a Customer cannot read it, it’s a Specification
A. Ferrari (ISTI) Requirements Engineering 12 / 76
Adding some Confusion: System and Software Specifications
If I am defining System Specifications (S-SYS), then the hardware
elements are part of the system, and part of them appear in the
interface (as in the previous example)
If I am defining Software Specifications (S-SW), then the
hardware elements are part of the environment, and hence in the
specification I will speak about abstract variables to be set. These
variable are considered to be part of the interface (i.e., they are
the variables used by the drivers).
A. Ferrari (ISTI) Requirements Engineering 13 / 76
Example: Patient Monitoring System
ENVIRONMENT
SOFTWARE
D1: there is always a nurse close enough
to hear the buzzer
D2: the sound from the heart below a
threshold T indicates that the heart is
about to stop
R (S-SYS): if the sound from the sensor falls below a threshold T,
the system shall actuate the buzzer
S (S-SW): the software shall set BUZZER = ON,
if SOUND < T.
P: the program
M: see previous slide
A. Ferrari (ISTI) Requirements Engineering 14 / 76
This is just a practical solution!
This is just a practical solution to overcome the problem of
separating system and software specifications, as asked in the
context of embedded safety-critical systems.
In this lecture, we will mainly speak about system specifications.
If sensors and actuators are just keyboards and screens, then the
software specification is the system specification.
WARNING: in the literature, when you read software specification,
the authors often mean system specification.
A. Ferrari (ISTI) Requirements Engineering 15 / 76
Adding more Confusion: Software Requirements Specification
We have seen that Requirements and Specifications are different
So what the hell is a Software Requirements Specification (SRS)?
It is a document that specifies the Requirements OR the
Specification, OR both
It depends on who is going to read the document
A. Ferrari (ISTI) Requirements Engineering 16 / 76
So What to Do?
Keep in mind the distinction between R, S and D
When you write a statement, make an effort to place it in R, S or D
If a company has a single standard document to edit R and S,
follow that, and separate R, S, and D
If a company distinguishes between user/customer requirements
and system/software requirements, then place R and D in the
former, S in the latter, and trace them.
If a company further distinguishes between system and software
requirements, then follow the suggestion given in a previous slide.
If a company does not have a standard document to edit
requirements and specifications, then use the template in the
IEEE Std 830-1998(R2009), which is nice.
Consider who’s going to read the document! (Customer,
Developer, Tester, etc.)
A. Ferrari (ISTI) Requirements Engineering 17 / 76
Adding more and more Confusion: Goals
A requirement tells us WHAT the system shall do
A GOAL tells us WHY the system shall do that thing
Example
Requirement: the system shall notify the nurse if the patient’s
heartbeat stops
Goal: patients whose heartbeat is going to stop shall be saved
Expectation: when the nurse hears the buzzer, the nurse saves
the patient
Goals are useful in Requirements Analysis
(Completeness) Which other requirements are needed to address
the GOAL?
(Alternatives) Is there an alternative approach?
(Obstacles) What can be an obstacle for that GOAL?
A. Ferrari (ISTI) Requirements Engineering 18 / 76
Requirements Process (Revision)
A. Ferrari (ISTI) Requirements Engineering 19 / 76
The Requirements Process (Requirements Definition)
Elicitation
Analysis
Documentation
Validation
Transcripts
of Meetings
with Customers
Models
Structured
Requirements
Document
Requirements
with
Defects
A. Ferrari (ISTI) Requirements Engineering 20 / 76
Requirements Elicitation: Ambiguity Problems
A. Ferrari (ISTI) Requirements Engineering 21 / 76
Requirements Elicitation
Requirements Analyst
Customer
Other Stakeholders Existing Documentation
Legacy Software
REQUIREMENTS
A. Ferrari (ISTI) Requirements Engineering 22 / 76
Interviews
Requirements AnalystCustomer
A. Ferrari (ISTI) Requirements Engineering 23 / 76
Tacit Knowledge
Requirements AnalystCustomer
Tacit Knowledge
A. Ferrari (ISTI) Requirements Engineering 24 / 76
Ambiguity
Requirements AnalystCustomer
Tacit Knowledge
≠
A. Ferrari (ISTI) Requirements Engineering 25 / 76
Definition of Ambiguity
Ambiguity in Interviews
An ambiguity occurs in a requirements elicitation interview when a
customer articulates a unit of information, and the meaning assigned
by the requirements analyst to such articulation differs from the
meaning intended by the customer.
Unit of information: system need or domain-related aspect
Articulation: any speech fragment
We include cases where the analyst cannot give any interpretation
A. Ferrari (ISTI) Requirements Engineering 26 / 76
Example: Ambiguity in Interviews
Web-based platform where the citizens can send suggestions for
laws to the parliament
Ambiguity: “I want a dashboard to show (to the representatives
of the parliament) what’s going on in specific areas” (thematic or
geographical?)
A. Ferrari (ISTI) Requirements Engineering 27 / 76
Context of the Analyst
INTERPRETATION
ACCEPTANCE
SPEECH
FRAGMENT
ACCESS
Requirements
Goals
Domain
Specification
k
k
k
kCONCEPT
ACCESSIBLEa, i(k) = interpretablea,i(k) ∧ acceptablea,i(k)
A. Ferrari (ISTI) Requirements Engineering 28 / 76
Phenomenology of Ambiguity
A. Ferrari (ISTI) Requirements Engineering 29 / 76
Ambiguity
ambiguousi(k) = articulatedc,i(k) ∧ ¬articulatedc,i(k )∧
(¬ACCESSIBLEa,i(k) ∨ interpretablea,i(k ))
The customer articulates a unit of information k
through a speech fragment i
The unit of information k cannot be accessed
or i is interpreted as k
Let us focus on the second line of the equation, which is:
¬interpretablea,i(k) ∨ ¬acceptablea,i(k)∨
interpretablea,i(k )
A. Ferrari (ISTI) Requirements Engineering 30 / 76
Categories of Ambiguity
k k Phenomenon
¬interpretable(k) ¬acceptable(k) ¬interpretable(k ) - interpretation unclarity
interpretable(k) ¬acceptable(k) ¬interpretable(k ) - acceptance unclarity
interpretable(k) acceptable(k) interpretable(k )
acceptable(k ) multiple understanding
¬acceptable(k ) correct disambiguation
- ¬acceptable(k) interpretable(k )
acceptable(k ) undetected incorrect disambiguation
¬acceptable(k ) detected incorrect disambiguation
Four Main Classes
Unclarity
Multiple Understanding
Incorrect Disambiguation
Correct Disambiguation
A. Ferrari (ISTI) Requirements Engineering 31 / 76
Unclarity
INTERPRETATION
ACCEPTANCE
SPEECH
FRAGMENT
ACCESS
Requirements
Goals
Domain
Specification
k k'
k
kCONCEPT
?
¬ACCESSIBLEa,i(k) ∧ ¬interpretablea,i(k )
A. Ferrari (ISTI) Requirements Engineering 32 / 76
Example
Interpretation Unclarity
Use of domain jargon (e.g., “connoisseurship method” for History
of Arts expert)
Use of vague terms (e.g., “(The app changes the color of the wall)
taking light into account”)
Acceptance Unclarity
(Domain) “If you do not recycle a thing because the municipality
did not signal that it was recyclable, you will not get a fee”
A. Ferrari (ISTI) Requirements Engineering 33 / 76
Multiple Understanding
INTERPRETATION
ACCEPTANCE
SPEECH
FRAGMENT
ACCESS
Requirements
Goals
Domain
Specification
k k'
k k'
kCONCEPT
k'k
ACCESSIBLEa,i(k) ∧ ACCESSIBLEa,i(k )
A. Ferrari (ISTI) Requirements Engineering 34 / 76
Example
Multiple Understanding
Web-based platform where the citizens can send suggestions for
laws to the parliament
“A dashboard to show (to the representatives of the parliament)
what’s going on in specific areas” (thematic or geographical?)
“The application should be connected to a social network”
(internal or external?)
A. Ferrari (ISTI) Requirements Engineering 35 / 76
Incorrect Disambiguation
INTERPRETATION
ACCEPTANCE
SPEECH
FRAGMENT
ACCESS
Requirements
Goals
Domain
Specification
k k'
k
kCONCEPT
k'?
¬accessiblea,i(k) ∧ interpretablea,i(k )
A. Ferrari (ISTI) Requirements Engineering 36 / 76
Example
Detected Incorrect Disambiguation: Fitness Tamagochi
“You can decide what type of character you want to create”
(Acceptance Unclarity - Domain) “So, you can choose the
character?”
“Actually you cannot [...] you can possibly become (a specific
character)”
Undetected Incorrect Disambiguation: Automated Baby-swinger
“I want something that can change. A component that relax her
(the daughter) is that she feels the novelty in the movement”
Incorrect disambiguation: change in frequency
“You can choose different sequences of movement, three in this
direction, two in this direction” (Acceptance Unclarity - Req)
Correct interpretation: change in direction
A. Ferrari (ISTI) Requirements Engineering 37 / 76
Correct Disambiguation
INTERPRETATION
ACCEPTANCE
SPEECH
FRAGMENT
ACCESS
Requirements
Goals
Domain
Specification
k k'
k
kCONCEPT
k
k'
ACCESSIBLEa,i(k) ∧ interpretablea,i(k ) ∧ ¬acceptablea,i(k )
A. Ferrari (ISTI) Requirements Engineering 38 / 76
Re-definition of strict-Ambiguity
Let us exclude Correct Disambiguation:
ambiguous-stricti(k) = articulatedc,i(k) ∧ ¬articulatedc,i(k )∧
(¬ACCESSIBLEa,i(k) ∨ interpretablea,i(k ))∧
¬(ACCESSIBLEa,i(k) ∧ interpretablea,i(k ) ∧ ¬acceptablea,i(k ))
A. Ferrari (ISTI) Requirements Engineering 39 / 76
Your Turn!
I am pretending to be the owner of a gym, and I’m coming to you
to build a smart gym
5 minutes to prepare some questions
Interview me, keeping in mind ambiguity issues and tacit
knowledge
Keep in mind that you have to elicit both R and D
Hence, identify potential users, objects and principles in the
domain
Take notes
Be careful that you’re speaking to someone who is not a software
engineer
A. Ferrari (ISTI) Requirements Engineering 40 / 76
Requirements Analysis (Hints and References)
A. Ferrari (ISTI) Requirements Engineering 41 / 76
Requirements Analysis
Requirements analysis is what you do after you met the customer, to:
Reason on R and D, to write down a document that the customer
can read
Reason on R, D, and S to write down a (possibly separate)
document that your programmers can read
Often, you are going to write a single SRS with both R, S, and D
From now on, I will speak about writing a SRS, meaning a
document including R, S, and D
Several techniques exist, I will give you just some pointers, since this
lecture focuses on ambiguity
A. Ferrari (ISTI) Requirements Engineering 42 / 76
Example: Car Park System
I want to build a system to automate the payment for a private car
park
The typical scenario is:
1 a car enters from an entrance barrier and the driver takes an
entrance receipt from an entrance device
2 the driver parks the car
3 when the driver has to leave the park, he goes to a payment
machine and inserts the entrance receipt
4 the machine computes the amount of money due
5 the driver pays and the machine releases an exit receipt
6 the driver inserts the exit receipt in an exit device, and the driver
exits from the exit barrier
The system also monitors the number of free places in the park
A. Ferrari (ISTI) Requirements Engineering 43 / 76
Pointer 1: Context Diagram
System
Car
Barrier
Park
Coin
Customer
Shared Phenomena
A. Ferrari (ISTI) Requirements Engineering 44 / 76
Pointer 2: Prototyping and Mock-ups
Googlehttp:/carpark.it
My-Car Park Monitor
Select a date
30 329 1 23128
2421 23 25 272622
201814 17 191615
129 1187 10 13
S
6
F
5
T
4
W
3
T
21
M
30
S
December 2008
Select Today
Check Failed
Payment Machine
See Car Park
Occupation
A. Ferrari (ISTI) Requirements Engineering 45 / 76
Pointer 3: Use Case and UML
Enter Car Park
Car Driver
Car Park Surveillant
Monitor Car Park
Exit Car Park
Pay Parking
A. Ferrari (ISTI) Requirements Engineering 46 / 76
Pointer 4: Goal Modelling
Profits
Improved
Automatic Car
Park Defined
Car Entrance
Automated
Car Exit
Automated
Payment
Automated
Verification of
Payment
AchievedOpen Barrier
Achieved
Close After
Pass Achieved
Trigger to Open
Barrier
Achieved
Open Barrier if
Payment
Achieved
Button System
Implemented
Open Photocell
System
Implemented
Verify Money
Achieved
Release
Receipt
Achieved
AND
OR
Open Button
Controller
Photocell
Controller
Counter
Implemented
Close Photocell
System
Implemented
Payment MachineBarrier Controller Exit Controller
A. Ferrari (ISTI) Requirements Engineering 47 / 76
Documentation: Using NL Templates
A. Ferrari (ISTI) Requirements Engineering 48 / 76
Documentation: Using NL Templates
SRS are written in Natural Language (NL), because several
stakeholders with diverse skills have to interact with them
SRS are written in NL, because formalisation is not possible at
this stage of the development
As spoken language is ambiguous, so it is written language
In a conversation, I can ask clarifications, but when a document is
written, it is not always that easy
A. Ferrari (ISTI) Requirements Engineering 49 / 76
A. Ferrari (ISTI) Requirements Engineering 50 / 76
Rupp’s Template (more appropriate for R)
between. For an automated tool to deem R1 as conformant,
it has to correctly distinguish these three slots in the follow-
ing: “monitor system configuration changes posted to the
database”. A second important issue is that even when a
slot falls in between fixed elements, e.g., hwhom?i, and is
thus easy to delineate, there is no way to distinguish an
acceptable filler for the slot from an unacceptable one, e.g., a
grammatically-incorrect phrase. For instance, in R1, we may
accept “system administrator” as correctly filling hwhom?i,
but we may be unwilling to accept a grammatically-incor-
rect phrase such as “system administer” for the slot.
and define the glossary terms after the requirements have
sufficiently matured and are thus less likely to change. This
strategy avoids wasted effort at the glossary construction
stage, but it also means that the glossary will not be ready
in time to support activities such as template conformance
checking (TCC), which often take place during requirements
writing. Furthermore, the literature suggests that glossaries
may remain incomplete throughout the entire development
process [14], thus providing only partial coverage of the
glossary terms. This implies that automated techniques for
checking conformance to templates would have limited
effectiveness if such techniques rely heavily on the glossary
Fig. 1. Rupp’s template [5].
ARORA ET AL.: AUTOMATED CHECKING OF CONFORMANCE TO REQUIREMENTS TEMPLATES USING NATURAL LANGUAGE PROCESSING 945
A. Ferrari (ISTI) Requirements Engineering 51 / 76
EARS Template (more appropriate for S)
[16], [17], [18] and discussed in Section 2.1. In both of
the studies that use Rupp’s template, the require-
ments were written directly by professionals. As for
the two studies using EARS, one—which is the larg-
est case study reported in this article—was written
directly by professionals as well, while the remain-
ing study uses transformed requirements from one
of our two case studies based on Rupp’s template.
The results from our case studies indicate firstly, that
templates and NLP to the extent needed in our approac
Section 3 describes our approach for automation of TC
Section 4 discusses tool support. Sections 5 presents the ca
studies we have conducted to evaluate our approac
Section 6 identifies the limitations and analyzes threats
validity. Section 7 compares our approach with relat
work. Section 8 concludes the article with a summary a
directions for future work.
. 3. The EARS template [16].
6 IEEE TRANSACTIONS ON SOFTWARE ENGINEERING, VOL. 41, NO. 10, OCTOBER 2
A. Ferrari (ISTI) Requirements Engineering 52 / 76
Templates for your exercise
A. Ferrari (ISTI) Requirements Engineering 53 / 76
FORMAT1. The system [shall|should] be able to < capability >
(Il sistema [deve|dovrebbe] essere in grado di <capacità>)
Example: The system shall be able to monitor the number of cars
in the parking
This format is also employed in case of statements that involve
mandatory (shall) or optional (should) functionalities, which are
unconditional and independent from the actions of the
operators.
Statements of this type are normally associated to interface
functions, internal procedures, or procedures that manage internal
data structures.
A. Ferrari (ISTI) Requirements Engineering 54 / 76
FORMAT2. The system [shall|should] allow the < user > to < action >
(Il sistema [deve|dovrebbe] permettere a <utente> di <azione>)
Example: The system shall allow the car driver to pay the parking
This format is employed in case of statements that involve
mandatory (shall) or optional (should) functionalities, which are
unconditional and dependent from the actions of the operators.
A. Ferrari (ISTI) Requirements Engineering 55 / 76
FORMAT3. The system [shall|should] < action >, [when|after|before|if]
< condition > {, [when|after|before|if] < condition >}
(Il sistema [deve|dovrebbe] <azione>, [quando|dopo|prima|se]
<condizione> {,[quando|dopo|prima|se] <condizione>})
Example. The system shall release the receipt, if the car driver
has payed the required amount
This format is employed when the action depends on one or more
conditions.
All conditions are considered in a logical AND relationship. If we
want to express logical OR among conditions, it is recommended
to add a new requirement or specification.
A. Ferrari (ISTI) Requirements Engineering 56 / 76
FORMAT4. [FORMAT1|FORMAT2|FORMAT3], < procedure >
Example. The system shall signal the unavailability of receipts,
before the user inserts coins, through a message on the screen
This format is employed to specify functionalities that have an
associated procedure, or that are performed through a
well-defined interface device.
The format shall be used when it is useful to explain HOW the
system is expected to perform a certain action.
A. Ferrari (ISTI) Requirements Engineering 57 / 76
Your Turn!
Write (part of) R, S for the smart gym following the templates
Write D in NL without templates, in a rigorous language
You can use the same template for R and S, the only difference
resides in the vocabulary that you use
If you speak only about elements in the interface, then it is S
If you speak about elements in the environment and (optionally)
about elements in the interface, then it is R
While you write a new entity or action, store it in the vocabulary
and tell if it belongs to the interface or to the environment
You have 30 minutes
Hints
Hint 1 identify interfaces, users, and main functions of your system
Hint 2: try to list as many R as possible; select one; write S for that;
state the D that are needed to satisfy R
Hint 3: if needed, partition the system into sub-systems
A. Ferrari (ISTI) Requirements Engineering 58 / 76
Examples
R, S, D
R1: (F1) The system shall be able to monitor the workout of the
customer
R2: (F2) The system shall allow the trainer to visualise the
workout of the customer
S1: (F1) The system-CentralUnit shall be able to store the data
coming from the wrist-band of the customer
S2: (F3) The system-UI shall visualise the workout plot of the
customer, when the trainer presses the button B, if the system-UI
is in Page P.
D1: Each customer is equipped with a wrist-band
D2: The wrist-band records the data concerning the workout of
the customer
A. Ferrari (ISTI) Requirements Engineering 59 / 76
Summary of the Templates
F1: The system [shall|should] be able to < capability >
(unconditional user-independent capability)
F2: The system [shall|should] allow the < user > to < action >
(unconditional user-dependent action)
F3: The system [shall|should] < action >, [when|after|before|if] <
condition > {, [when|after|before|if] < condition >} (conditional
action)
F1|F2|F3, < procedure > (if I have to tell HOW)
A. Ferrari (ISTI) Requirements Engineering 60 / 76
Validation: Sins of the Requirements Engineer, and NL Ambiguity
A. Ferrari (ISTI) Requirements Engineering 61 / 76
9 Sins of the Requirements Engineer
Noise: Presence into the text of an element not adding problem
relevant information
“The car park has three elevators”
Silence: Existence of a characteristics of the problem not covered
by any text element
Have I though about the limit in the number of places
in the car park?
“If the user has inserted the correct amount of
money, the system shall release a receipt” (what if
the amount is not correct?)
Overspecification: Presence into the text of an element not
corresponding to any characteristic of the problem but to
possible implementation characteristics
“When a car enters the park, the system shall add
one to the car counter”
A. Ferrari (ISTI) Requirements Engineering 62 / 76
9 Sins of the Requirements Engineer (continue)
Contradiction: presence into the text of two or more elements
defining system characteristics in a inconsistent way
“Only when the red button is pressed, the system
shall release the receipt”
“The system shall release the receipt when the user
inserts coins”
Ambiguity: presence into the text of an element that makes possible
different interpretations of one characteristic of the system
“When the user presses the button, the system shall
release the receipt” - which button?
A. Ferrari (ISTI) Requirements Engineering 63 / 76
9 sins of the Requirements Engineer (continue)
Forward references: presence into the text of an element using
characteristics of the problem defined below
Consider the red button is defined after you tell how
to use it
Wishful thinking: presence into the text of an element defining a
characteristic of the problem so that a possible solution of
this problem cannot be realistically validated
“The car park receipt shall not be thrown away after
parking”
A. Ferrari (ISTI) Requirements Engineering 64 / 76
9 sins of the Requirements Engineer (continue)
Synthesis presence of a requirement that states more than one
functionality, and hence needs multiple-tests
“The system shall allow the car driver to enter and
exit from the park”
Repetition: presence of multiple statements expressing the same
requirement
“The system shall show the amount of money due,
after the user has inserted the entrance card”
“If the user provided the entrance card, the system
shall visualise the amount of money due”
A. Ferrari (ISTI) Requirements Engineering 65 / 76
9 Sins - Summary
1 Noise = irrelevant information
2 Silence = absence of relevant information
3 Overspecification = implementation-related information
4 Contradiction = contradictory information
5 Ambiguity = multiple interpretations possible
6 Forward references = wrong information sequence
7 Wishful thinking = potential validation problems
8 Synthesis = potential validation problems
9 Repetition = potential validation problems, and ambiguity
A. Ferrari (ISTI) Requirements Engineering 66 / 76
Ambiguity in NL Requirements
Templates are useful to reduce ambiguity, but ambiguity might still
be there
Moreover, templates are not always used in practice
We need more fine-grained lenses to reduce ambiguities
Previously, we have classified ambiguities depending on the way
they are perceived by a listener
The previous classes can be applied also for written text,
substituting the listener with the reader
Here, we classify the triggers of ambiguity in written language,
which can lead to different classes of ambiguities from the point of
view of the reader
These triggers can be applied also to spoken language, but they
are harder to detect (verba volant, scripta manent)
A. Ferrari (ISTI) Requirements Engineering 67 / 76
Categories of Ambiguity
Pure Ambiguities
Lexical: the terms used have different vocabulary meanings
Syntactic: the syntactic structure has more than one
interpretation
Semantic: no lexical or syntactic ambiguity, but the expression is
ambiguous
Quasi-Ambiguities
Vagueness: there are cases in which the meaning of the
expression cannot be established
Generality: the expression is too abstract
A. Ferrari (ISTI) Requirements Engineering 68 / 76
Lexical Ambiguities
Homonymy: words have unrelated meanings, but they have the
same written representations
Example: I went to the bank. (bank = ground close to a lake;
financial institution)
Polysemy: words have related different meanings, but they have
the same written representations
Example: There is a mole at work. (mole = animal; spy)
These types of ambiguity are rare in requirements, but it’s good to
know they exist, since they can occur during elicitation (e.g., “rilevato
sul piano cutaneo” - homonymy).
A. Ferrari (ISTI) Requirements Engineering 69 / 76
Syntactic Ambiguities
Analytical: a complex noun group with modifiers, and you do not
know which to which noun the modifiers refer
Example: The principal system administrator shall be able to
enter the data-base (principal = system or administrator?)
Attachment: a preposition (e.g., “with”, “for”, “by”) can be
attached to different parts of the sentence
Example: The system shall produce a resumee using a template
for the final assessment (for the final assessment: is the template,
or is it an objective?)
Coordination: complex combinations of AND/OR, or modifier +
AND/OR
Example: The system shall produce the plot or the data-log and
the legend.
Example: Novel employees and directors shall be provided with
a user-name and password
A. Ferrari (ISTI) Requirements Engineering 70 / 76
Syntactic Ambiguities (continues)
Elliptical: omission of words, which are expected to be deduced
from the context
Example: The system produces a positive notification in case of
success, and in case of failure doesn’t (does not produce any
notification at all?)
Anaphoric: usage of pronouns (e.g., he, it, his, this), which can
be referred to different nouns.
Example: “When the system sends a message to the receiver, it
shall provide an acknowledgement” (it = “system” or “receiver”?)
These are less frequent in spoken language, but rather frequent in
written requirements.
A. Ferrari (ISTI) Requirements Engineering 71 / 76
Semantic Ambiguities
These are due to ambiguous interactions of logical quantifiers (every,
each, all, any, some, none, a, etc.), and to the use of plurals.
Example: All lights have a switch (one for all, or one for each?)
Example: An alert shall be raised for each failure-mode (the
same alert?)
Example: The wrist-bands contain movement sensors (one-one,
one-many, many-one, many-many?)
Hint: do not use plurals, and be careful with quantifiers
These are also due to the usage of synonyms in requirements
Example: The system shall allow the car driver to insert coins
Example: The system shall release the receipt if the user has
payed
A. Ferrari (ISTI) Requirements Engineering 72 / 76
Generality
These cases are due to the usage of terms (names or verbs) that
are too abstract
They are not classified as ambiguities, because, depending on the
context, a more detailed description might not be required.
In requirements and specifications, generality can be reduced
through the vocabulary
Example: The system shall be able to produce the report
Example: The system shall be able to alert the user in case of
failure
Example: The system shall be able to produce a graph of the
workout of the customer
In the literature, generality problems are often marked as “pragmatic
ambiguities”. This often causes confusion. Pragmatic ambiguities are
concerned with the effect, while here we focus on triggers.
A. Ferrari (ISTI) Requirements Engineering 73 / 76
Vagueness
Vagueness occurs when an expression (often, adjective or
adverb) has not a uniquely quantifiable meaning.
Several vague expression can be listed (accurate, suitable,
appropriate, clearly, better, accordingly, depending on, if
necessary, if needed, etc.)
In general, avoid adjectives and adverbs
Example: The system shall be able to show the graph of the
workout if required
Example: The system shall be able to show a suitable
representation of the workout
Example: When appropriate, the system shall display low levels
of workout
A. Ferrari (ISTI) Requirements Engineering 74 / 76
Further Readings
Gunter, Carl, et al. “A reference model for requirements and specifications.” Requirements
Engineering, 2000. Proceedings. 4th International Conference on. IEEE, 2000.
Jackson, Michael. “The meaning of requirements.” Annals of Software Engineering 3.1
(1997): 5-21.
Zave, Pamela, and Michael Jackson. “Four dark corners of requirements engineering.”
ACM transactions on Software Engineering and Methodology (TOSEM) 6.1 (1997): 1-30.
Berry, Daniel M. "From contract drafting to software specification: Linguistic sources of
ambiguity-a handbook version 1.0." (2000).
Gleich, Benedikt, Oliver Creighton, and Leonid Kof. “Ambiguity detection: Towards a tool
explaining ambiguity sources.” Requirements Engineering: Foundation for Software
Quality. Springer Berlin Heidelberg, 2010. 218-232.
Van Lamsweerde, Axel. "Goal-oriented requirements engineering: A guided tour."
Requirements Engineering, 2001. Proceedings. Fifth IEEE International Symposium on.
IEEE, 2001.
Ferrari, Alessio, Paola Spoletini, and Stefania Gnesi. "Ambiguity as a resource to disclose
tacit knowledge." Requirements Engineering Conference (RE), 2015 IEEE 23rd
International. IEEE, 2015.
A. Ferrari (ISTI) Requirements Engineering 75 / 76
TODO: for next lecture
Mandatory:
Provide me your e-mail address to have the material:
alessio.ferrari@isti.cnr.it
Download GATE Developer:
https://gate.ac.uk/download/ (VERSION 8.0)
Make sure that it works (. . . open the application)
Optional:
Download and Install Python 2.7.5
(https://www.python.org/download/releases/2.7.5/)
Download and Install Python NLTK
(http://www.nltk.org/index.html)
A. Ferrari (ISTI) Requirements Engineering 76 / 76

More Related Content

Similar to Requirements Engineering: focus on Natural Language Processing, Lecture 1

C Cure Users Group Presentation Final 4
C Cure Users Group Presentation Final 4C Cure Users Group Presentation Final 4
C Cure Users Group Presentation Final 4halgig
 
What is data center availability modes slide
What is data center availability modes slideWhat is data center availability modes slide
What is data center availability modes slideLivin Jose
 
V&V Lessons Learnt under multiple Standards
V&V Lessons Learnt under multiple StandardsV&V Lessons Learnt under multiple Standards
V&V Lessons Learnt under multiple StandardsOak Systems
 
Workshop on requirements and modeling at HAE 2015
Workshop on requirements and modeling at HAE 2015Workshop on requirements and modeling at HAE 2015
Workshop on requirements and modeling at HAE 2015Olivier Béghain
 
Ieee c57123 ieee_guide_for_transformer_loss_management_200204
Ieee c57123 ieee_guide_for_transformer_loss_management_200204Ieee c57123 ieee_guide_for_transformer_loss_management_200204
Ieee c57123 ieee_guide_for_transformer_loss_management_200204Raymund Cortez
 
Microprocessor Microcontroller Interview & Viva Question.pdf
Microprocessor Microcontroller Interview & Viva Question.pdfMicroprocessor Microcontroller Interview & Viva Question.pdf
Microprocessor Microcontroller Interview & Viva Question.pdfEngineering Funda
 
Software EngineeringBackground for Question 1-7 Kean Universi.docx
Software EngineeringBackground for Question 1-7 Kean Universi.docxSoftware EngineeringBackground for Question 1-7 Kean Universi.docx
Software EngineeringBackground for Question 1-7 Kean Universi.docxwhitneyleman54422
 
Yakaiah_Resume_9Yrs
Yakaiah_Resume_9YrsYakaiah_Resume_9Yrs
Yakaiah_Resume_9YrsYakaiah S
 
Implementing SunGard Banner Voice Response
Implementing SunGard Banner Voice ResponseImplementing SunGard Banner Voice Response
Implementing SunGard Banner Voice Responseegrong
 
Roberta Nelson Shea of Rockwell Automation
Roberta Nelson Shea of Rockwell AutomationRoberta Nelson Shea of Rockwell Automation
Roberta Nelson Shea of Rockwell Automationadassoc
 
Open-DO Update
Open-DO UpdateOpen-DO Update
Open-DO UpdateAdaCore
 
E book dimensional engineering
E book dimensional engineeringE book dimensional engineering
E book dimensional engineeringJoao Baker
 
N soln peoplesoft
N soln peoplesoftN soln peoplesoft
N soln peoplesoftguest6b7ee2
 

Similar to Requirements Engineering: focus on Natural Language Processing, Lecture 1 (20)

C Cure Users Group Presentation Final 4
C Cure Users Group Presentation Final 4C Cure Users Group Presentation Final 4
C Cure Users Group Presentation Final 4
 
What is data center availability modes slide
What is data center availability modes slideWhat is data center availability modes slide
What is data center availability modes slide
 
V&V Lessons Learnt under multiple Standards
V&V Lessons Learnt under multiple StandardsV&V Lessons Learnt under multiple Standards
V&V Lessons Learnt under multiple Standards
 
Workshop on requirements and modeling at HAE 2015
Workshop on requirements and modeling at HAE 2015Workshop on requirements and modeling at HAE 2015
Workshop on requirements and modeling at HAE 2015
 
Ieee c57123 ieee_guide_for_transformer_loss_management_200204
Ieee c57123 ieee_guide_for_transformer_loss_management_200204Ieee c57123 ieee_guide_for_transformer_loss_management_200204
Ieee c57123 ieee_guide_for_transformer_loss_management_200204
 
Microprocessor Microcontroller Interview & Viva Question.pdf
Microprocessor Microcontroller Interview & Viva Question.pdfMicroprocessor Microcontroller Interview & Viva Question.pdf
Microprocessor Microcontroller Interview & Viva Question.pdf
 
Fehlmann and Kranich - Measuring tests using cosmic
Fehlmann and Kranich - Measuring tests using cosmicFehlmann and Kranich - Measuring tests using cosmic
Fehlmann and Kranich - Measuring tests using cosmic
 
Software EngineeringBackground for Question 1-7 Kean Universi.docx
Software EngineeringBackground for Question 1-7 Kean Universi.docxSoftware EngineeringBackground for Question 1-7 Kean Universi.docx
Software EngineeringBackground for Question 1-7 Kean Universi.docx
 
Writing srs
Writing srsWriting srs
Writing srs
 
Yakaiah_Resume_9Yrs
Yakaiah_Resume_9YrsYakaiah_Resume_9Yrs
Yakaiah_Resume_9Yrs
 
9. PA DIM presentation.pdf
9. PA DIM presentation.pdf9. PA DIM presentation.pdf
9. PA DIM presentation.pdf
 
Implementing SunGard Banner Voice Response
Implementing SunGard Banner Voice ResponseImplementing SunGard Banner Voice Response
Implementing SunGard Banner Voice Response
 
Roberta Nelson Shea of Rockwell Automation
Roberta Nelson Shea of Rockwell AutomationRoberta Nelson Shea of Rockwell Automation
Roberta Nelson Shea of Rockwell Automation
 
Open-DO Update
Open-DO UpdateOpen-DO Update
Open-DO Update
 
Rfp template
Rfp templateRfp template
Rfp template
 
BRD Detail
BRD DetailBRD Detail
BRD Detail
 
E book dimensional engineering
E book dimensional engineeringE book dimensional engineering
E book dimensional engineering
 
Application Portfolio Management
Application Portfolio ManagementApplication Portfolio Management
Application Portfolio Management
 
Norma ISA 5.1
Norma ISA 5.1Norma ISA 5.1
Norma ISA 5.1
 
N soln peoplesoft
N soln peoplesoftN soln peoplesoft
N soln peoplesoft
 

More from alessio_ferrari

Natural language processing for requirements engineering: ICSE 2021 Technical...
Natural language processing for requirements engineering: ICSE 2021 Technical...Natural language processing for requirements engineering: ICSE 2021 Technical...
Natural language processing for requirements engineering: ICSE 2021 Technical...alessio_ferrari
 
Systematic Literature Reviews and Systematic Mapping Studies
Systematic Literature Reviews and Systematic Mapping StudiesSystematic Literature Reviews and Systematic Mapping Studies
Systematic Literature Reviews and Systematic Mapping Studiesalessio_ferrari
 
Case Study Research in Software Engineering
Case Study Research in Software EngineeringCase Study Research in Software Engineering
Case Study Research in Software Engineeringalessio_ferrari
 
Survey Research In Empirical Software Engineering
Survey Research In Empirical Software EngineeringSurvey Research In Empirical Software Engineering
Survey Research In Empirical Software Engineeringalessio_ferrari
 
Qualitative Studies in Software Engineering - Interviews, Observation, Ground...
Qualitative Studies in Software Engineering - Interviews, Observation, Ground...Qualitative Studies in Software Engineering - Interviews, Observation, Ground...
Qualitative Studies in Software Engineering - Interviews, Observation, Ground...alessio_ferrari
 
Controlled experiments, Hypothesis Testing, Test Selection, Threats to Validity
Controlled experiments, Hypothesis Testing, Test Selection, Threats to ValidityControlled experiments, Hypothesis Testing, Test Selection, Threats to Validity
Controlled experiments, Hypothesis Testing, Test Selection, Threats to Validityalessio_ferrari
 
Requirements Engineering: focus on Natural Language Processing, Lecture 2
Requirements Engineering: focus on Natural Language Processing, Lecture 2Requirements Engineering: focus on Natural Language Processing, Lecture 2
Requirements Engineering: focus on Natural Language Processing, Lecture 2alessio_ferrari
 
Empirical Methods in Software Engineering - an Overview
Empirical Methods in Software Engineering - an OverviewEmpirical Methods in Software Engineering - an Overview
Empirical Methods in Software Engineering - an Overviewalessio_ferrari
 
Natural Language Processing (NLP) for Requirements Engineering (RE): an Overview
Natural Language Processing (NLP) for Requirements Engineering (RE): an OverviewNatural Language Processing (NLP) for Requirements Engineering (RE): an Overview
Natural Language Processing (NLP) for Requirements Engineering (RE): an Overviewalessio_ferrari
 

More from alessio_ferrari (9)

Natural language processing for requirements engineering: ICSE 2021 Technical...
Natural language processing for requirements engineering: ICSE 2021 Technical...Natural language processing for requirements engineering: ICSE 2021 Technical...
Natural language processing for requirements engineering: ICSE 2021 Technical...
 
Systematic Literature Reviews and Systematic Mapping Studies
Systematic Literature Reviews and Systematic Mapping StudiesSystematic Literature Reviews and Systematic Mapping Studies
Systematic Literature Reviews and Systematic Mapping Studies
 
Case Study Research in Software Engineering
Case Study Research in Software EngineeringCase Study Research in Software Engineering
Case Study Research in Software Engineering
 
Survey Research In Empirical Software Engineering
Survey Research In Empirical Software EngineeringSurvey Research In Empirical Software Engineering
Survey Research In Empirical Software Engineering
 
Qualitative Studies in Software Engineering - Interviews, Observation, Ground...
Qualitative Studies in Software Engineering - Interviews, Observation, Ground...Qualitative Studies in Software Engineering - Interviews, Observation, Ground...
Qualitative Studies in Software Engineering - Interviews, Observation, Ground...
 
Controlled experiments, Hypothesis Testing, Test Selection, Threats to Validity
Controlled experiments, Hypothesis Testing, Test Selection, Threats to ValidityControlled experiments, Hypothesis Testing, Test Selection, Threats to Validity
Controlled experiments, Hypothesis Testing, Test Selection, Threats to Validity
 
Requirements Engineering: focus on Natural Language Processing, Lecture 2
Requirements Engineering: focus on Natural Language Processing, Lecture 2Requirements Engineering: focus on Natural Language Processing, Lecture 2
Requirements Engineering: focus on Natural Language Processing, Lecture 2
 
Empirical Methods in Software Engineering - an Overview
Empirical Methods in Software Engineering - an OverviewEmpirical Methods in Software Engineering - an Overview
Empirical Methods in Software Engineering - an Overview
 
Natural Language Processing (NLP) for Requirements Engineering (RE): an Overview
Natural Language Processing (NLP) for Requirements Engineering (RE): an OverviewNatural Language Processing (NLP) for Requirements Engineering (RE): an Overview
Natural Language Processing (NLP) for Requirements Engineering (RE): an Overview
 

Recently uploaded

Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfchloefrazer622
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991RKavithamani
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactPECB
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application ) Sakshi Ghasle
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docxPoojaSen20
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 

Recently uploaded (20)

INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdf
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application )
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 

Requirements Engineering: focus on Natural Language Processing, Lecture 1

  • 1. Requirements Engineering: focus on Natural Language Requirements Processing Alessio Ferrari1 1ISTI-CNR, Pisa, Italy January 13, 2016 A. Ferrari (ISTI) Requirements Engineering 1 / 76
  • 2. A. Ferrari (ISTI) Requirements Engineering 2 / 76
  • 3. Objectives of the Course Objectives: lesson 1 Understand what are requirements, specifications and domain assertions Understand the problems behind requirements elicitation and SRS definition Learn how to write a decent SRS Objectives: lesson 2 Learn the basics of Natual Language Processing (NLP) Learn the relation between NLP and Requirements Learn the basics of GATE to detect NL ambiguities in requirements Learn the basics of Python NLTK (for further manipulation of NL requirements) A. Ferrari (ISTI) Requirements Engineering 3 / 76
  • 4. Concepts: Requirement, Specification, Domain Assertion A. Ferrari (ISTI) Requirements Engineering 4 / 76
  • 5. Michael Jackson’s Model When we build a SYSTEM we make a change in a portion of the WORLD that we call ENVIRONMENT ENVIRONMENT SYSTEM WORLD INTERFACE The SYSTEM and the ENVIRONMENT interact through an INTERFACE (i.e., sensors and actuators) A. Ferrari (ISTI) Requirements Engineering 5 / 76
  • 6. Concepts ENVIRONMENT SYSTEM WORLD INTERFACE RD S P M Domain Assertion Requirement Specification Program Machine A. Ferrari (ISTI) Requirements Engineering 6 / 76
  • 7. Concepts Domain assertions (D): all the conditions over phenomena of the environment that we know (or presume) to be true, regardless of the system Requirements (R): all the conditions over phenomena of the environment that we want to make true by developing the system Specifications (S): description of conditions and actions occurring at the interface between the environment and the system. Provides enough information for a programmer to build the system Program (P): implementation of the specifications Machine (M): hardware, sensors and actuators that support the program A. Ferrari (ISTI) Requirements Engineering 7 / 76
  • 8. Example: Patient Monitoring System ENVIRONMENT SYSTEM D1: there is always a nurse close enough to hear the buzzer D2: the sound from the heart below a threshold T indicates that the heart is about to stop R: the system shall notify the nurse if the patient's heartbeat stops S: if the sound from the sensor falls below a threshold T, the system shall actuate the buzzer P: the program M_v: the sensor and the buzzer M_h: the rest of the harware A. Ferrari (ISTI) Requirements Engineering 8 / 76
  • 9. Objective of Requirements Engineering Identify R, S and D, so that if a system whose behaviour satisfies S is installed in the environment, and the environment has the properties described in D, then the environment will exhibit the properties described in R. D, S R Read it as: The Specification S, under the constraints expressed in D, satisfies the Requirements R Requirements speak the language of the environment (i.e., the domain – medical, public administration, etc.) Specifications speak the language of the interface, and are expressed in terms of shared phenomena A. Ferrari (ISTI) Requirements Engineering 9 / 76
  • 10. Observation The formalisation is useful if I am using a formal language to define requirements and specifications The formalisation is only a guideline in practice, because the R and D speak about the world, which is not formal! In practice, requirements and specifications are rarely formal Requirements and specifications are often expressed in Natural Language (NL) The formalisation is still useful, and, even when expressing R, S and D in NL, you should keep it in mind A. Ferrari (ISTI) Requirements Engineering 10 / 76
  • 11. Requirements or Specifications? 1 Only authorised people shall be able to enter the park 2 The system shall allow only authorised people to enter the park 3 Only people who has payed the fee shall be able to enter the park 4 The system shall release a receipt, after the user has inserted coins, if the user has introduced 3 coins 5 The system shall open the barrier, if 3 coins have been introduced 6 The system shall enter in state COUNT_COINS, when the coin sensor senses the introduction of 1 coin, and the system is in state WAIT_COINS 7 The system shall enter in state RELEASE_RECEIPT, if the user has introduced 3 coins A. Ferrari (ISTI) Requirements Engineering 11 / 76
  • 12. Rule of Thumb If a Customer can read it, it’s a Requirement If a Customer cannot read it, it’s a Specification A. Ferrari (ISTI) Requirements Engineering 12 / 76
  • 13. Adding some Confusion: System and Software Specifications If I am defining System Specifications (S-SYS), then the hardware elements are part of the system, and part of them appear in the interface (as in the previous example) If I am defining Software Specifications (S-SW), then the hardware elements are part of the environment, and hence in the specification I will speak about abstract variables to be set. These variable are considered to be part of the interface (i.e., they are the variables used by the drivers). A. Ferrari (ISTI) Requirements Engineering 13 / 76
  • 14. Example: Patient Monitoring System ENVIRONMENT SOFTWARE D1: there is always a nurse close enough to hear the buzzer D2: the sound from the heart below a threshold T indicates that the heart is about to stop R (S-SYS): if the sound from the sensor falls below a threshold T, the system shall actuate the buzzer S (S-SW): the software shall set BUZZER = ON, if SOUND < T. P: the program M: see previous slide A. Ferrari (ISTI) Requirements Engineering 14 / 76
  • 15. This is just a practical solution! This is just a practical solution to overcome the problem of separating system and software specifications, as asked in the context of embedded safety-critical systems. In this lecture, we will mainly speak about system specifications. If sensors and actuators are just keyboards and screens, then the software specification is the system specification. WARNING: in the literature, when you read software specification, the authors often mean system specification. A. Ferrari (ISTI) Requirements Engineering 15 / 76
  • 16. Adding more Confusion: Software Requirements Specification We have seen that Requirements and Specifications are different So what the hell is a Software Requirements Specification (SRS)? It is a document that specifies the Requirements OR the Specification, OR both It depends on who is going to read the document A. Ferrari (ISTI) Requirements Engineering 16 / 76
  • 17. So What to Do? Keep in mind the distinction between R, S and D When you write a statement, make an effort to place it in R, S or D If a company has a single standard document to edit R and S, follow that, and separate R, S, and D If a company distinguishes between user/customer requirements and system/software requirements, then place R and D in the former, S in the latter, and trace them. If a company further distinguishes between system and software requirements, then follow the suggestion given in a previous slide. If a company does not have a standard document to edit requirements and specifications, then use the template in the IEEE Std 830-1998(R2009), which is nice. Consider who’s going to read the document! (Customer, Developer, Tester, etc.) A. Ferrari (ISTI) Requirements Engineering 17 / 76
  • 18. Adding more and more Confusion: Goals A requirement tells us WHAT the system shall do A GOAL tells us WHY the system shall do that thing Example Requirement: the system shall notify the nurse if the patient’s heartbeat stops Goal: patients whose heartbeat is going to stop shall be saved Expectation: when the nurse hears the buzzer, the nurse saves the patient Goals are useful in Requirements Analysis (Completeness) Which other requirements are needed to address the GOAL? (Alternatives) Is there an alternative approach? (Obstacles) What can be an obstacle for that GOAL? A. Ferrari (ISTI) Requirements Engineering 18 / 76
  • 19. Requirements Process (Revision) A. Ferrari (ISTI) Requirements Engineering 19 / 76
  • 20. The Requirements Process (Requirements Definition) Elicitation Analysis Documentation Validation Transcripts of Meetings with Customers Models Structured Requirements Document Requirements with Defects A. Ferrari (ISTI) Requirements Engineering 20 / 76
  • 21. Requirements Elicitation: Ambiguity Problems A. Ferrari (ISTI) Requirements Engineering 21 / 76
  • 22. Requirements Elicitation Requirements Analyst Customer Other Stakeholders Existing Documentation Legacy Software REQUIREMENTS A. Ferrari (ISTI) Requirements Engineering 22 / 76
  • 23. Interviews Requirements AnalystCustomer A. Ferrari (ISTI) Requirements Engineering 23 / 76
  • 24. Tacit Knowledge Requirements AnalystCustomer Tacit Knowledge A. Ferrari (ISTI) Requirements Engineering 24 / 76
  • 25. Ambiguity Requirements AnalystCustomer Tacit Knowledge ≠ A. Ferrari (ISTI) Requirements Engineering 25 / 76
  • 26. Definition of Ambiguity Ambiguity in Interviews An ambiguity occurs in a requirements elicitation interview when a customer articulates a unit of information, and the meaning assigned by the requirements analyst to such articulation differs from the meaning intended by the customer. Unit of information: system need or domain-related aspect Articulation: any speech fragment We include cases where the analyst cannot give any interpretation A. Ferrari (ISTI) Requirements Engineering 26 / 76
  • 27. Example: Ambiguity in Interviews Web-based platform where the citizens can send suggestions for laws to the parliament Ambiguity: “I want a dashboard to show (to the representatives of the parliament) what’s going on in specific areas” (thematic or geographical?) A. Ferrari (ISTI) Requirements Engineering 27 / 76
  • 28. Context of the Analyst INTERPRETATION ACCEPTANCE SPEECH FRAGMENT ACCESS Requirements Goals Domain Specification k k k kCONCEPT ACCESSIBLEa, i(k) = interpretablea,i(k) ∧ acceptablea,i(k) A. Ferrari (ISTI) Requirements Engineering 28 / 76
  • 29. Phenomenology of Ambiguity A. Ferrari (ISTI) Requirements Engineering 29 / 76
  • 30. Ambiguity ambiguousi(k) = articulatedc,i(k) ∧ ¬articulatedc,i(k )∧ (¬ACCESSIBLEa,i(k) ∨ interpretablea,i(k )) The customer articulates a unit of information k through a speech fragment i The unit of information k cannot be accessed or i is interpreted as k Let us focus on the second line of the equation, which is: ¬interpretablea,i(k) ∨ ¬acceptablea,i(k)∨ interpretablea,i(k ) A. Ferrari (ISTI) Requirements Engineering 30 / 76
  • 31. Categories of Ambiguity k k Phenomenon ¬interpretable(k) ¬acceptable(k) ¬interpretable(k ) - interpretation unclarity interpretable(k) ¬acceptable(k) ¬interpretable(k ) - acceptance unclarity interpretable(k) acceptable(k) interpretable(k ) acceptable(k ) multiple understanding ¬acceptable(k ) correct disambiguation - ¬acceptable(k) interpretable(k ) acceptable(k ) undetected incorrect disambiguation ¬acceptable(k ) detected incorrect disambiguation Four Main Classes Unclarity Multiple Understanding Incorrect Disambiguation Correct Disambiguation A. Ferrari (ISTI) Requirements Engineering 31 / 76
  • 33. Example Interpretation Unclarity Use of domain jargon (e.g., “connoisseurship method” for History of Arts expert) Use of vague terms (e.g., “(The app changes the color of the wall) taking light into account”) Acceptance Unclarity (Domain) “If you do not recycle a thing because the municipality did not signal that it was recyclable, you will not get a fee” A. Ferrari (ISTI) Requirements Engineering 33 / 76
  • 34. Multiple Understanding INTERPRETATION ACCEPTANCE SPEECH FRAGMENT ACCESS Requirements Goals Domain Specification k k' k k' kCONCEPT k'k ACCESSIBLEa,i(k) ∧ ACCESSIBLEa,i(k ) A. Ferrari (ISTI) Requirements Engineering 34 / 76
  • 35. Example Multiple Understanding Web-based platform where the citizens can send suggestions for laws to the parliament “A dashboard to show (to the representatives of the parliament) what’s going on in specific areas” (thematic or geographical?) “The application should be connected to a social network” (internal or external?) A. Ferrari (ISTI) Requirements Engineering 35 / 76
  • 37. Example Detected Incorrect Disambiguation: Fitness Tamagochi “You can decide what type of character you want to create” (Acceptance Unclarity - Domain) “So, you can choose the character?” “Actually you cannot [...] you can possibly become (a specific character)” Undetected Incorrect Disambiguation: Automated Baby-swinger “I want something that can change. A component that relax her (the daughter) is that she feels the novelty in the movement” Incorrect disambiguation: change in frequency “You can choose different sequences of movement, three in this direction, two in this direction” (Acceptance Unclarity - Req) Correct interpretation: change in direction A. Ferrari (ISTI) Requirements Engineering 37 / 76
  • 38. Correct Disambiguation INTERPRETATION ACCEPTANCE SPEECH FRAGMENT ACCESS Requirements Goals Domain Specification k k' k kCONCEPT k k' ACCESSIBLEa,i(k) ∧ interpretablea,i(k ) ∧ ¬acceptablea,i(k ) A. Ferrari (ISTI) Requirements Engineering 38 / 76
  • 39. Re-definition of strict-Ambiguity Let us exclude Correct Disambiguation: ambiguous-stricti(k) = articulatedc,i(k) ∧ ¬articulatedc,i(k )∧ (¬ACCESSIBLEa,i(k) ∨ interpretablea,i(k ))∧ ¬(ACCESSIBLEa,i(k) ∧ interpretablea,i(k ) ∧ ¬acceptablea,i(k )) A. Ferrari (ISTI) Requirements Engineering 39 / 76
  • 40. Your Turn! I am pretending to be the owner of a gym, and I’m coming to you to build a smart gym 5 minutes to prepare some questions Interview me, keeping in mind ambiguity issues and tacit knowledge Keep in mind that you have to elicit both R and D Hence, identify potential users, objects and principles in the domain Take notes Be careful that you’re speaking to someone who is not a software engineer A. Ferrari (ISTI) Requirements Engineering 40 / 76
  • 41. Requirements Analysis (Hints and References) A. Ferrari (ISTI) Requirements Engineering 41 / 76
  • 42. Requirements Analysis Requirements analysis is what you do after you met the customer, to: Reason on R and D, to write down a document that the customer can read Reason on R, D, and S to write down a (possibly separate) document that your programmers can read Often, you are going to write a single SRS with both R, S, and D From now on, I will speak about writing a SRS, meaning a document including R, S, and D Several techniques exist, I will give you just some pointers, since this lecture focuses on ambiguity A. Ferrari (ISTI) Requirements Engineering 42 / 76
  • 43. Example: Car Park System I want to build a system to automate the payment for a private car park The typical scenario is: 1 a car enters from an entrance barrier and the driver takes an entrance receipt from an entrance device 2 the driver parks the car 3 when the driver has to leave the park, he goes to a payment machine and inserts the entrance receipt 4 the machine computes the amount of money due 5 the driver pays and the machine releases an exit receipt 6 the driver inserts the exit receipt in an exit device, and the driver exits from the exit barrier The system also monitors the number of free places in the park A. Ferrari (ISTI) Requirements Engineering 43 / 76
  • 44. Pointer 1: Context Diagram System Car Barrier Park Coin Customer Shared Phenomena A. Ferrari (ISTI) Requirements Engineering 44 / 76
  • 45. Pointer 2: Prototyping and Mock-ups Googlehttp:/carpark.it My-Car Park Monitor Select a date 30 329 1 23128 2421 23 25 272622 201814 17 191615 129 1187 10 13 S 6 F 5 T 4 W 3 T 21 M 30 S December 2008 Select Today Check Failed Payment Machine See Car Park Occupation A. Ferrari (ISTI) Requirements Engineering 45 / 76
  • 46. Pointer 3: Use Case and UML Enter Car Park Car Driver Car Park Surveillant Monitor Car Park Exit Car Park Pay Parking A. Ferrari (ISTI) Requirements Engineering 46 / 76
  • 47. Pointer 4: Goal Modelling Profits Improved Automatic Car Park Defined Car Entrance Automated Car Exit Automated Payment Automated Verification of Payment AchievedOpen Barrier Achieved Close After Pass Achieved Trigger to Open Barrier Achieved Open Barrier if Payment Achieved Button System Implemented Open Photocell System Implemented Verify Money Achieved Release Receipt Achieved AND OR Open Button Controller Photocell Controller Counter Implemented Close Photocell System Implemented Payment MachineBarrier Controller Exit Controller A. Ferrari (ISTI) Requirements Engineering 47 / 76
  • 48. Documentation: Using NL Templates A. Ferrari (ISTI) Requirements Engineering 48 / 76
  • 49. Documentation: Using NL Templates SRS are written in Natural Language (NL), because several stakeholders with diverse skills have to interact with them SRS are written in NL, because formalisation is not possible at this stage of the development As spoken language is ambiguous, so it is written language In a conversation, I can ask clarifications, but when a document is written, it is not always that easy A. Ferrari (ISTI) Requirements Engineering 49 / 76
  • 50. A. Ferrari (ISTI) Requirements Engineering 50 / 76
  • 51. Rupp’s Template (more appropriate for R) between. For an automated tool to deem R1 as conformant, it has to correctly distinguish these three slots in the follow- ing: “monitor system configuration changes posted to the database”. A second important issue is that even when a slot falls in between fixed elements, e.g., hwhom?i, and is thus easy to delineate, there is no way to distinguish an acceptable filler for the slot from an unacceptable one, e.g., a grammatically-incorrect phrase. For instance, in R1, we may accept “system administrator” as correctly filling hwhom?i, but we may be unwilling to accept a grammatically-incor- rect phrase such as “system administer” for the slot. and define the glossary terms after the requirements have sufficiently matured and are thus less likely to change. This strategy avoids wasted effort at the glossary construction stage, but it also means that the glossary will not be ready in time to support activities such as template conformance checking (TCC), which often take place during requirements writing. Furthermore, the literature suggests that glossaries may remain incomplete throughout the entire development process [14], thus providing only partial coverage of the glossary terms. This implies that automated techniques for checking conformance to templates would have limited effectiveness if such techniques rely heavily on the glossary Fig. 1. Rupp’s template [5]. ARORA ET AL.: AUTOMATED CHECKING OF CONFORMANCE TO REQUIREMENTS TEMPLATES USING NATURAL LANGUAGE PROCESSING 945 A. Ferrari (ISTI) Requirements Engineering 51 / 76
  • 52. EARS Template (more appropriate for S) [16], [17], [18] and discussed in Section 2.1. In both of the studies that use Rupp’s template, the require- ments were written directly by professionals. As for the two studies using EARS, one—which is the larg- est case study reported in this article—was written directly by professionals as well, while the remain- ing study uses transformed requirements from one of our two case studies based on Rupp’s template. The results from our case studies indicate firstly, that templates and NLP to the extent needed in our approac Section 3 describes our approach for automation of TC Section 4 discusses tool support. Sections 5 presents the ca studies we have conducted to evaluate our approac Section 6 identifies the limitations and analyzes threats validity. Section 7 compares our approach with relat work. Section 8 concludes the article with a summary a directions for future work. . 3. The EARS template [16]. 6 IEEE TRANSACTIONS ON SOFTWARE ENGINEERING, VOL. 41, NO. 10, OCTOBER 2 A. Ferrari (ISTI) Requirements Engineering 52 / 76
  • 53. Templates for your exercise A. Ferrari (ISTI) Requirements Engineering 53 / 76
  • 54. FORMAT1. The system [shall|should] be able to < capability > (Il sistema [deve|dovrebbe] essere in grado di <capacità>) Example: The system shall be able to monitor the number of cars in the parking This format is also employed in case of statements that involve mandatory (shall) or optional (should) functionalities, which are unconditional and independent from the actions of the operators. Statements of this type are normally associated to interface functions, internal procedures, or procedures that manage internal data structures. A. Ferrari (ISTI) Requirements Engineering 54 / 76
  • 55. FORMAT2. The system [shall|should] allow the < user > to < action > (Il sistema [deve|dovrebbe] permettere a <utente> di <azione>) Example: The system shall allow the car driver to pay the parking This format is employed in case of statements that involve mandatory (shall) or optional (should) functionalities, which are unconditional and dependent from the actions of the operators. A. Ferrari (ISTI) Requirements Engineering 55 / 76
  • 56. FORMAT3. The system [shall|should] < action >, [when|after|before|if] < condition > {, [when|after|before|if] < condition >} (Il sistema [deve|dovrebbe] <azione>, [quando|dopo|prima|se] <condizione> {,[quando|dopo|prima|se] <condizione>}) Example. The system shall release the receipt, if the car driver has payed the required amount This format is employed when the action depends on one or more conditions. All conditions are considered in a logical AND relationship. If we want to express logical OR among conditions, it is recommended to add a new requirement or specification. A. Ferrari (ISTI) Requirements Engineering 56 / 76
  • 57. FORMAT4. [FORMAT1|FORMAT2|FORMAT3], < procedure > Example. The system shall signal the unavailability of receipts, before the user inserts coins, through a message on the screen This format is employed to specify functionalities that have an associated procedure, or that are performed through a well-defined interface device. The format shall be used when it is useful to explain HOW the system is expected to perform a certain action. A. Ferrari (ISTI) Requirements Engineering 57 / 76
  • 58. Your Turn! Write (part of) R, S for the smart gym following the templates Write D in NL without templates, in a rigorous language You can use the same template for R and S, the only difference resides in the vocabulary that you use If you speak only about elements in the interface, then it is S If you speak about elements in the environment and (optionally) about elements in the interface, then it is R While you write a new entity or action, store it in the vocabulary and tell if it belongs to the interface or to the environment You have 30 minutes Hints Hint 1 identify interfaces, users, and main functions of your system Hint 2: try to list as many R as possible; select one; write S for that; state the D that are needed to satisfy R Hint 3: if needed, partition the system into sub-systems A. Ferrari (ISTI) Requirements Engineering 58 / 76
  • 59. Examples R, S, D R1: (F1) The system shall be able to monitor the workout of the customer R2: (F2) The system shall allow the trainer to visualise the workout of the customer S1: (F1) The system-CentralUnit shall be able to store the data coming from the wrist-band of the customer S2: (F3) The system-UI shall visualise the workout plot of the customer, when the trainer presses the button B, if the system-UI is in Page P. D1: Each customer is equipped with a wrist-band D2: The wrist-band records the data concerning the workout of the customer A. Ferrari (ISTI) Requirements Engineering 59 / 76
  • 60. Summary of the Templates F1: The system [shall|should] be able to < capability > (unconditional user-independent capability) F2: The system [shall|should] allow the < user > to < action > (unconditional user-dependent action) F3: The system [shall|should] < action >, [when|after|before|if] < condition > {, [when|after|before|if] < condition >} (conditional action) F1|F2|F3, < procedure > (if I have to tell HOW) A. Ferrari (ISTI) Requirements Engineering 60 / 76
  • 61. Validation: Sins of the Requirements Engineer, and NL Ambiguity A. Ferrari (ISTI) Requirements Engineering 61 / 76
  • 62. 9 Sins of the Requirements Engineer Noise: Presence into the text of an element not adding problem relevant information “The car park has three elevators” Silence: Existence of a characteristics of the problem not covered by any text element Have I though about the limit in the number of places in the car park? “If the user has inserted the correct amount of money, the system shall release a receipt” (what if the amount is not correct?) Overspecification: Presence into the text of an element not corresponding to any characteristic of the problem but to possible implementation characteristics “When a car enters the park, the system shall add one to the car counter” A. Ferrari (ISTI) Requirements Engineering 62 / 76
  • 63. 9 Sins of the Requirements Engineer (continue) Contradiction: presence into the text of two or more elements defining system characteristics in a inconsistent way “Only when the red button is pressed, the system shall release the receipt” “The system shall release the receipt when the user inserts coins” Ambiguity: presence into the text of an element that makes possible different interpretations of one characteristic of the system “When the user presses the button, the system shall release the receipt” - which button? A. Ferrari (ISTI) Requirements Engineering 63 / 76
  • 64. 9 sins of the Requirements Engineer (continue) Forward references: presence into the text of an element using characteristics of the problem defined below Consider the red button is defined after you tell how to use it Wishful thinking: presence into the text of an element defining a characteristic of the problem so that a possible solution of this problem cannot be realistically validated “The car park receipt shall not be thrown away after parking” A. Ferrari (ISTI) Requirements Engineering 64 / 76
  • 65. 9 sins of the Requirements Engineer (continue) Synthesis presence of a requirement that states more than one functionality, and hence needs multiple-tests “The system shall allow the car driver to enter and exit from the park” Repetition: presence of multiple statements expressing the same requirement “The system shall show the amount of money due, after the user has inserted the entrance card” “If the user provided the entrance card, the system shall visualise the amount of money due” A. Ferrari (ISTI) Requirements Engineering 65 / 76
  • 66. 9 Sins - Summary 1 Noise = irrelevant information 2 Silence = absence of relevant information 3 Overspecification = implementation-related information 4 Contradiction = contradictory information 5 Ambiguity = multiple interpretations possible 6 Forward references = wrong information sequence 7 Wishful thinking = potential validation problems 8 Synthesis = potential validation problems 9 Repetition = potential validation problems, and ambiguity A. Ferrari (ISTI) Requirements Engineering 66 / 76
  • 67. Ambiguity in NL Requirements Templates are useful to reduce ambiguity, but ambiguity might still be there Moreover, templates are not always used in practice We need more fine-grained lenses to reduce ambiguities Previously, we have classified ambiguities depending on the way they are perceived by a listener The previous classes can be applied also for written text, substituting the listener with the reader Here, we classify the triggers of ambiguity in written language, which can lead to different classes of ambiguities from the point of view of the reader These triggers can be applied also to spoken language, but they are harder to detect (verba volant, scripta manent) A. Ferrari (ISTI) Requirements Engineering 67 / 76
  • 68. Categories of Ambiguity Pure Ambiguities Lexical: the terms used have different vocabulary meanings Syntactic: the syntactic structure has more than one interpretation Semantic: no lexical or syntactic ambiguity, but the expression is ambiguous Quasi-Ambiguities Vagueness: there are cases in which the meaning of the expression cannot be established Generality: the expression is too abstract A. Ferrari (ISTI) Requirements Engineering 68 / 76
  • 69. Lexical Ambiguities Homonymy: words have unrelated meanings, but they have the same written representations Example: I went to the bank. (bank = ground close to a lake; financial institution) Polysemy: words have related different meanings, but they have the same written representations Example: There is a mole at work. (mole = animal; spy) These types of ambiguity are rare in requirements, but it’s good to know they exist, since they can occur during elicitation (e.g., “rilevato sul piano cutaneo” - homonymy). A. Ferrari (ISTI) Requirements Engineering 69 / 76
  • 70. Syntactic Ambiguities Analytical: a complex noun group with modifiers, and you do not know which to which noun the modifiers refer Example: The principal system administrator shall be able to enter the data-base (principal = system or administrator?) Attachment: a preposition (e.g., “with”, “for”, “by”) can be attached to different parts of the sentence Example: The system shall produce a resumee using a template for the final assessment (for the final assessment: is the template, or is it an objective?) Coordination: complex combinations of AND/OR, or modifier + AND/OR Example: The system shall produce the plot or the data-log and the legend. Example: Novel employees and directors shall be provided with a user-name and password A. Ferrari (ISTI) Requirements Engineering 70 / 76
  • 71. Syntactic Ambiguities (continues) Elliptical: omission of words, which are expected to be deduced from the context Example: The system produces a positive notification in case of success, and in case of failure doesn’t (does not produce any notification at all?) Anaphoric: usage of pronouns (e.g., he, it, his, this), which can be referred to different nouns. Example: “When the system sends a message to the receiver, it shall provide an acknowledgement” (it = “system” or “receiver”?) These are less frequent in spoken language, but rather frequent in written requirements. A. Ferrari (ISTI) Requirements Engineering 71 / 76
  • 72. Semantic Ambiguities These are due to ambiguous interactions of logical quantifiers (every, each, all, any, some, none, a, etc.), and to the use of plurals. Example: All lights have a switch (one for all, or one for each?) Example: An alert shall be raised for each failure-mode (the same alert?) Example: The wrist-bands contain movement sensors (one-one, one-many, many-one, many-many?) Hint: do not use plurals, and be careful with quantifiers These are also due to the usage of synonyms in requirements Example: The system shall allow the car driver to insert coins Example: The system shall release the receipt if the user has payed A. Ferrari (ISTI) Requirements Engineering 72 / 76
  • 73. Generality These cases are due to the usage of terms (names or verbs) that are too abstract They are not classified as ambiguities, because, depending on the context, a more detailed description might not be required. In requirements and specifications, generality can be reduced through the vocabulary Example: The system shall be able to produce the report Example: The system shall be able to alert the user in case of failure Example: The system shall be able to produce a graph of the workout of the customer In the literature, generality problems are often marked as “pragmatic ambiguities”. This often causes confusion. Pragmatic ambiguities are concerned with the effect, while here we focus on triggers. A. Ferrari (ISTI) Requirements Engineering 73 / 76
  • 74. Vagueness Vagueness occurs when an expression (often, adjective or adverb) has not a uniquely quantifiable meaning. Several vague expression can be listed (accurate, suitable, appropriate, clearly, better, accordingly, depending on, if necessary, if needed, etc.) In general, avoid adjectives and adverbs Example: The system shall be able to show the graph of the workout if required Example: The system shall be able to show a suitable representation of the workout Example: When appropriate, the system shall display low levels of workout A. Ferrari (ISTI) Requirements Engineering 74 / 76
  • 75. Further Readings Gunter, Carl, et al. “A reference model for requirements and specifications.” Requirements Engineering, 2000. Proceedings. 4th International Conference on. IEEE, 2000. Jackson, Michael. “The meaning of requirements.” Annals of Software Engineering 3.1 (1997): 5-21. Zave, Pamela, and Michael Jackson. “Four dark corners of requirements engineering.” ACM transactions on Software Engineering and Methodology (TOSEM) 6.1 (1997): 1-30. Berry, Daniel M. "From contract drafting to software specification: Linguistic sources of ambiguity-a handbook version 1.0." (2000). Gleich, Benedikt, Oliver Creighton, and Leonid Kof. “Ambiguity detection: Towards a tool explaining ambiguity sources.” Requirements Engineering: Foundation for Software Quality. Springer Berlin Heidelberg, 2010. 218-232. Van Lamsweerde, Axel. "Goal-oriented requirements engineering: A guided tour." Requirements Engineering, 2001. Proceedings. Fifth IEEE International Symposium on. IEEE, 2001. Ferrari, Alessio, Paola Spoletini, and Stefania Gnesi. "Ambiguity as a resource to disclose tacit knowledge." Requirements Engineering Conference (RE), 2015 IEEE 23rd International. IEEE, 2015. A. Ferrari (ISTI) Requirements Engineering 75 / 76
  • 76. TODO: for next lecture Mandatory: Provide me your e-mail address to have the material: alessio.ferrari@isti.cnr.it Download GATE Developer: https://gate.ac.uk/download/ (VERSION 8.0) Make sure that it works (. . . open the application) Optional: Download and Install Python 2.7.5 (https://www.python.org/download/releases/2.7.5/) Download and Install Python NLTK (http://www.nltk.org/index.html) A. Ferrari (ISTI) Requirements Engineering 76 / 76