System behaviors: state machine diagrams

Slides:



Advertisements
Similar presentations
State Charts Mehran Najafi. Reactive Systems A reactive, event-driven, object is one whose behavior is best characterized by its response to events dispatched.
Advertisements

Behavioral Modeling: State Diagrams CIS 4800 Kannan Mohan Department of CIS Zicklin School of Business, Baruch College Copyright © 2009 John Wiley & Sons,
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.
Chapter 4 Requirements Specification & Documentation
lamsweerde Chap.12: Modeling System Operations © 2009 John Wiley and Sons Building System Models for RE Chapter 12 Modeling.
Building System Models for RE Chapter 12 Modeling System Operations.
Modeling Main issues: What do we want to build How do we write this down ©2008 John Wiley & Sons Ltd. vliet.
lamsweerde Part 2: Building System Models for RE © 2009 John Wiley and Sons 1 Part 2: Building System Models for RE Introduction.
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.
SE 555 Software Requirements & Specification 1 Activity Diagrams.
Slide 1 Systems Analysis & Design CS183 Spring Semester Dr. Jonathan Y. Clark Course Website:
PowerPoint Presentation for Dennis, Wixom & Tegarden Systems Analysis and Design Copyright 2001 © John Wiley & Sons, Inc. All rights reserved. Slide 1.
6/8/991 Analysis Tuesday 09/14/99 Revised: September 11, 2000 (APM)
1 CS/CPE 426 Senior Projects Chapter 21: State Machines Chapter 22:Advanced State Machines [Arlow and Neustadt 2005] March 24, 2009.
THE OBJECT-ORIENTED DESIGN WORKFLOW Statechart Diagrams.
Advanced Behavioral Modeling
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.
State and Sequence Diagrams Modelling dynamic information So far we have seen: Use Case Diagrams – requirements capture, interface.
lamsweerde Chap.4: Requirements Specification & Documentation © 2009 John Wiley and Sons 1 Requirements Engineering From.
Lecture 4 Finite State Machine CS6133 Software Specification and Verification.
Timed UML State Machines Ognyana Hristova Tutor: Priv.-Doz. Dr. Thomas Noll June, 2007.
Chapter 10 State Machine Diagrams
מידול התנהגותי 1. Today’s Session Sequence Diagrams State Machines 2.
Object-Oriented Analysis and Design
1 Object-Oriented Modeling Using UML (2) CS 3331 Fall 2009.
Slide 16B.51 © The McGraw-Hill Companies, 2005 Object-Oriented and Classical Software Engineering.
Business Informatics Group Institute of Software Technology and Interactive Systems Vienna University of Technology Favoritenstraße 9-11/188-3, 1040 Vienna,
Systems Analysis and Design in a Changing World, 6th Edition
Software Architecture in Practice Architectural description (The reduced version)
USE CASE Bayu Adhi Tama, MTI Faculty of Computer Science, University of Sriwijaya Slides are adapted from Petrus Mursanto
Copyright 2002 Prentice-Hall, Inc. Chapter 2 Object-Oriented Analysis and Design Modern Systems Analysis and Design Third Edition Jeffrey A. Hoffer Joey.
OOSE Use Case. Requirement Functional: –Features, capabilities, and security Non Functional: –Usability: Human factors, help, and documentation –Reliability:
Sommerville 2004,Mejia-Alvarez 2009Software Engineering, 7th edition. Chapter 8 Slide 1 System models.
Behavioral Modeling Chapter 8.
Session 22 Modeling the Extended Features of the Statechart Written by Thomas A. Pender Published by Wiley Publishing, Inc. October 27, 2011 Presented.
CSIS3600 System Analysis and Design Statechart Diagrams.
7 Systems Analysis and Design in a Changing World, Fifth Edition.
1 Qualitative Reasoning of Distributed Object Design Nima Kaveh & Wolfgang Emmerich Software Systems Engineering Dept. Computer Science University College.
University of Toronto at Scarborough © Kersti Wain-Bantin CSCC40 state charts 1 object states an object state is a condition or situation during the life.
Information System Design IT60105
lamsweerde Chap.4: Requirements Specification & Documentation © 2009 John Wiley and Sons 1 Fundamentals of RE Chapter 4.
1 Kyung Hee University Statecharts Spring Kyung Hee University Specifying Objects’ Behaviour  Interaction diagrams show message-passing behaviour.
Object Oriented Analysis & Design & UML (Unified Modeling Language)1 Part VI: Design Continuous Activity Diagams State Diagrams.
States.
CS3773 Software Engineering Lecture 06 UML State Machines.
PowerPoint Presentation for Dennis, Wixom, & Tegarden Systems Analysis and Design with UML, 3rd Edition Copyright © 2009 John Wiley & Sons, Inc. All rights.
1 lamsweerde Chap.1: Setting the Scene  © 2009 John Wiley and Sons Requirements evaluation: outline  Inconsistency.
lamsweerde Chap.4: Formal Requirements Specification © 2009 John Wiley and Sons Fundamentals of RE Chapter 4 Requirements.
SOFTWARE DESIGN AND ARCHITECTURE LECTURE 26. Review UML behavioral Diagrams – Sequence diagram.
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.
UML Activity Diagrams.
Chapter 3: Introducing the UML
Modeling Object Lifecycles and State-Dependent Behavior ©SoftMoore ConsultingSlide 1.
Simulation Examples And General Principles Part 2
State Machine Model.
State Machine Diagrams
System Sequence Diagrams and Operation Contracts
Building System Models for RE
Webapp Design with System Sequence Diagrams
UML Use Case Diagrams.
State Machine Diagrams
Princess Nourah bint Abdulrahman University
UML Activity Diagrams & State Charts
UML State machine diagram
States.
CS/CPE 426 Senior Projects
SS 2018 Software Verification ML, state machines
CS/CPE 426 Senior Projects
States.
CS 791Z State Machines & Advanced State Machines
Presentation transcript:

System behaviors: state machine diagrams Capture the admissible behaviors of system components Behavior of component instance = sequence of state transitions for the items it controls SM state = set of situations where a variable characterizing a controlled item has always the same value e.g. state MeetingScheduled: always same value for Date, Location (while other variable WithWhom on Meeting may change value) Initial, final states = states where item appears, disappears States may have some duration SM state transition: caused by associated event if item in source state and event ev occurs then it gets to target state Events are instantaneous phenomena © 2009 John Wiley and Sons www.wileyeurope.com/college/van lamsweerde

Example of state machine diagram: meeting controlled by a meeting scheduler final state initial state state transition event state guard © 2009 John Wiley and Sons www.wileyeurope.com/college/van lamsweerde

State machine diagrams: transitions and guards Event occurrence is a sufficient condition for transition firing Event can be external stimulus (e.g. meetingRequest) or application of internal operation (e.g. determineSchedule) Guard = necessary condition for transition firing Item gets to target state ... if item is in source state and event ev occurs and only if guard condition is true Guarded transition with no event label: fires as soon as guard gets true (= trigger condition) Non-deterministic behavior: multiple outgoing transitions with same event and no or overlapping guards often to be avoided for safety, security reasons © 2009 John Wiley and Sons www.wileyeurope.com/college/van lamsweerde

Note: Incomplete! Note: Incomplete!

System operations: use case diagrams Capture operations to be performed by a system component & interactions with other components yet simpler, outline view ... but vague to be made precise by annotations, interaction scenarios, ... introduced in UML to replace DFDs Structuring mechanisms ... <<include>>: to specify “suboperation” <<extend>> + precondition: to specify “variant” operation in exception case © 2009 John Wiley and Sons www.wileyeurope.com/college/van lamsweerde

Use case diagram: example environment component operation interaction Check Request Ask Constraints Initiator <<extend>> Unauthorized Participant Collect variant operation Constraints Deny Request Determine Merge software component Schedule Constraints <<include>> Resolve Conflict Participant Conflicts Resolver suboperation Scheduler every thing good in UML is not new, every thing new in UML is not good operation performer © 2009 John Wiley and Sons www.wileyeurope.com/college/van lamsweerde

But Wait! Consider Use Cases First Use case: a set of scenarios tied together by a common goal Example: Process Sale: A customer arrives at a checkout with items to purchase. The cashier uses the POS system to record each purchased item. The system presents a running total and line-item details. The customer enters payment information, which the system validates and records. The system updates inventory. The customer receives a receipt from the system and leaves with the items.

Caution! Complete?

Interaction scenarios: event trace diagrams Capture positive scenarios by sequences of interactions among instances of system components (cf. Chap. 2) variants: MSC (ITU), sequence diagrams (UML, cf. Chap. 13) Parallel composition of timelines one per component instance Pairwise directed interactions down timelines information transmission through event attributes Interaction event synchronously controlled by source instance & monitored by target instance total order on events along timeline (event precedence) partial order on all diagram events © 2009 John Wiley and Sons www.wileyeurope.com/college/van lamsweerde

Event trace diagram: example interaction event attribute component instance controls interaction monitors interaction timeline self-interaction © 2009 John Wiley and Sons www.wileyeurope.com/college/van lamsweerde

Scenarios and state machines SM trace = sequence of successive SM states up to some point e.g. < GatheringMeetingData, RequestDenied > always finite, but SM diagram may have infinitely many traces A SM diagram generalizes ET diagram scenarios: from specific instances to any component instance trace coverage: SM traces include ET traces, and (many) more e.g. scenario/SM trace from previous slides: < ValidatingMeetingData; ConstraintsRequested; Planning; MeetingScheduled; MeetingNotified > © 2009 John Wiley and Sons www.wileyeurope.com/college/van lamsweerde

Concurrent behaviors and statecharts Components often control multiple items in parallel Problems with flat SM diagram ... N item variables each with M values => MN states ! same SM state mixing up different variables Statechart = parallel composition of SM diagrams [Harel, 1987] one per variable evolving in parallel statechart state = aggregation of concurrent substates from MN explicit SM states to M ´ N statechart states ! Statechart trace = sequence of successive aggregated SM states up to some point Interleaving semantics: for 2 transitions firing in same state, one is taken after the other (non-deterministic choice) © 2009 John Wiley and Sons www.wileyeurope.com/college/van lamsweerde

Statechart example Trace example: parallel composition variable doorsState variable trainSpeed Trace example: < (doorsClosed, trainStopped); (doorsClosed, trainMoving); (doorsClosed, trainStopped); (doorsOpen, trainStopped) > Model-checking tools can generate counterexample traces leading to violation of desired property (cf. chap. 5) © 2009 John Wiley and Sons www.wileyeurope.com/college/van lamsweerde