Slide 1

Slide 1 text

jgs CSE 460 Software Analysis and Design Lecture 05: Requirements Analysis III 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

Slide 3

Slide 3 text

jgs 460 00000101 Previously I want a Pacman videogame Requirements

Slide 4

Slide 4 text

jgs 460 00000101 Initial Idea

Slide 5

Slide 5 text

jgs 460 00000101 Another Idea

Slide 6

Slide 6 text

jgs What about the details?

Slide 7

Slide 7 text

jgs 460 00000101 Activities http://gameinternals.com/post/2072558330/understanding-pac-man-ghost-behavior

Slide 8

Slide 8 text

jgs 460 00000101 Actions Toru Iwatani (Pac-Man creator): § I wanted each ghostly enemy to have a specific character and its own particular movements, so they weren't all just chasing after Pac Man in single file, which would have been tiresome and flat.” § They'd attack and then they'd retreat. As time went by, they would regroup, attack, and disperse again. It seemed more natural than having constant attack."

Slide 9

Slide 9 text

jgs 460 00000101 Action § Red Ghost: target tile in Chase mode is defined as Pac-Man's current tile § Pink Ghost: attempts to move him to the place where Pac-Man is going, instead of where he currently is. Pinky's target tile in Chase mode is determined by looking at Pac-Man's current position and orientation, and selecting the location four tiles straight ahead of Pac- Man.

Slide 10

Slide 10 text

jgs 460 00000101 Action § Blue Ghost: difficult to predict, it uses both Pac-Man's position/facing as well as the red ghost's position in his calculation § Orange Ghost: calculates his distance from Pac-Man. If he is farther than eight tiles away, his targeting is identical to Red Ghost. However, as soon as his distance to Pac-Man becomes less than eight tiles, his target is set to the outside the bottom-left corner of the maze.

Slide 11

Slide 11 text

jgs 460 00000101 States What about: § New § Hunter § Hunted § Eaten

Slide 12

Slide 12 text

jgs Activity and State Diagrams

Slide 13

Slide 13 text

jgs (

Slide 14

Slide 14 text

jgs 460 00000101 Full Picture SRS (requirements) Use Case Diagram (functional structure) UC1 UC2 UC4 UC3 (non-functional) Use Case Template (functional details)

Slide 15

Slide 15 text

jgs 460 00000101 Full Picture Use Case Template Diagrams

Slide 16

Slide 16 text

jgs 460 00000101 UML

Slide 17

Slide 17 text

jgs 460 00000101 Activities and States § Create an activity diagram when a use-case requires a graphical representation of the flow of interaction. § Create a state diagram when a use-case requires a list of the different states of a system. * they are not mandatory, and they can be combined.

Slide 18

Slide 18 text

jgs Activity Diagram

Slide 19

Slide 19 text

jgs 460 00000101 Test Yourselves § What is an activity? § What is the difference between activity and requirement?

Slide 20

Slide 20 text

jgs 460 00000101 Activity Diagram § A graphical representation of the flow of activities 1. Sequence 2. Conditions and Loops 3. Parallel or Concurrent 4. Actor (if there are multiple actors involved in a specific use-case) responsibility for the action described

Slide 21

Slide 21 text

jgs 460 00000101 Key elements § rounded rectangles represent actions; § diamonds represent decisions; § bars represent the start (split) or end (join) of concurrent activities; § a black circle represents the start (initial node) of the workflow; § an encircled black circle represents the end (final node). § Arrows run from the start towards the end and represent the order in which activities happen. § Swim lane or functional band helps to visually distinguishes job sharing and responsibilities

Slide 22

Slide 22 text

jgs 460 00000101 Example 1

Slide 23

Slide 23 text

jgs 460 00000101 Example 2 ATM transaction

Slide 24

Slide 24 text

jgs 460 00000101 Example 3 (part 1/2) ATM transaction customer bank ATM machine

Slide 25

Slide 25 text

jgs 460 00000101 Example 3 (part 1\2/2)

Slide 26

Slide 26 text

jgs 460 00000101 Example | Astah

Slide 27

Slide 27 text

jgs State Diagram

Slide 28

Slide 28 text

jgs 460 00000101 State Diagram State machine models show § states (as nodes) – a set of observable circumstances that characterizes the behavior of a system at a given time § Event (arc between nodes) —an occurrence that causes the system to exhibit some predictable form of behavior When an event occurs, the system moves from one state to another.

Slide 29

Slide 29 text

jgs 460 00000101 Example: MyASU

Slide 30

Slide 30 text

jgs 460 00000101 Example State Machine Diagram

Slide 31

Slide 31 text

jgs 460 00000101 Example State machine diagram Think about the labels for the events below:

Slide 32

Slide 32 text

jgs )

Slide 33

Slide 33 text

jgs And…

Slide 34

Slide 34 text

jgs 460 00000101 Another Game https://playgameoflife.com

Slide 35

Slide 35 text

jgs 460 00000101 Another Game

Slide 36

Slide 36 text

jgs 460 00000101 Another Game § Use Case Diagram ? § Activity Diagram(s) ? § State Diagram(s) ?

Slide 37

Slide 37 text

jgs CSE 460 Software Analysis and Design Javier Gonzalez-Sanchez [email protected] Fall 2020 Disclaimer. These slides can only be used as study material for the class CSE460 at ASU. They cannot be distributed or used for another purpose.