Basic MSC - how simple can it be?

Øystein Haugen Basic MSC how simple can it be? l Message Sequence Charts are – – – – simple powerful readable used to describe interaction sequences...
Author: Rodney Cole
0 downloads 0 Views 112KB Size
Øystein Haugen

Basic MSC how simple can it be? l Message Sequence Charts are – – – –

simple powerful readable used to describe interaction sequences

Øystein Haugen, Ericsson NorARC, Ifi UiO

IN-RTIMe 2000 / 1

Tutorial MSC-92 l Emphesizes the interaction between the actors indicating that the interplay between the actors is the most important aspect. Often only a small portion of the total variety of behavior is described msc User_accepted User AC System

Code OK Push door

IN-RTIMe 2000 / 2

Øystein Haugen, Ericsson NorARC, Ifi UiO

Introduction l MSC-like notations have been used in Norwegian engineering companies for a number of years; l MSC-tools are often connected to SDL-tools, but there are MSC-tools which are connected to other notations and there are MSC-tools which are stand-alone l MSC has been standardized in 1992 and there will be a major revision and extension in 1996. l MSC has a formal semantics defined in an annex to the standard.

IN-RTIMe 2000 / 3

Øystein Haugen, Ericsson NorARC, Ifi UiO

MSC is used to: l improve the individual understanding of an interaction problem, l document protocol situations, l illustrate behavior situations, l verify interaction properties relative to a specification, l describe test cases, l document simulation traces.

IN-RTIMe 2000 / 4

Øystein Haugen, Ericsson NorARC, Ifi UiO

Instance Instances Instancesare arethe theactors actorsof ofan anMSC MSCsystem system

instance name User

instance head

timeline (instance axis) instance end

Øystein Haugen, Ericsson NorARC, Ifi UiO

IN-RTIMe 2000 / 5

MSC diagram l Messages have one output event, and one input event. The output event must occur before the input event. l Events are strictly ordered along an instance’s timeline. the frame (environment) msc User_accepted_1 User AC System the msc name Code output OK Unlock

input message to the environment

Push door

message name IN-RTIMe 2000 / 6

Øystein Haugen, Ericsson NorARC, Ifi UiO

How many global traces does this diagram show? l The only invariants: – Messages have one output event, and one input event. The output event must occur before the input event. – Events are strictly ordered along an instance’s timeline.

msc User_accepted_1 User

How Howmany? many? •• 1, 1,22or or3? 3?

AC System

Code OK Unlock Push door

Øystein Haugen, Ericsson NorARC, Ifi UiO

IN-RTIMe 2000 / 7

Message Overtaking l MSC describes asynchronous communication. l Input is normally interpreted as consumption of the message. l When messages are asynchronous, it is important to be able to describe message overtaking. Input of OK comes before input of Card out

msc User_accepted_2 User

AC System

Code OK Card out

Output of Card out comes before output of OK

Unlock

Push door

IN-RTIMe 2000 / 8

Øystein Haugen, Ericsson NorARC, Ifi UiO

Timers l Timers are messages that the instance send to itself according to time. l A timer can be set (started) and reset (terminated) by the instance and a timer may expire which means an input event. Reset timers will not expire. msc User_accepted_timeout User AC System Code Timer door set

OK Card out

Unlock Timer door timeout

door Lock

Øystein Haugen, Ericsson NorARC, Ifi UiO

IN-RTIMe 2000 / 9

Timer reset l Resetting the timer will ensure that no timer message is sent. msc User_accepted_reset User Timer door set

AC System

Code OK Card out

Unlock

Push door

door Opened

Timer door reset IN-RTIMe 2000 / 10

Øystein Haugen, Ericsson NorARC, Ifi UiO

MSC document l A Message Sequence Chart document is a collection of Message Sequence Charts, and sub Message Sequence Charts, optionally referring to a corresponding SDL-document. l MSC-92 includes little structuring mechanisms to manage and structure an MSC document.

IN-RTIMe 2000 / 11

Øystein Haugen, Ericsson NorARC, Ifi UiO

Condition l A condition describes either a global system state (global condition) referring to all instances contained in the MSC or a state referring to a subset of instances (shared condition). In the second case the condition may be local, i.e. attached to just one instance. l The term “condition” is inspired by the Hoare logic (Hoare 1969), but there is no predicate logic behind the MSC term. The MSC condition is merely a label.

IN-RTIMe 2000 / 12

Øystein Haugen, Ericsson NorARC, Ifi UiO

Condition example l An MSC may have an initial condition and a final condition. – Combining two MSCs where the final condition of the first is equal to the inital condition of the second is legal. – Combining mscs with unequal conditions is not legal. msc User_accepted_3 User AC System

initial condition

Idle Code OK Card out

final condition

Unlock

Door unlocked

Øystein Haugen, Ericsson NorARC, Ifi UiO

IN-RTIMe 2000 / 13

Alternatives and Iteration by conditions l The two mscs Unlocked_reset and Unlocked_timeout represent alternative courses of action from the state Door Unlocked. l We also notice that they both end in Idle which is also the start condition of User_accepted_3 on former slide. This may be interpreted as describing an iterative situation. msc Unlocked_reset msc Unlocked_timeout User

AC System Door unlocked Push door

User

AC System Door unlocked

door door Opened Closed Lock

Lock Idle IN-RTIMe 2000 / 14

Idle Øystein Haugen, Ericsson NorARC, Ifi UiO

Coregion l Coregion is a concept which is motivated by the fact that sometimes one does not care in which order a set of events occur msc User_accepted_4

User

AC System Idle Code

coregion

Card out OK

Unlock

Door unlocked

Øystein Haugen, Ericsson NorARC, Ifi UiO

IN-RTIMe 2000 / 15

Decomposition by submsc l Submsc is motivated by the need to look into an instance for more communication details. l Our AC System instance contains a number of “smaller” instances. msc User_accepted_5 User

declaring decomposition AC System decomposed

Idle Code Card out OK

Unlock

Door unlocked

IN-RTIMe 2000 / 16

Øystein Haugen, Ericsson NorARC, Ifi UiO

Submsc l The static requirement that the interface should be exactly matching, l There cannot be more than one submsc with the same name(?!) submsc heading

submsc AC System Panel

Central Unit

Local StationControl

decomposed

Code

Code

Card out OK

Code

OK

OK

Synch

Unlock

pseudomessage Øystein Haugen, Ericsson NorARC, Ifi UiO

IN-RTIMe 2000 / 17

Instance creation l The idea here (though rather far fetched) is that the CUControl needs to create a new process in the big mainframe computer to perform the task of authorizing the received Code. We see a situation where several Authorizers work in parallel

submsc Central Unit CUControl Code instance create

OK

instance stop IN-RTIMe 2000 / 18

Øystein Haugen, Ericsson NorARC, Ifi UiO

MSC-92 Summary l Message are asynchronous, the output of one message must come before the corresponding input. l The events on an instance’ timeline are strictly ordered (if it contains no coregion). l The distance between events is not significant. l An MSC document consists of a set of mscs. l Different MSCs within the same MSC document may be related by conditions. l An instance (within an msc) may be detailed in a submsc l A coregion is a part of a timeline which has the property that the events may come in any order. l Dynamic creation and termination of instance l MSC handles time only through timers (set, reset, timeout) IN-RTIMe 2000 / 19

Øystein Haugen, Ericsson NorARC, Ifi UiO

Suggest Documents