Transcript Slide 1
Sentence Patterns for
Functional Requirements
Jim Adams
Public Domain Dedication
Public Domain Dedication 2011
Written by James M Adams III
The author hereby dedicates whatever copyright he holds in this
file to the public domain. The author makes this dedication for
the benefit of the public at large and to the detriment of the
author's heirs and successors. The author recognizes that, once
placed in the public domain, this file may be freely reproduced,
distributed, transmitted, used, modified, built upon, or
otherwise exploited by anyone for any purpose, commercial or
non-commercial, and in any way, including by methods that
have not yet been invented or conceived.
Copyright © 2006 Gecko House, Inc. Dedicated to Public Domain 2011
2
A Few of the Many
Types of Requirements
Functional/Behavioral
Quality of Service
Features
The “ilities”: reliability, availability, maintainability,
usability, etc.
Composition
Brochure Bullets
Inherently Ambiguous
Implementation Requirements/Constraints
Requirements that dictate implementation
3
Phrases That Are Not
Functional/Behavioral
The system shall
provide …
utilize …
use …
ensure …
survive the xxx
environment
The system shall
comply with …
be as specified in …
be capable of …
have the capability
of …
meet the xxx
standard
4
The Top Level
Sentence Pattern
Functional Requirements
Condition
Condition:
Trigger:
Reaction:
Termination:
Trigger
Reaction
Termination
While some condition is true,
when some event occurs,
then the system shall react,
before or until
some other condition is true.
6
Functional Requirements
Condition
Condition:
Trigger:
Reaction:
Termination:
Trigger
Reaction
Termination
While the moon is in the seventh house,
and Jupiter aligns with Mars,
then peace shall guide the planets,
until the end of the Age of Aquarius.
With apologies to Gerome Ragni and James Rado who wrote the lyrics
to the song Aquarius from the Broadway musical Hair.
7
Condition
Trigger
Reaction
Termination
In time order because it is easiest to understand
Condition – something that is true or false; a
relational expression; the text that fills the ( ) in an
“if” statement
Trigger – some kind of a change; a change of value,
a change of state, an input, the passage of time
Reaction – some kind of change caused by the
system; a value change, a state change, an output
Termination – a point in time to start or complete the
reaction
8
The High Level Details
Sentence Patterns
as
Block Diagrams
Condition
Boolean
State
Trigger
Reaction
Termination
Ongoing
A Condition starts with “If”, “Until”, “While” or “For as
long as”
There are three types of Conditions
Boolean Condition – a relational expression which is true or
false. “If the temperature is below freezing …”
State Condition – a statement that the system is or is not, in
one of its’ major operational modes. “Until the system is in
launch mode …”
Ongoing Condition – a boolean condition, usually external,
that depends on a continuing action. “While the user is
pressing the button … ”
Any number of conditions can be combined with
“and”, “or” and “not”.
10
Trigger
Condition
Action
Interval
Reaction
Termination
Timeout
The Trigger may be prefixed with “when”,
“then”, “and”, or “if”
There are three types of Triggers
Action Event – a change in a value, a change of
state, an input, or an output
Time Interval Event – some time window relative
to an earlier action. “… no later than 5 minutes
after the temperature falls below freezing …”
Timeout Event – watchdog timer expiration.
“… if the system does not reset the watchdog
timer within three seconds, …”
11
Reaction
Condition
Trigger
Value
State
Termination
I/O
There are three types of Reactions
Internal Value Change – “… the system
shall increment the command count …”
State Change – “… the system shall set the
processor state to STANDBY …”
Input/Output – “… the system shall send
the PowerOn command to the GPS unit
over the 1553 interface …”
12
Termination
Condition
Trigger
Reaction
Action
Interval
Condition
There are three types of Terminations
Action Event (Deadline or Finish Line) –
“… before the temperature falls below
freezing.”
Time Interval Event – “… within 3 msec.”
Condition – “… for as long as the
temperature is below freezing.”
13
The Low Level Details
Sentence Patterns
as
Flowcharts
Vocabulary
Component – a subdivision of the system;
subsystem, box, segment, board, object,
configuration item, etc.
Property – an attribute of a component
Value – properties can have values, either a number
(32) or a name for a number (freezing)
State – a property with named values; mode
Action – changing a property value, a state value or
doing I/O
Actor – any part of the system that can perform an
action; agent, entity, active object, task, process, etc.
15
Vocabulary
Reference to an Action – rephrasing an action in the
past tense
“ing” form of a verb – gerund
Duration – a value which has units of time
Relational Expression – “less than”, “greater than”,
“equal”, “not equal”, “greater than or equal to”, etc.
Boolean Condition – a statement which uses a
relational expression – “while the temperature is less
than freezing”
16
Condition
Boolean
State
Trigger
Reaction
Termination
Ongoing
A Condition starts with “If”, “Until”, “While” or “For as
long as”
There are three types of Conditions
Boolean Condition – a relational expression which is true or
false. “If the temperature is below freezing …”
State Condition – a statement that the system is or is not, in
one of its’ major operational modes. “Until the system is in
the launch mode …”
Ongoing Condition – a boolean condition, usually external,
that depends on a continuing action. “While the user is
pressing the button … ”
Any number of conditions can be combined with
“and”, “or” and “not”.
17
Condition
Boolean
State
Trigger
Reaction
Termination
Ongoing
Boolean Condtion
Property Value
three volts
is
is not
has been
has not been
Property Name
the battery voltage
Relational Expression
less than
Property Name
the threshold voltage
Time Interval
Duration
for at least
for more than
3 seconds
and
for at most
for not more than
Duration
5 seconds
18
Condition
Boolean
State
Trigger
Reaction
Termination
Ongoing
State Condition
Name of something with State
the system
is
is not
has been
has not been
in the
State Name
standby mode
Time Interval
Duration
for at least
for more than
3 seconds
and
for at most
for not more than
Duration
5 seconds
19
Condition
Boolean
State
Trigger
Reaction
Termination
Ongoing
Ongoing Condition
is
is not
has been
has not been
Noun Phrase for an Actor
the user
“ing” form of Verb
pressing
Direct Object
the button
Time Interval
Duration
for at least
for more than
3 seconds
and
for at most
for not more than
Duration
5 seconds
20
Trigger
Condition
Action
Interval
Reaction
Termination
Timeout
The Trigger may be prefixed with “when”,
“then”, “and”, or “if”
There are three types of Triggers
Action Event – a change in a value or a change of
state
Time Interval Event – some time window relative
to an earlier action. “… no later than 5 minutes
after the temperature falls below freezing …”
Timeout Event – watchdog timer expiration.
“… when the system does not reset the watchdog
timer within three seconds, …”
21
Trigger
Condition
Action
Interval
Reaction
Termination
Timeout
There are three types of Actions
Internal Value Change – “… if the
command count is incremented …”
State Change – “… when the processor
state changes to STANDBY …”
Input/Output – “… and FSW sends the
PowerOn command to the GPS unit over
the 1553 interface …”
22
Trigger
Condition
Action
Interval
Reaction
Termination
Timeout
Value Change Action
Property Value
3 amps
Property Name
the charging current
Value Change
is changed to
Property Name
trickle charge
23
Trigger
Condition
Action
Interval
Reaction
Termination
Timeout
State Change Action
State Variable name
the processor state
Value Change
is changed to
State Name
low power mode
24
Trigger
Condition
Action
Interval
Reaction
Termination
Timeout
Input/Output Action
Actor Name
Phrase for an I/O action
the guidance system
sends
Direct Object
the xxx command
Indirect Object
to the star tracker
25
Trigger
Condition
Action
Interval
Reaction
Termination
Timeout
There are two types of Time Intervals
Duration – “… 3 seconds after the
temperature falls below freezing …”
Time Window – “… no sooner than 3
seconds and no later than 5 seconds after
the temperature falls below freezing …”
26
Trigger
Condition
Action
Interval
Reaction
Termination
Timeout
later
Duration
Reference to an Action
Time Value
3 seconds
after
Time Property Name
the charging current
was set to the default
value
max burn time
27
Action
Trigger
Condition
Interval
Reaction
Termination
Timeout
Time Window
no sooner than
no earlier than
at the earliest
after
Duration
3 seconds
later
Reference to an Action
after
and
no later than
at the latest
within
the charging current
was set to the default
value
Duration
3 seconds
28
Trigger
Condition
Action
Interval
Reaction
Termination
Timeout
There are two types of Timeouts
Active – “… the background task does not
reset the watchdog within 3 seconds …”
Passive – “… the watchdog is not reset
within 3 second …”
Only the active form is shown on the
chart.
29
Action
Trigger
Condition
Interval
Reaction
Termination
Timeout
Timeout Action
Actor
the background task
does not
did not
Verb Phrase for an Action
reset the watchdog timer
Duration
within
3 seconds
30
Reaction
Condition
Trigger
Value
State
Termination
I/O
There are three types of Reactions
Internal Value Change – “… the system
shall increment the command count …”
State Change – “… the system shall set the
processor state to STANDBY …”
Input/Output – “… the system shall send
the PowerOn command to the GPS unit
over the 1553 interface …”
31
Reaction
Condition
Value
State
Trigger
Termination
I/O
Value Change Reaction
Actor Name
the power system
shall
Property Value
to 3 amps
Phrase for value change
Property Name
set
the charging current
Property Name
to trickle charge
Duration
every
3 msec
32
Reaction
Condition
Value
State
Trigger
Termination
I/O
State Change Reaction
Actor Name
the guidance system
shall
Phrase for state change
Name of something with State
set
the processor state
State Name
to standby mode
Duration
every
3 msec
33
Reaction
Condition
Value
State
Trigger
Termination
I/O
Input/Output Reaction
Phrase for an I/O action
Actor Name
send
shall
the power system
Indirect Object
Direct Object
the xxx command
to the momentum wheel
Duration
every
3 msec
34
Termination
Condition
Trigger
Reaction
Action
Interval
Condition
There are three types of Terminations
Action Event (Deadline or Finish Line) –
“… before the temperature falls below
freezing.”
Time Interval Event – “… within 3 msec.”
Termination Condition – “… for as long as
the temperature is below freezing.”
35
Termination
Condition
Trigger
Reaction
Action
Interval
Condition
A termination Action must be prefixed with
either “before” or “until”.
Same as Action within Trigger
There are three types of Actions
Internal Value Change – “… if the command count
is incremented …”
State Change – “… when the processor state
changes to STANDBY …”
Input/Output – “… and FSW sends the PowerOn
command to the GPS unit over the 1553 interface
…”
36
Termination
Condition
Trigger
Reaction
Action
Interval
Condition
Same as Time Interval within Trigger
There are two types of Time Intervals
Duration – “… 3 seconds after the
temperature falls below freezing …”
Time Window – “… no sooner than 3
seconds and no later than 5 seconds after
the temperature falls below freezing …”
37
Termination
Condition
Trigger
Reaction
Action
Interval
Condition
Same as the initial condition, except that it can not
start with “if”.
There are three types of Conditions
Boolean Condition – a relational expression which is true or
false. “If the temperature is below freezing …”
State Condition – a statement that the system is or is not, in
one of its’ major operational modes. “Until the system is in
the launch mode …”
Ongoing Condition – a boolean condition, usually external,
that depends on a continuing action. “While the user is
pressing the button … ”
38
Examples
Condition
Boolean
Trigger
Action
Reaction
Value
Termination
Action
State
Interval
State
Interval
Ongoing
Timeout
I/O
Condition
40
Condition
Boolean
Trigger
Action
Reaction
Value
Termination
Action
State
Interval
State
Interval
Ongoing
Timeout
I/O
Condition
Condition:
Trigger:
Reaction:
While in Normal-Operation mode,
the system shall send
a 10 msec pulse to the instrument
every second.
Termination:
41
Condition
Boolean
Trigger
Action
Reaction
Value
Termination
Action
State
Interval
State
Interval
Ongoing
Timeout
I/O
Condition
Condition:
Trigger:
Reaction:
While in On-Orbit-Operation mode,
the system shall measure
the battery voltage every 100 msec.
Termination:
42
Condition
Boolean
Trigger
Action
Reaction
Value
Termination
Action
State
Interval
State
Interval
Ongoing
Timeout
I/O
Condition
Condition:
Trigger:
Reaction:
When the measured battery voltage
falls below the lower threshold
the system shall disconnect two solar
panels from the battery and connect
them to the control circuit.
Termination:
43
Condition
Boolean
Trigger
Action
Reaction
Value
Termination
Action
State
Interval
State
Interval
Ongoing
Timeout
I/O
Condition
Condition:
Trigger:
Reaction:
While two solar panels are connected
to the control circuit,
when the measured battery voltage
rises above the upper threshold,
the system shall release
the two solar panels.
Termination:
44
Speculation In Search Of a
Counterexample
A functional requirement is unambiguous if
and only if all of the properties mentioned in
the requirement
are constants, or
are numbers, or names for numbers, that appear at
the interface, or
are derived from numbers that appear at the
interface, or
are names from an ICD
45
Condition
Boolean
Trigger
Action
Reaction
Value
Termination
Action
State
Interval
State
Interval
Ongoing
Timeout
I/O
Condition
Condition:
Trigger:
Reaction:
Termination:
While the moon is in the seventh house,
and Jupiter aligns with Mars,
then peace shall guide the planets,
until the end of the Age of Aquarius.
46
Jupiter aligns with Mars
Jupiter and Mars as identifiers in Star
Camera ICD
Centroids of observed objects in Star
Camera ICD
Tolerance for distance between
centroids that defines “aligns”
47