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

CSE460 Lecture 05

CSE460 Lecture 05

Software Analysis and Design
Requirements Analysis
(202008)

Javier Gonzalez-Sanchez
PRO

July 05, 2020
Tweet

More Decks by Javier Gonzalez-Sanchez

Other Decks in Programming

Transcript

  1. 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

    View Slide

  2. jgs
    Previously

    View Slide

  3. jgs
    460 00000101
    Previously
    I want a
    Pacman
    videogame
    Requirements

    View Slide

  4. jgs
    460 00000101
    Initial Idea

    View Slide

  5. jgs
    460 00000101
    Another Idea

    View Slide

  6. jgs
    What about the details?

    View Slide

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

    View Slide

  8. 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."

    View Slide

  9. 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.

    View Slide

  10. 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.

    View Slide

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

    View Slide

  12. jgs
    Activity and State Diagrams

    View Slide

  13. jgs
    (

    View Slide

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

    View Slide

  15. jgs
    460 00000101
    Full Picture
    Use Case Template
    Diagrams

    View Slide

  16. jgs
    460 00000101
    UML

    View Slide

  17. 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.

    View Slide

  18. jgs
    Activity Diagram

    View Slide

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

    View Slide

  20. 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

    View Slide

  21. 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

    View Slide

  22. jgs
    460 00000101
    Example 1

    View Slide

  23. jgs
    460 00000101
    Example 2
    ATM
    transaction

    View Slide

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

    View Slide

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

    View Slide

  26. jgs
    460 00000101
    Example | Astah

    View Slide

  27. jgs
    State Diagram

    View Slide

  28. 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.

    View Slide

  29. jgs
    460 00000101
    Example: MyASU

    View Slide

  30. jgs
    460 00000101
    Example State Machine Diagram

    View Slide

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

    View Slide

  32. jgs
    )

    View Slide

  33. jgs
    And…

    View Slide

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

    View Slide

  35. jgs
    460 00000101
    Another Game

    View Slide

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

    View Slide

  37. 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.

    View Slide