sentence patterns for functional requirements jim adams

Post on 26-Mar-2015

227 Views

Category:

Documents

0 Downloads

Preview:

Click to see full reader

TRANSCRIPT

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

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

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

The Top Level Sentence Pattern

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

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

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

The High Level Details

Sentence Patterns as

Block Diagrams

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

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

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

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

The Low Level Details

Sentence Patterns as

Flowcharts

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.

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”

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

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

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

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

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

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

23

Condition Reaction Interval

Timeout

ActionTrigger

Termination

Value Change Action

the charging currentProperty Name

is changed toValue Change

3 ampsProperty Value

trickle chargeProperty Name

24

Condition Reaction Interval

Timeout

ActionTrigger

Termination

State Change Action

low power modeState Name

the processor stateState Variable name

is changed toValue Change

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Examples

40

State

Ongoing

BooleanCondition

Interval

Timeout

ActionTrigger

State

I/O

ValueReaction

Interval

Condition

ActionTermination

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

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

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

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

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

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

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”

top related