INF 329 Sketching Statechart diagrams María Ángeles Martínez Ibáñez.

Slides:



Advertisements
Similar presentations
Functions Reading: Epp Chp 7.1, 7.2, 7.4
Advertisements

State Charts Mehran Najafi. Reactive Systems A reactive, event-driven, object is one whose behavior is best characterized by its response to events dispatched.
UML Statechart semantics Speaker: Fei Mo Tutor: Priv.-Doz. Dr. Thomas Noll Lehrstuhl für Informatik 2 RWTH Aachen SS 07.
UML State chart/machine diagram State machine diagram is a behavior diagram which shows discrete behavior of a part of designed system through finite state.
Vered Gafni – Formal Development of Real Time Systems 1 Statecharts Semantics.
Both finite sets, A and B, are relations. A= { (0,2), (1,3), (2,4) }
® IBM Software Group © 2006 IBM Corporation Rational Software France Object-Oriented Analysis and Design with UML2 and Rational Software Modeler 04. Other.
Using UML, Patterns, and Java Object-Oriented Software Engineering Chapter 5, Analysis: Dynamic Modeling.
International Workshop on Computer Vision - Institute for Studies in Theoretical Physics and Mathematics, April , Tehran 1 IV COMPUTING SIZE.
©Katz-2004CS formal SpecificationsLecture--State machines 1 State Machines and Statecharts Formal Specifications CS Spring 2004 Shmuel Katz.
Chapter 8: Modelling Interactions and Behaviour
Essentials of state and activity diagram Lecture 24.
State Change Modelling. Aim: To introduce the concept and techniques for describing the changes in state that may occur to an object in its lifetime.
CS 290C: Formal Models for Web Software Lecture 2: Modeling States with Statecharts Instructor: Tevfik Bultan.
Chapter 18 Testing Conventional Applications
An algebra of Connectors for modeling CommUnity with Tiles joint work with Roberto Bruni Ugo Montanari Dipartimento di Informatica Università di Pisa Ivan.
SE-565 Software System Requirements More UML Diagrams.
University of Toronto Department of Computer Science © Steve Easterbrook. This presentation is available free for non-commercial use with attribution.
Learning Objectives for Section 2.1 Functions
Formalizing Relations and Functions
Lecture 4 Finite State Machine CS6133 Software Specification and Verification.
Chapter 10 State Machine Diagrams
Object-Oriented Software Engineering Practical Software Development using UML and Java Chapter 8: Modelling Interactions and Behaviour.
Object-Oriented Software Engineering Practical Software Development using UML and Java Chapter 8: Modelling Interactions and Behaviour.
Modelling Interactions and Behaviour. © Lethbridge/Laganière 2005 Chapter 8: Modelling Interactions and Behaviour2 Interaction Diagrams Interaction diagrams.
Artificial Intelligence Lecture 9. Outline Search in State Space State Space Graphs Decision Trees Backtracking in Decision Trees.
1 Object-Oriented Modeling Using UML (2) CS 3331 Fall 2009.
1 Software Engineering Dr. K. T. Tsang Lecture 8 State modeling
Object-Oriented Software Engineering Practical Software Development using UML and Java Chapter 8: Modelling Interactions and Behaviour.
Formalizing Relations and Functions
1 Modeling interactions and behavior Lecturer Dr. Mai Fadel.
Tree Diagrams  Be able to use a tree diagram to list the possible outcomes from two events.  Be able to calculate probabilities from tree diagrams. 
Smith’s Aerospace © P. Bailey & K. Vander Linden, 2005 Interaction and Communication Diagrams Patrick Bailey Keith Vander Linden Calvin College.
1 Kyung Hee University Statecharts Spring Kyung Hee University Specifying Objects’ Behaviour  Interaction diagrams show message-passing behaviour.
UML Discussion on State Machines Perfectly static system is intensely uninteresting Because nothing ever happens.
Dynamic Models. Outline Dynamic Models Statecharts –States –Transitions –Composite states Interaction Diagrams –Sequence Diagrams The time order of interactions.
Chapter 11 Activity Diagrams. 2 “Activity diagrams are a technique to describe procedural logic, business processes, and work flows” - M. Fowler An activity.
Object Oriented Analysis & Design & UML (Unified Modeling Language)1 Part VI: Design Continuous Activity Diagams State Diagrams.
OMT Modeling 1. Object Model : presented by the object model and the data dictionary. 2. Dynamic Model: presented by the state diagrams and event flow.
© 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 1 UML State Diagrams.
States.
UML: State Chart Diagrams
CS3773 Software Engineering Lecture 06 UML State Machines.
SOFTWARE DESIGN AND ARCHITECTURE LECTURE 26. Review UML behavioral Diagrams – Sequence diagram.
INFO 620Lecture #71 Information Systems Analysis and Design Design Class Diagrams and others INFO 620 Glenn Booker.
Practical Object-Oriented Design with UML 2e Slide 1/1 ©The McGraw-Hill Companies, 2004 PRACTICAL OBJECT-ORIENTED DESIGN WITH UML 2e Chapter 10: Statecharts.
Modeling Object Lifecycles and State-Dependent Behavior ©SoftMoore ConsultingSlide 1.
L ECTURE 3 T HEORY OF AUTOMATA. E QUIVALENT R EGULAR E XPRESSIONS Definition Two regular expressions are said to be equivalent if they generate the same.
Modified from Sommerville’s originalsSoftware Engineering, 7th edition. Chapter 14 Slide 1 Object-Oriented Design.
State Modeling. Introduction A state model describes the sequences of operations that occur in response to external stimuli. As opposed to what the operations.
® IBM Software Group © 2009 IBM Corporation Module 11: Creating State Machine Diagrams Essentials of Modeling with IBM Rational Software Architect V7.5.
From requirements to specification Specification is a refinement of requirements Can be included together as Software Requirements Specifications (SRS)
State Machine Model.
State Machine Diagram.
State Machine Diagrams
Visit for more Learning Resources
State Machine Diagrams
UML State Diagrams.
UML dynamic Modeling (Behavior Diagram)
Structural relations Carnie 2013, chapter 4 Kofi K. Saah.
Princess Nourah bint Abdulrahman University
States.
Object Oriented System Design
Bell - Ringer Review Plot the following coordinates:
Objectives: Identify functions. Find the domain and range.
States.
Abstraction.
Modeling Behavior in Statechart Diagrams
Tree Diagrams Be able to use a tree diagram to list the possible outcomes from two events. Be able to calculate probabilities from tree diagrams. Understand.
Presentation transcript:

INF 329 Sketching Statechart diagrams María Ángeles Martínez Ibáñez

Reminder Statecharts are used to describe the behaviour of a system and describe all of the possible states of an object as events acting upon it. Its basic components are states (in which the system makes an action), transitions (represented by arrows) and triggers (causes transitions).

Statechart diagrams have complex node substructures but they can be made much closer to sketches.

As a Σ-sketch is composed by a graph, statecharts can be visualized as a tree (is a graph in which any two vertices are connected by exactly one path).

To make easier the diagrams’s visualization, many definitions we’ll be given:  S = {s 1, s 2, …, s n } is the set of states in the statechart with n>0

 Ψ: S → {AND, OR} is a function that defines the hierarchichal descompostiion type of each state s  S. An OR-type descompostiion is used when a state is to be descomposed into a set of exclusive substates. An AND-type descomposition is used to descompose a state into parallel, or orthogonal, substates.

 R с E x A is the set of labels formed by the set of ordered pairs (e,a) | e  E and a  A, where E is the set of events and A the set of actions.  T с 2 S x R x 2 S is the set of transitions. A transition t=(x,r,Y) is composed of a source set of states X, a target set of states Y and a label r  R.  Event E is the set of event expressions defined inductively as: let E p be the set of primitive events; then if e  E p then e  E; if c  C and e  E then e[c]  E.

Module 1

First aproximation Module 1 v Idle Active v Or-state DialTone Timeout DialingInvalid Connecting BusyRinging Pinned Talking

 Set of states S = {Module1, Idle, Active, DialTone, Timeout, Dialing, Invalid, Connecting, Busy, Ringing, Pinned, Talkint}. Module1 is the root state.  Ψ (Module1) = {OR}, Ψ(Active)={OR}  The set of event expressions is given by E = {liftReceiver,callerHangsUp,after, DialDigit,…}  And the set of transitions T = {({Idle},liftReceiver,{Active}),({DialTone},after,{Tim eout}),…}

In this particular example we don’t have lots of possible configurations: SC 0 = {Idle,Module1} SC 1 = {DialTone,Active,Module1} SC 2 = {Timeout,Active,Module1} SC 3 = {Dialing,Active,Module1} … SC 9 = {Talking,Active,Module1}

To whom it concerns, we can treat the statechart as a tree, where nodes are the different configurations of it, and transitions are functions which change the node in mentioned tree. If we consider the previous example, the new tree will be something like this:

SC 0 = {Idle,Module1} SC 1 = {DialTone,Active,Module1} SC 2 = {Timeout,Active,Module1} SC 3 = {Dialing,Active,Module1} … t 1 = ({Idle},liftReceiver,{Active}) t 2 = ({DialTone},after,{Timeout}) t 3 = ({DialTone},callerHangsUp,{Idle}) t 4 = ({DialTone},dialDigit,{Dialing}) … SC 0 SC 1 SC 2 SC 3 … t3t3 t2t2 t4t4

Σ-sketch S D ≈ Diagram D For any statechart diagram D, its sketch will be represented by a tree. Firstly is necessary trace a model, for this we’ll draw a “tree” where nodes are the different states that we have in the statechart, the “levels” will mark the hierarchy and.

Σ-sketch S D ≈ Diagram D If the “conexión” between the nodes is an OR-state, it will be marked by the predicate [disj], because only can be “active” one of all the states. The opossite happens with AND-state, all the states are “active” at the same time.

Σ-sketch S D ≈ Diagram D Once have this previous tree, we are able to define the real statechart’s sketch by, as has been shown, establishing the nodes as the different configurations, and the functions (conexion between nodes) marked with the different events, being the domain of the function the node’s actual configuration, and the codomain the new configuration.

Statechart’s signature Σ A statechart diagram D = (Object D, Class D, States D, Initial D, Transitions D ) is given by an object name Object D, a class name Class D, a set of states States D, an initial state Initial D, and a set of transitions Transitions D. States D is a set of tuples S = (name(S), kind(S), entry(S), init(S), state(S), internal(S), exit(S)) where: *name(S) is the name of the state, *kind(S)  {initial, final, simple, concurrent, seq} *entry(S)  Action is called the entry action,

Statechart’s signature Σ *init(S)  States D U {undef} is the initial substate, *state(S)  States D in the set of substates of S, *internal(S)  Activity is the internal activity, *exit(S)  Action is the exit action, under the following conditions: *for states S,T  States D with S  T we have name(S)  name(T) and state(S)∩state(T) = emptySet, *for all S  States D.init(S)  state(S) and S  state(S), *kind(S)  {initial, final, simple} => state(S) = emptySet

Statechart’s signature Σ *if kind(S)  {initial, final}, we have entry(S) = nil, internal(S) = nil, and exit(S) = nil *kind(S)  {concurrent,seq} => internal(S) =nil, *if kind(S) = concurrent, we have init(S) = undef. Transitions D is a set of tuples t = (source(t), event(t), guard(t),action(t),target(t),intern(t)) where: *source(t)  States D is the source state of t, *event(t)  Events is the triggering event of t, *guard(t)  BoolExp is a Boolean expression,

Statechart’s signature Σ *action(t)  Action is an action, *target(t)  States D is the target state of t, and *intern(t)  Bool is a Boolean. event(t) must be of the form op(exp 1, …, exp n )  Events where exp 1, …, exp n  Var are variables (called parameters), which must be mutually distinct. We assume a special event ComplEv  Events (with no parameters) and call a transition t with event(t) = true then t is called an internal transition, otherwise it is called external.