sentence patterns for functional requirements jim adams

47
Sentence Patterns for Functional Requirements Jim Adams

Upload: hailey-fagan

Post on 26-Mar-2015

227 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Sentence Patterns for Functional Requirements Jim Adams

Sentence Patterns for Functional Requirements

Jim Adams

Page 2: 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

Page 3: Sentence Patterns for Functional Requirements Jim Adams

3

A Few of the ManyTypes of Requirements Functional/Behavioral Quality of Service

The “ilities”: reliability, availability, maintainability, usability, etc.

Features Composition Brochure Bullets Inherently Ambiguous

Implementation Requirements/Constraints Requirements that dictate implementation

Page 4: Sentence Patterns for Functional Requirements Jim Adams

4

Phrases That Are NotFunctional/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

Page 5: Sentence Patterns for Functional Requirements Jim Adams

The Top Level Sentence Pattern

Page 6: Sentence Patterns for Functional Requirements Jim Adams

6

Functional Requirements

Condition: While some condition is true,Trigger: when some event occurs,Reaction: then the system shall react,Termination: before or until

some other condition is true.

Condition TerminationReactionTrigger

Page 7: Sentence Patterns for Functional Requirements Jim Adams

7

Functional Requirements

Condition: While the moon is in the seventh house,

Trigger: and Jupiter aligns with Mars,Reaction: then peace shall guide the planets,Termination: 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.

Condition TerminationReactionTrigger

Page 8: Sentence Patterns for Functional Requirements Jim Adams

8

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

Condition TerminationReactionTrigger

Page 9: Sentence Patterns for Functional Requirements Jim Adams

The High Level Details

Sentence Patterns as

Block Diagrams

Page 10: Sentence Patterns for Functional Requirements Jim Adams

10

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”.

ReactionTrigger State

Ongoing

BooleanCondition

Termination

Page 11: Sentence Patterns for Functional Requirements Jim Adams

11

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, …”

Condition Reaction Interval

Timeout

ActionTrigger

Termination

Page 12: Sentence Patterns for Functional Requirements Jim Adams

12

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 …”

Condition Trigger State

I/O

ValueReaction

Termination

Page 13: Sentence Patterns for Functional Requirements Jim Adams

13

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.”

Condition ReactionTrigger Interval

Condition

ActionTermination

Page 14: Sentence Patterns for Functional Requirements Jim Adams

The Low Level Details

Sentence Patterns as

Flowcharts

Page 15: Sentence Patterns for Functional Requirements Jim Adams

15

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.

Page 16: Sentence Patterns for Functional Requirements Jim Adams

16

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”

Page 17: Sentence Patterns for Functional Requirements Jim Adams

17

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”.

ReactionTrigger State

Ongoing

BooleanCondition

Termination

Page 18: Sentence Patterns for Functional Requirements Jim Adams

18

ReactionTrigger State

Ongoing

BooleanCondition

Termination

Boolean Condtion

the battery voltageProperty Name

isis not

has beenhas not been

less thanRelational Expression

three voltsProperty Value

the threshold voltageProperty Name

Time Interval

for at leastfor more than

and

for at mostfor not more than

3 secondsDuration

5 secondsDuration

Page 19: Sentence Patterns for Functional Requirements Jim Adams

19

ReactionTrigger State

Ongoing

BooleanCondition

Termination

State Condition

Name of something with State

the system

isis not

has beenhas not been

standby modeState Name

in the

Time Interval

for at leastfor more than

and

for at mostfor not more than

3 secondsDuration

5 secondsDuration

Page 20: Sentence Patterns for Functional Requirements Jim Adams

20

ReactionTrigger State

Ongoing

BooleanCondition

Termination

Ongoing Condition

the userNoun Phrase for an Actor

pressing“ing” form of Verb

the buttonDirect Object

isis not

has beenhas not been

Time Interval

for at leastfor more than

and

for at mostfor not more than

3 secondsDuration

5 secondsDuration

Page 21: Sentence Patterns for Functional Requirements Jim Adams

21

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, …”

Condition Reaction Interval

Timeout

ActionTrigger

Termination

Page 22: Sentence Patterns for Functional Requirements Jim Adams

22

Condition Reaction Interval

Timeout

ActionTrigger

Termination

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 …”

Page 23: Sentence Patterns for Functional Requirements Jim Adams

23

Condition Reaction Interval

Timeout

ActionTrigger

Termination

Value Change Action

the charging currentProperty Name

is changed toValue Change

3 ampsProperty Value

trickle chargeProperty Name

Page 24: Sentence Patterns for Functional Requirements Jim Adams

24

Condition Reaction Interval

Timeout

ActionTrigger

Termination

State Change Action

low power modeState Name

the processor stateState Variable name

is changed toValue Change

Page 25: Sentence Patterns for Functional Requirements Jim Adams

25

Condition Reaction Interval

Timeout

ActionTrigger

Termination

Input/Output Action

the guidance systemActor Name

sendsPhrase for an I/O action

the xxx commandDirect Object

to the star trackerIndirect Object

Page 26: Sentence Patterns for Functional Requirements Jim Adams

26

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 …”

Condition Reaction Interval

Timeout

ActionTrigger

Termination

Page 27: Sentence Patterns for Functional Requirements Jim Adams

27

Condition Reaction Interval

Timeout

ActionTrigger

Termination

after

Duration

3 secondsTime Value

max burn timeTime Property Name

the charging current was set to the default

value

Reference to an Action

later

Page 28: Sentence Patterns for Functional Requirements Jim Adams

28

Condition Reaction Interval

Timeout

ActionTrigger

Termination

Time Window

no later thanat the latest

within3 seconds

Duration

no sooner thanno earlier thanat the earliest

after

3 secondsDuration

andafter

the charging current was set to the default

value

Reference to an Action

later

Page 29: Sentence Patterns for Functional Requirements Jim Adams

29

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.

Condition Reaction Interval

Timeout

ActionTrigger

Termination

Page 30: Sentence Patterns for Functional Requirements Jim Adams

30

Condition Reaction Interval

Timeout

ActionTrigger

Termination

Timeout Action

reset the watchdog timerdoes notdid not

the background taskActor

within 3 secondsDuration

Verb Phrase for an Action

Page 31: Sentence Patterns for Functional Requirements Jim Adams

31

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 …”

Condition Trigger State

I/O

ValueReaction

Termination

Page 32: Sentence Patterns for Functional Requirements Jim Adams

32

Condition Trigger State

I/O

ValueReaction

Termination

Value Change Reaction

the charging currentProperty Name

setPhrase for value change

to 3 ampsProperty Value

to trickle chargeProperty Name

shallthe power systemActor Name

every 3 msecDuration

Page 33: Sentence Patterns for Functional Requirements Jim Adams

33

Condition Trigger State

I/O

ValueReaction

Termination

State Change Reaction

to standby modeState Name

the processor state Name of something with State

setPhrase for state change

shallthe guidance systemActor Name

every 3 msecDuration

Page 34: Sentence Patterns for Functional Requirements Jim Adams

34

Condition Trigger State

I/O

ValueReaction

Termination

Input/Output Reaction

the power systemActor Name

send

Phrase for an I/O action

the xxx commandDirect Object

to the momentum wheelIndirect Object

shall

every 3 msecDuration

Page 35: Sentence Patterns for Functional Requirements Jim Adams

35

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.”

Condition ReactionTrigger Interval

Condition

ActionTermination

Page 36: Sentence Patterns for Functional Requirements Jim Adams

36

Condition ReactionTrigger Interval

Condition

ActionTermination

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 …”

Page 37: Sentence Patterns for Functional Requirements Jim Adams

37

Condition ReactionTrigger Interval

Condition

ActionTermination

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 …”

Page 38: Sentence Patterns for Functional Requirements Jim Adams

38

Condition ReactionTrigger Interval

Condition

ActionTermination

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 … ”

Page 39: Sentence Patterns for Functional Requirements Jim Adams

Examples

Page 40: Sentence Patterns for Functional Requirements Jim Adams

40

State

Ongoing

BooleanCondition

Interval

Timeout

ActionTrigger

State

I/O

ValueReaction

Interval

Condition

ActionTermination

Page 41: Sentence Patterns for Functional Requirements Jim Adams

41

Condition: While in Normal-Operation mode,Trigger:Reaction: the system shall send

a 10 msec pulse to the instrumentevery second.

Termination:

State

Ongoing

BooleanCondition

Interval

Timeout

ActionTrigger

State

I/O

ValueReaction

Interval

Condition

ActionTermination

Page 42: Sentence Patterns for Functional Requirements Jim Adams

42

Condition: While in On-Orbit-Operation mode,Trigger:Reaction: the system shall measure

the battery voltage every 100 msec.

Termination:

State

Ongoing

BooleanCondition

Interval

Timeout

ActionTrigger

State

I/O

ValueReaction

Interval

Condition

ActionTermination

Page 43: Sentence Patterns for Functional Requirements Jim Adams

43

Condition:Trigger: When the measured battery voltage

falls below the lower thresholdReaction: the system shall disconnect two

solarpanels from the battery and

connectthem to the control circuit.

Termination:

State

Ongoing

BooleanCondition

Interval

Timeout

ActionTrigger

State

I/O

ValueReaction

Interval

Condition

ActionTermination

Page 44: Sentence Patterns for Functional Requirements Jim Adams

44

Condition: While two solar panels are connected

to the control circuit,Trigger: when the measured battery voltage

rises above the upper threshold,Reaction: the system shall release

the two solar panels.Termination:

State

Ongoing

BooleanCondition

Interval

Timeout

ActionTrigger

State

I/O

ValueReaction

Interval

Condition

ActionTermination

Page 45: Sentence Patterns for Functional Requirements Jim Adams

45

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

Page 46: Sentence Patterns for Functional Requirements Jim Adams

46

Condition: While the moon is in the seventh house,

Trigger: and Jupiter aligns with Mars,Reaction: then peace shall guide the planets,Termination: until the end of the Age of

Aquarius.

State

Ongoing

BooleanCondition

Interval

Timeout

ActionTrigger

State

I/O

ValueReaction

Interval

Condition

ActionTermination

Page 47: Sentence Patterns for Functional Requirements Jim Adams

47

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”