CS/CPE 426 Senior Projects

Slides:



Advertisements
Similar presentations
StateChart Diagrams State Machines Overview Change summary –core constructs –notation Examples Backward compatibility User benefits Issues.
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.
Nested state diagrams:Problems with flat state diagram
Karolina Muszyńska Based on: S. Wrycza, B. Marcinkowski, K. Wyrzykowski „Język UML 2.0 w modelowaniu SI”
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.
1 Chapter 4 Dynamic Modeling and Analysis (Part I) Object-Oriented Technology From Diagram to Code with Visual Paradigm for UML Curtis H.K. Tsang, Clarence.
1 Chapter 4 Dynamic Modeling and Analysis (Part I) Object-Oriented Technology From Diagram to Code with Visual Paradigm for UML Curtis H.K. Tsang, Clarence.
Activity Diagrams [Arlow and Neustadt, 2005] CS 425 / 625 Seminar on Software Engineering University of Nevada, Reno Department of Computer Science & Engineering.
1 CS 426 Senior Projects Chapter 4: Use Case Modeling [Arlow and Neustadt, 2002] February 8, 2007.
1 CS 426 Senior Projects Chapter 9: Relationships Chapter 10: Inheritance and Polymorphism [Arlow and Neustadt, 2005] February 12, 2009.
1 CS 426 Senior Projects Chapter 19: Interfaces and Components [Arlow & Neustadt 2005] February 28, 2008.
1 CS 691z/791z Topics in Software Engineering Chapter 13: Activity Diagrams & Chapter 19: Basic Statecharts [Arlow and Neustadt, 2002] March 8, 2007.
State Diagram. What is State Diagram?  State diagram is used to show the state space of a given class, the events that cause a transition from one state.
1 CS 426 Senior Projects Chapter 9: Relationships Chapter 10: Inheritance and Polymorphism [Arlow and Neustadt, 2002] February 27, 2007.
1 CS 426 Senior Projects Chapter 14: Activity Diagrams [Arlow and Neustadt, 2005] February 17, 2009.
1 CS 691z/791z Topics in Software Engineering Chapter 20: Advanced Statechart Modeling [Arlow and Neustadt, 2002] March 8, 2007.
1 CS/CPE 426 Senior Projects Chapter 21: State Machines Chapter 22:Advanced State Machines [Arlow and Neustadt 2005] March 24, 2009.
1/31 CS 426 Senior Projects Chapter 1: What is UML? Chapter 2: What is UP? [Arlow and Neustadt, 2005] January 22, 2009.
THE OBJECT-ORIENTED DESIGN WORKFLOW Statechart Diagrams.
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.
1 CS 426 Senior Projects Chapter 4: Use Case Modeling [Arlow and Neustadt, 2005] February 5, 2009.
1 CS 691z / 791z Topics on Software Engineering Chapter 17: Interfaces and Subsystems [Arlow & Neustadt, 2002] March 6, 2007.
Advanced Behavioral Modeling
1 CS 426 Senior Projects Chapter 1: What is UML? Chapter 2: What is UP? [Arlow and Neustadt, 2002] January 26, 2006.
SE-565 Software System Requirements More UML Diagrams.
What is UML? What is UP? [Arlow and Neustadt, 2005] January 23, 2014
Lecture 4 Finite State Machine CS6133 Software Specification and Verification.
Chapter 10 State Machine Diagrams
מידול התנהגותי 1. Today’s Session Sequence Diagrams State Machines 2.
Business Informatics Group Institute of Software Technology and Interactive Systems Vienna University of Technology Favoritenstraße 9-11/188-3, 1040 Vienna,
NJIT Modeling Behavior in State Chart Diagrams Chapter 29 Rafael Mello.
Behavioral diagrams Lecture p4 T120B pavasario sem.
Session 22 Modeling the Extended Features of the Statechart Written by Thomas A. Pender Published by Wiley Publishing, Inc. October 27, 2011 Presented.
Information System Design IT60105
Object Oriented Analysis & Design & UML (Unified Modeling Language)1 Part VI: Design Continuous Activity Diagams State Diagrams.
Smith’s Aerospace © P. Bailey & K. Vander Linden, 2006 State Behavior Patrick Bailey Keith Vander Linden Calvin College.
States.
CS3773 Software Engineering Lecture 06 UML State Machines.
Chapter 14: Activity Diagrams November 2015 [Arlow and Neustadt, 2005] CS 425/625 Senior Projects University of Nevada, Reno Department of Computer Science.
State Machine Diagram Chapter 5 Introduction Pages
Chapter 9: Relationships Chapter 10: Inheritance and Polymorphism [Arlow and Neustadt, 2005] CS 426 Senior Projects in Computer Science University of Nevada,
® IBM Software Group © 2009 IBM Corporation Module 11: Creating State Machine Diagrams Essentials of Modeling with IBM Rational Software Architect V7.5.
Activity Diagram.
State Machine Model.
State Diagram – Advanced Concepts
State Machine Diagram.
What is UML? What is UP? [Arlow and Neustadt, 2005] October 5, 2017
Advanced state modeling
State Machine Diagrams
Business System Development
CS 426 Senior Projects Chapter 9: Relationships
UML Activity Diagrams & State Charts
System Sequence Diagrams
States.
Object Oriented System Design
Chapter 14: Activity Diagrams
CS/CPE 426 Senior Projects
Chapter 19: Interfaces and Components
Dynamic Modeling Lecture # 37.
Chapter 14: Activity Diagrams
States.
Advanced state modeling
Chapter 14: Activity Diagrams
CS 791Z State Machines & Advanced State Machines
Interfaces and Components
Appendix 3 Object-Oriented Analysis and Design
Behavioral Diagrams P. P. Mahale
Modeling Behavior in Statechart Diagrams
Chapter 19: Interfaces and Components
UML State Diagrams (Ch. 29)
Presentation transcript:

CS/CPE 426 Senior Projects Chapter 21: State Machines Chapter 22:Advanced State Machines [Arlow and Neustadt 2005] March 26, 2013

Outline State machines: Advanced state machines: Introduction State machine diagrams States Transitions Events Advanced state machines: Composite states Simple Orthogonal Submachine states Submachine communication History

Introduction Both activity diagrams and state machine diagrams model system behavior However, they have different semantics: Activity diagrams are based on Petri Nets and usually model processes when several objects participate State machines are based on Harel’s statecharts and typically used to model single reactive objects

Introduction Reactive objects: Respond to external events May generate and respond to internal events Have a lifecycle modeled as a progression of states, transitions and events May have current behavior that depends on past behavior State machines are used to model behavior of classifiers such as classes, use cases, subsystems, systems

Introduction There are two types of state machines: Behavioral state machines Protocol state machines State machines are most commonly used to model dynamic behavior of classes In UP, state machines can be used in: requirements, analysis, design A significant challenge is testing state machines: manual walkthrough, simulation, code generation + test harnesses for state machines

State machine diagrams There are three main modeling elements in state diagrams: states, transitions, and events. Example of a simple state machine, Fig. 21.2 [Arlow & Neustadt]

States Summary of UML state syntax, Fig.21.4 [Arlow & Neustadt 2005]

Transitions Summary of UML syntax for transitions in behavioral state diagrams, Fig.21.5 [Arlow & Neustadt 2005] Where: event(s)= internal or external occurrence(s) that trigger the transition guardCondition = boolean expression, when true the transition is allowed anAction = some operation that takes place when the transition fires

Transitions Summary of UML syntax for transitions in protocol state diagrams, Fig.21.6 [Arlow & Neustadt 2005] Note that there are no actions on these transitions, and guard conditions are replaced by preconditions and postconditions.

Transitions A junction pseudo-state represents a point where transitions merge or branch, e.g. Fig.21.7 [Arlow & Neustadt 2005]

Transitions A junction pseudo-state may have more than one output transition (protected by mutually exclusive guard conditions) e.g. Fig.21.8 [Arlow & Neustadt 2005]

Transitions Choice pseudo-state can also be used, e.g. Fig. 21.9 [Arlow & Neustadt 2005]

Events Events can be of four types: Call event Signal event Change event Time event

Events Example of a call event, Fig.21.11 [Arlow & Neustadt 2005]

Events A signal is a package of information sent asynchronously between objects. Example of signal event Fig. 21.12 [Arlow & Neustadt 2005] Example of sending a Signal Fig. 21.13 [Arlow &

Events Change events are positive edge triggered. Example of a change event, Fig. 21.15 [Arlow & Neustadt 2005]

Events Time events are indicated by the keywords when and after. Example of a time event, Fig. 21.16 [Arlow & Neustadt, 2002]

Example of a state machine [Dascalu 2001]

Composite states A composite state contains one or more nested state machines (submachines), each existing in its own region, Fig 22.2 [Arlow & Neustadt 2005]. The composition icon is shown in Fig. 22.4

Simple composite states A superstate that contains a single region is called a simple composite state, e.g. Fig 22.5 [Arlow & Neustadt 2005]

Orthogonal composite states Orthogonal composite states consist of two or more sub-machines that execute in parallel. In Fig 22.6 [Arlow & Neustadt 2005] there are two such composite states, Initializing and Monitoring

Orthogonal composite states The composite state Initializing, Fig 22.7 [Arlow & Neustadt 2005]

Orthogonal composite states The composite state Monitoring, Fig 22.8 [Arlow & Neustadt 2008]

Submachine states A submachine state is a special state that references a state machine recorded in a separate diagram, e.g. Fig. 22. 9 [Arlow and Neustadt 2005]

Submachine states Fig. 22. 10 [Arlow & Neustadt 2005]. The notation for a submachine state is <state name : name of referenced state machine diagram>

Submachine communication Asynchronous submachine communication can be achieved via attributes: The modeled reactive object has a set of attributes that can be used by submachines The communication mechanism: one machine sets attributes and the other uses the attribute values in guard conditions of their transitions

Submachine communication Example of communication via attributes, Fig. 22.11 [A&N 2005]

History Example of using the shallow history indicator, Fig 22.12 [Arlow & Neustadt 2005]

History Example of using the deep history indicator Fig 22.13 [Arlow & Neustadt 2005]