30
1 Design Methods for Reactive Systems, R.J. Wieringa Part IV: Behavior Notations Jens Bæk Jørgensen, University of Aarhus

1 Design Methods for Reactive Systems, R.J. Wieringa Part IV: Behavior Notations Jens Bæk Jørgensen, University of Aarhus

  • View
    224

  • Download
    1

Embed Size (px)

Citation preview

1

Design Methods for Reactive Systems, R.J. WieringaPart IV: Behavior Notations

Jens Bæk Jørgensen, University of Aarhus

2

Behaviour descriptions – in context

3

Behaviour descriptions – road map

4

behaviour descriptions – basics

Roadmap: Find required system behaviour by Analyzing required system services or Modeling desired environment behavior

Make behaviour descriptions of Desired behaviour of composite system Desired behaviour of SuD itself Assumed behaviour of environment

Format of behaviour descriptions Lists and tables Diagrams (Mealy diagrams and statecharts)

5

State transitions lists and tables – basics

Range from informal to formalCan be used at system level down to component or

software object level Different kinds of lists and tables

Event lists Stimulus-response lists State transition tables Decision tables

6

State transitions lists and tables – event lists

List of event descriptions and, for each event, a description of its effect

Example: Assumed device behaviour in environment of elevator controller Light on(b): If b is not already in state On(b), then it enters

state On(b); otherwise, nothing changes Light off(b): If b is not already in state Off(b), then it enters

state Off(b); otherwise, nothing changes

7

State transitions lists and tables – event list for desired subject domain behaviour for an elevator cage

Event: A passenger pushes a destination button in cage c Desired effect

The request is confirmed to the passenger by lighting up the button If c is idle at another floor, its motor starts in the direction of the

requested floor. While c moves, its location indicator is set to the current floor. When c arrives at the requested floor, it stops and its doors open

If c is idle at the requested floor, its doors are opened When no one has passed the doors for some time, the doors close

Compare with a corresponding service description

8

State transitions lists and tables – effect descriptions

Transactional Description of one state transition Intermediate states abstracted away (i.e., atomic) Passage of time abstracted away (instantaneous)

Scenario Description of several state transitions With intermediate states (i.e. not atomic) Progress of time

To transform a scenario description into a transactional list, we introduce states

9

State transitions lists and tables – state transition table (STT) for elevator controller

General format of STT entry:(event, current state, actions, next state)

10

State transitions lists and tables – transformation table for elevator controller

11

State transitions lists and tables – decision table for elevator controller

12

State transition diagrams – Mealy diagram for desired behaviour of heating tank controller

13

State transition diagrams – Mealy diagram for desired behaviour of heating tank controller; with variables and interface description

14

State transition diagrams – Mealy diagram constructs

15

State transition diagrams – statecharts

Extends Mealy diagrams with State reactions State hierarchy Parallelism

Harel, 1987 Part of UML

UML state machines UML activity diagrams

Execution and code generation supported by tools, e.g. Statemate Rhapsody IBM Rational Rose Real Time

16

State transition diagrams – statecharts: state reaction example

17

State transition diagrams – statecharts: state reaction with entry and exit events

18

State transition diagrams – statecharts: state reaction with semantic ambiguity

19

State transition diagrams – statecharts: state hierarchy example

20

State transition diagrams – statecharts: parallelism example

21

State transition diagrams – statecharts: example using broadcasting

22

Guidelines – training information system example: goal tree of training department

23

Guidelines – training information system example: workflow at the registration desk

24

Guidelines – training information system example: desired emergent behaviour

25

Guidelines – training information system example: embedding the system in its environment

26

Guidelines – training information system example: desired stimulus-response behaviour of the system

Assumptions?How to make the system engineering argument?

27

Guidelines – finding states and events

Finding states Look for states in which the behaviour is waiting for

something to occur Look for modes of behaviour (e.g. normal-standby-

emergency etc.)

Finding events Look for named events, condition changes, temporal

events to which the system must respond Look for desired effects of the system. What triggers the

system to produce such an effect?

Deal with parallelism and hierarchy …

28

Guidelines – find desired system behaviour via road map

29

Guidelines – through desired causality to system transactions: steps in the road map

Identify business solution goals Identify solution activities in subject domain and user

workflow Identify desired event-action pairs in subject domain

and user workflowMap to stimulus-response pairs of SuD; introduce

connection domain if necessaryRefine to transactions by introducing SuD states

30

Summary

Event listsState transition tablesMealy diagramsStatechartsGuidelines for behaviour modelling and system

design