www.wileyeurope .com/college/van lamsweerde Chap.12: Modeling System Operations © 2009 John Wiley and Sons 3The operation model Functional view of the system being modeled – what ser
Trang 1www.wileyeurope com/college/van lamsweerde Chap.12: Modeling System Operations © 2009 John Wiley and Sons
Building System Models for RE
Chapter 12 Modeling System Operations
Trang 2Building models for RE
Goals
Agents & responsibilities
Trang 3www.wileyeurope com/college/van lamsweerde Chap.12: Modeling System Operations © 2009 John Wiley and Sons 3
The operation model
Functional view of the system being modeled
– what services are to be provided ? (statics) what services
– under what conditions for goal satisfaction ? under what conditions
Represented by operationalization diagram, UML use cases
Multiple uses
• black-box test data
• executable specs for animation, prototyping
user manual sections
Trang 4Modeling system operations: outline
What are operations?
Characterizing system operations
Goals, agents, objects & operations: the semantic picture
Representing operation models
Building operation models: heuristics & derivation rules
Trang 5www.wileyeurope com/college/van lamsweerde Chap.12: Modeling System Operations © 2009 John Wiley and Sons 5
What are operations?
Operation Operation Op = set of input-output state pairs (binary relation)
– state = tuple of functional pairs xi |→ vi (cf Chap.10)
xi : variable, vi : corresponding value
Operation applications yield state transitions (events) applications
Trang 6What are operations? (2)
Op must operationalize underlying goals from goal model operationalize
Generally deterministic: relation over states is a function
Atomic: map input state to state at next smallest time unit Atomic
May be applied concurrently with others
Software operations, environment operations (tasks)
Trang 7www.wileyeurope com/college/van lamsweerde Chap.12: Modeling System Operations © 2009 John Wiley and Sons 7
Characterizing system operations
Basic features: Name, Def, Category
Signature
– declares the input-output relation over states
• input/output variables & their type (object from object model)
• scope may be restricted to specific attributes (nothing else changes)
• used in pre-, postconditions
– graphical or textual annotation
Operation OpenDoors
Input tr: TrainInfo / {Speed, Position}
Output tr: TrainInfo / DoorsState
Open Doors
Open
Doors
tr.Speed, tr.Position
TrainInfo
tr.DoorsState
input
output
instance variable object changes this attribute only
applies to these attributes only
Trang 8Characterizing system operations:
domain pre- and postconditions
Conditions capturing the class of state transitions that
intrinsically defines the operation
DomPre: DomPre condition characterizing class of input states in domain
DomPost: DomPost condition characterizing class of output states in domain
DomPre tr.DoorsState = ‘closed’
DomPost tr.DoorsState = ‘open’
Open Doors
DomPre m.Date, m.Location not determined DomPost m.Date, m.Location determined
Plan Meeting
Trang 9www.wileyeurope com/college/van lamsweerde Chap.12: Modeling System Operations © 2009 John Wiley and Sons 9
Characterizing system operations:
operation performer
An agent performs an operation if the applications of this performs
operation are activated by instances of this agent (cf Chap.11)
Consistency rules between operation model & agent model:
agent model
• cf Unique Controller constraint in agent model
Trang 10Modeling system operations: outline
What are operations?
Characterizing system operations
Goals, agents, objects & operations: the semantic picture
Representing operation models
Building operation models: heuristics & derivation rules
Trang 11www.wileyeurope com/college/van lamsweerde Chap.12: Modeling System Operations © 2009 John Wiley and Sons 11
Goal operationalization
A set of operations operationalizes a leaf goal if their spec operationalizes
ensures that the goal is satisfied
These specs are prescriptive conditions on the operations prescriptive
– ReqPre: ReqPre necessary condition on Op's input states to ensure G:
when DomPre true , Op may be applied may only if ReqPre only if
true
(permission)
– ReqTrig: ReqTrig sufficient condition on Op's input states to ensure G:
(obligation)
– ReqPost: ReqPost condition on Op's output states to ensure G
Fast Entry&Exit NonZeroMeasuredSpeed DoorsStateClosed If
Open Doors
Start Train
ReqTrig tr.Speed = 0 and tr.Position is
a platform position
ReqPre tr.Speed = 0
ReqPre tr.DoorsState = ‘closed’
operationalization
Trang 12Specifying operations textually:
example
Def Operation controlling the opening of all train doors
Input tr: Train / {Speed, Position}, Output tr: Train / DoorsState
DomPre The doors of train tr are closed
DomPost The doors of train tr are open
The speed of train tr is 0
ReqPre For SafeEntry&Exit
Train tr is at a platform
ReqTrig For FastEntry&Exit
Train tr has just stopped at a platform
Trang 13www.wileyeurope com/college/van lamsweerde Chap.12: Modeling System Operations © 2009 John Wiley and Sons 13
Specifying operations textually:
another example
Def Operation of sending an acceleration command to a train
Input tr: Train, cm: CommandMsg;
Output sm: Sent % association instance %
DomPre not Sent (cm, tr)
DomPost Sent (cm, tr)
The commanded acceleration sent to tr is within safe range
with respect to the preceding train’s position and speed
No acceleration command has been sent to tr since 3 seconds
Trang 14Goal operationalization (2)
A leaf goal is generally operationalized by multiple operations
An operation generally operationalizes multiple goals
Consistency constraint on obligations & permissions:
if DomPre and (ReqTrig1 or … or ReqTrigM)
then then (ReqPre1 and … and ReqPreN)
Trang 15www.wileyeurope com/college/van lamsweerde Chap.12: Modeling System Operations © 2009 John Wiley and Sons 15
Agent commitments
For every goal G under responsibility of agent ag,
for every operation Op operationalizing G,
ag must guarantee that Op is applied
when Op’s when DomPre holds,
as soon as one of Op’s as soon as ReqTrig holds
only if only if all Op’s ReqPre hold,
Extra consistency rules between operation and agent models:
G
responsible for these goals too
Trang 16Agent commitments (2)
Agent non-determinism: eager vs lazy behavior on ReqPre’s
(maximal progress)
Agent concurrency:
ReqTrig’s on multiple operations true in same state
Trang 17www.wileyeurope com/college/van lamsweerde Chap.12: Modeling System Operations © 2009 John Wiley and Sons 17
Goal operationalization and satisfaction arguments
The goal and operation models may be used to argue that
operational requirements ensure higher-level objectives
– bottom-up chaining of operationalization & refinement links
• { Spec(Op1) , …, Spec(OpM) } |= OperationalizedGoal
• { Subgoal1 …, SubgoalN , DOM } |= ParentGoal (cf Chap.8)
Yield derivational traceability links for free
– backwards: backwards why this operational spec, for what goals?
– forwards: forwards how is this goal ensured?
Trang 18Satisfaction arguments & derivational traceability: example
Avoid [TrainCollisions]
SafeTransportation
Avoid [TrainsOn SameBlock]
SignalSafely KeptToStop
SetTo STOP
ReqPre not TrainOnBlock
ReqTrig TrainOnBlock
Enter Block
ReqPre not StopSignal
Trang 19www.wileyeurope com/college/van lamsweerde Chap.12: Modeling System Operations © 2009 John Wiley and Sons 19
Modeling system operations: outline
What are operations?
Characterizing system operations
Goals, agents, objects & operations: the semantic picture
Representing operation models
Building operation models: heuristics & derivation rules
Trang 20Goals, objects, agents, operations: the semantic
behavioral goals
time
Trang 21www.wileyeurope com/college/van lamsweerde Chap.12: Modeling System Operations © 2009 John Wiley and Sons 21
Representing operation models:
operationalization diagrams
Fast
NoDelay AtPlatform
Open Doors
Close Doors
Start Train
tr.Speed, tr.Position
TrainInfo
tr.DoorsState
ReqTrig tr’s opening timeout
has elapsed
ReqTrig tr.Speed = 0 and tr.Position is
ReqPre tr.DoorsState = ‘closed’
DomPre tr.Speed = 0 DomPost tr.Speed ≠ 0
Trang 22Representing operation models:
UML use case diagrams
A use case outlines the operations an agent has to perform use case
+: interactions with
• the agents controlling operation inputs
• the agents monitoring operation outputs
+: optional (ill-defined) links
• to exception operations with preconditions (" extend") extend
• to sub-operations (" include") include
A use case should operationalize the leaf goals underlying the operations in it.
Decompose goals, NOT operations !! ( => precise semantics)
Generation of use cases from the operation & agent models is straightforward (see hereafter)
Trang 23www.wileyeurope com/college/van lamsweerde Chap.12: Modeling System Operations © 2009 John Wiley and Sons 23
UML use case diagrams: example
OpenDoors
SendAccelerationCommand
CloseDoors doorsActuator
Speed & Accel
boundary
interaction operation
agent
performing agent
Trang 24UML use case diagrams: another example
Staff BorrowBookCopy
WhoBorrowedWhat?
AddBookCopy RemoveBookCopy ReturnBookCopy
Trang 25www.wileyeurope com/college/van lamsweerde Chap.12: Modeling System Operations © 2009 John Wiley and Sons 25
Modeling system operations: outline
What are operations?
Characterizing system operations
Goals, agents, objects & operations: the semantic picture
Representing operation models
Building operation models: heuristics & derivation rules
Trang 26Derive operations from goal fluents
For each behavioral goal: list atomic state conditions P in its spec
For each P , look for
– initiating operation: makes initiating operation P true when P was false
=> DomPre = not P, DomPost = P
– terminating operation: makes terminating operation P false when P was true
=> DomPre = P, DomPost = not P
Trang 27www.wileyeurope com/college/van lamsweerde Chap.12: Modeling System Operations © 2009 John Wiley and Sons 27
Identify operations from interaction scenarios
For each interaction event in a scenario
source agent timeline
scheduleSetting notification
(date, location)
Operation RequestMeeting Input in:Initiator; Output m: Meeting, Requesting/{dateRange,withWhom} DomPre notRequesting(in, m); DomPost Requesting(in, m)
Operation AskConstraints … Operation SubmitConstraints …
Operation NotifyMeeting Input m:Meeting, p: Participant; Output Notified/{date, location}
DomPre notNotified(m, p); DomPost Notified(m, p)
notification (date, location)
Trang 28Strengthen DomPre, DomPost with conditions
required by goals
Identify required permissions: if an operation's DomPost effect can Identify required permissions
violate a goal G under condition C .
e.g OpenDoors : ReqPre for "Moving → Closed" : not Moving
Identify required obligations: if an operation's DomPost effect is Identify required obligations
prescribed by a goal G to hold whenever condition C gets true
e.g OpenDoors : ReqTrig for "StoppedAtPlatform → Open" : StoppedAtPlatform
Identify required additional effects: if an operation's DomPost is not Identify required additional effects
sufficient to ensure the target condition T of goal G
Trang 29www.wileyeurope com/college/van lamsweerde Chap.12: Modeling System Operations © 2009 John Wiley and Sons 29
Generating use case diagrams from
operationalization diagrams
For each agent ag in agent diagram:
enclose all operations performed by ag in a rectangle labelled ag ;
for each such operation op in corresponding operationalization diagram: for each other agent ag-env in the agent diagram:
if ag-env controls one of op’s input object attribute/association
or monitors one of op’s output object attribute/association
then include ag-env around ag’s rectangle
and draw an interaction link between op and ag-env
transfer op's DomPre, DomPost, ReqPres, ReqTrigs, ReqPosts