1 / 9

State Machines and Statecharts: Modeling and Testing

Learn about state machines and statecharts, their role in object-oriented design, and their use in modeling and testing multi-threaded programs. Explore the concepts of state actions, conditional state transitions, and nested states. Discover how to build effective models for fault finding and system behavior analysis.

marnia
Download Presentation

State Machines and Statecharts: Modeling and Testing

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Lecture 4 • Model checking/OBDDs • Design by contract • OCL: Object constraint language for pre and post conditions, invariants etc. • Testing multi-threaded programs • Testing state machines and statecharts

  2. Chapter 19: State machines and statecharts • Widely used: graphical user interfaces, networking protocols. Important role in object-oriented design: some objects contain own state machine or state chart. Also useful for multi-object coordination (traversal state).

  3. State machine or statechart • Two purposes • model • describes a portion of the system • implementation framework • provides skeleton for implementation

  4. State machines • May grow large and cumbersome • Therefore, David Harel invented statecharts

  5. Statecharts • State actions • on entry • on exit • do (called activity) • Example • on entry: notify repair center • on exit: log repair • do: flash service light

  6. Statecharts • Conditional state transitions • Nested states: very useful. Allow to treat individual state as a state machine. Allow for clear boundaries between parts of the graph

  7. State machine: Statechart sometimes exponentially smaller Decision tree: BDD (binary decision diag.) sometimes exponentially smaller Concise artifacts: a comparison

  8. Start (H) Ready Warmup ok Is_warm Quality_ Check stop start on Copying Alternate_Start Backup_ Check_ Quality Backup_ Warmup Is_warm fault Error Low_resolution

  9. When and how to build models • If a subsystem has a behavior that could be described with a state model but does not have one, create it. Helps with fault finding.

More Related