Slide 1

Slide 1 text

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

Slide 2

Slide 2 text

jgs Previously … Where can I put the details ?

Slide 3

Slide 3 text

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 2 <...> 3

Slide 4

Slide 4 text

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

Slide 5

Slide 5 text

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.

Slide 6

Slide 6 text

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

Slide 7

Slide 7 text

jgs Fall 2021 | 00000001 The Red Ghost (Blinky)

Slide 8

Slide 8 text

jgs State Machine Diagram

Slide 9

Slide 9 text

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

Slide 10

Slide 10 text

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

Slide 11

Slide 11 text

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

Slide 12

Slide 12 text

jgs Fall 2021 | 00000001 Example state machine diagram

Slide 13

Slide 13 text

jgs Fall 2021 | 00000001 Example state machine diagram

Slide 14

Slide 14 text

jgs Fall 2021 | 00000001 Example state machine diagram

Slide 15

Slide 15 text

jgs Fall 2021 | 00000001 Example state machine diagram

Slide 16

Slide 16 text

jgs Fall 2021 | 00000001 Example state machine diagram

Slide 17

Slide 17 text

jgs Pac-Man Video Game Examples of State machine Diagrams

Slide 18

Slide 18 text

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

Slide 19

Slide 19 text

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

Slide 20

Slide 20 text

jgs Fall 2021 | 00000001 Ghost States - State Machine Diagram

Slide 21

Slide 21 text

jgs Fall 2021 | 00000001 Ghost States - State Machine Diagram

Slide 22

Slide 22 text

jgs Fall 2021 | 00000001 Pacman States - State Machine Diagram

Slide 23

Slide 23 text

jgs Fall 2021 | 00000001 Pacman States - State Machine Diagram

Slide 24

Slide 24 text

jgs Test Yourselves

Slide 25

Slide 25 text

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?)

Slide 26

Slide 26 text

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?)

Slide 27

Slide 27 text

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?)

Slide 28

Slide 28 text

jgs Assignment

Slide 29

Slide 29 text

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

Slide 30

Slide 30 text

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?

Slide 31

Slide 31 text

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…

Slide 32

Slide 32 text

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)

Slide 33

Slide 33 text

jgs Fall 2021 | 00000001 Questions

Slide 34

Slide 34 text

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.