$30 off During Our Annual Pro Sale. View Details »

CSE563 Lecture 14

CSE563 Lecture 14

Software Requirements and Specification
State Machine Diagram
(202210)

Javier Gonzalez-Sanchez
PRO

August 29, 2021
Tweet

More Decks by Javier Gonzalez-Sanchez

Other Decks in Programming

Transcript

  1. jgs
    CSE 563
    Software Requirements and Specification
    Lecture 14: State Machine Diagram
    Dr. Javier Gonzalez-Sanchez
    [email protected]
    javiergs.engineering.asu.edu | javiergs.com
    PERALTA 230U
    Office Hours: By appointment

    View Slide

  2. jgs
    Previously …
    Where can I put the details ?

    View Slide

  3. jgs
    Fall 2021 | 00000001
    Use Case Template
    Number and
    Name
    < the name is the goal as a short active verb phrase>
    Goal / Description < a longer statement of the goal in context if needed >
    Pre-conditions
    Success End
    Condition

    Failed End
    Condition

    Actors

    Trigger
    Description step action
    1 from trigger to goal delivery, and any cleanup after>
    2 <...>
    3

    View Slide

  4. jgs
    Fall 2021 | 00000001
    Example
    Number
    Name
    Goal/
    Description
    Pre-conditions
    Success End
    Condition
    Failed End
    Condition
    Actors
    Trigger
    Description

    View Slide

  5. jgs
    Fall 2021 | 00000001
    Behavioral Modeling
    § A graphical representation of the flow of interaction. Create a activity
    diagram for each use-case.
    § A list of the different states of a system. Build a state diagram for the
    system.
    § They are not mandatory,
    § They are an option to natural language
    § They can be combined.

    View Slide

  6. jgs
    Fall 2021 | 00000001
    Example with Pacman
    http://gameinternals.com/post/2072558330/
    understanding-pac-man-ghost-behavior

    View Slide

  7. jgs
    Fall 2021 | 00000001
    The Red Ghost (Blinky)

    View Slide

  8. jgs
    State Machine Diagram

    View Slide

  9. jgs
    Fall 2021 | 00000001
    State machine models
    § Model the behaviour of the system in response to external and
    internal events.
    § State machine models show system states as nodes and
    events as arcs between these nodes. When an event occurs,
    the system moves from one state to another.
    State ~ Data
    Event ~ Change in Data

    View Slide

  10. jgs
    Fall 2021 | 00000001
    Note
    Think about
    global data that control behaviors

    View Slide

  11. jgs
    Fall 2021 | 00000001
    Notation
    § Simple state is shown as a rectangle with rounded corners and the state
    name inside the rectangle.
    § composite state is defined as state that has substates (nested states).
    § An initial state represents a default vertex that is the source for a single
    transition. There can be at most one initial vertex. The outgoing transition
    from the initial vertex may have not a trigger or guard.
    § Final state is a special kind of state signifying that the enclosing region is
    completed.
    § A transition is a directed relationship between a source vertex and a target
    vertex.
    § Junctions

    View Slide

  12. jgs
    Fall 2021 | 00000001
    Example state machine diagram

    View Slide

  13. jgs
    Fall 2021 | 00000001
    Example state machine diagram

    View Slide

  14. jgs
    Fall 2021 | 00000001
    Example state machine diagram

    View Slide

  15. jgs
    Fall 2021 | 00000001
    Example state machine diagram

    View Slide

  16. jgs
    Fall 2021 | 00000001
    Example state machine diagram

    View Slide

  17. jgs
    Pac-Man Video Game
    Examples of State machine Diagrams

    View Slide

  18. jgs
    Fall 2021 | 00000001
    The Red Ghost (Blinky) – Activity Diagram

    View Slide

  19. jgs
    Fall 2021 | 00000001
    Pac-Man
    What about:
    § New
    § Hunter
    § Hunted
    § Eaten

    View Slide

  20. jgs
    Fall 2021 | 00000001
    Ghost States - State Machine Diagram

    View Slide

  21. jgs
    Fall 2021 | 00000001
    Ghost States - State Machine Diagram

    View Slide

  22. jgs
    Fall 2021 | 00000001
    Pacman States - State Machine Diagram

    View Slide

  23. jgs
    Fall 2021 | 00000001
    Pacman States - State Machine Diagram

    View Slide

  24. jgs
    Test Yourselves

    View Slide

  25. jgs
    Fall 2021 | 00000001
    Pac-Man
    http://gameinternals.com/post/2072558330/understanding-pac-man-ghost-behavior
    § Use Case Diagram
    § Use Case Description (per Oval)
    § Activity Diagram (where/how many are needed?)
    § State Machine Diagram (where/how many are needed?)

    View Slide

  26. jgs
    Fall 2021 | 00000001
    Space Invaders
    https://en.wikipedia.org/wiki/Space_Invaders
    § Use Case Diagram
    § Use Case Description (per Oval)
    § Activity Diagram (where/how many are needed?)
    § State Machine Diagram (where/how many are needed?)

    View Slide

  27. jgs
    Fall 2021 | 00000001
    Game of Life
    https://playgameoflife.com/info
    § Use Case Diagram
    § Use Case Description (per Oval)
    § Activity Diagram (where/how many are needed?)
    § State Machine Diagram (where/how many are needed?)

    View Slide

  28. jgs
    Assignment

    View Slide

  29. jgs
    Fall 2021 | 00000001
    Assignment
    § View this video
    https://youtu.be/BcfALBQpKjY
    It is my presentation of a project for a Software Design course.
    There are A LOT of technical details
    Technical details are NOT to be in a Requirement Specification

    View Slide

  30. jgs
    Fall 2021 | 00000001
    Assignment
    Create a Software Requirements Specification including
    a) Mandatory. A Use Case Diagram (showing all the actors, requirements, and
    relationships as needed)
    b) Mandatory. Per each Use Case, complete a Use Case Template. Yes, the one with
    triggers, pre-conditions, etc. etc. etc. Use all as needed.
    c) Question (you tell me). Per each Use Case, Do an activity diagram is need here or
    plain English? When and How to choose one or the other?
    d) Question (you tell me). Per each Use Case, Do a state machine diagram is need
    here or plain English? When and How to choose one or the other?

    View Slide

  31. jgs
    Fall 2021 | 00000001
    Assignment
    § Hint. It is a mixture or Game Of Line and Another Video that I asked you to watch
    and report before
    § Hint. TSP (mentioned in the video) is a Technical Concept. User do not know that
    thing. Should I explain or ignore? If explain where? How?
    § What is the goal of all this (each diagram and each row in the template)?
    § How many diagrams? As needed.
    § How do I know if I have everything? Remember Storyboarding…

    View Slide

  32. jgs
    Fall 2021 | 00000001
    Assignment
    § Submit one PDF file
    § Due date Friday 11:59 PM AZ Time
    § Work in a team of 1, 2 or 3. No, more that 3 are not allowed.
    It is a team assignment for you to have the chance to share ideas and
    brainstorm a solution
    § Follow academic integrity policies.
    Yes, helping friends in need by sharing your work with them IS an academic
    integrity violation (if they decided to submit what you share as their own)

    View Slide

  33. jgs
    Fall 2021 | 00000001
    Questions

    View Slide

  34. jgs
    CSE 563 Software Requirements and Specification
    Javier Gonzalez-Sanchez, Ph.D.
    [email protected]
    Fall 2021
    Copyright. These slides can only be used as study material for the class CSE563 at ASU.
    They cannot be distributed or used for another purpose.

    View Slide