Requirements - Use Cases

Software Engineering
1.0x

Requirements - Use Cases

Created 3 years ago

Duration 0:06:12
lesson view count 413
Select the file type you wish to download
Slide Content
  1. Requirements: Use Cases

    Slide 1 - Requirements: Use Cases

    • Emerson Murphy-Hill
  2. Use Case-Based Requirement Elicitation

    Slide 2 - Use Case-Based Requirement Elicitation

    • UML focuses on scenario-based requirements elicitation
    • Scenario:
    • sequence of actions that illustrates behavior.
    • A scenario may be used to illustrate an interaction or the execution of a use case instance
  3. External System Behavior:  Use Case Model

    Slide 3 - External System Behavior: Use Case Model

    • Complete course of events in the system, from the user’s perspective
    • Use Cases Model: Illustrates
    • (use cases) the system’s intended functions
    • (actors) surroundings – external to the system
    • (use case diagrams) relationships between use cases and actors
    • The collection of all use cases is everything that can be done to/with the system
  4. Actors

    Slide 4 - Actors

    • Are NOT part of the system – they represent anyone or anything that must interact with the system
    • Only input information to the system
    • Only receive information from the system
    • Both input to and receive information from the system
    • Represented in UML as a stickman, even when they are not “people”, such as a billing system
  5. Use Case

    Slide 5 - Use Case

    • A sequence of transactions performed by a system that yields a measurable result of values for a particular actor
    • A use case typically represents a major piece of functionality that is complete from beginning to end. A use case must deliver something of value to an actor.
  6. Template for Flow of Events

    Slide 6 - Template for Flow of Events

    • X Flow of Events for the <name> Use Case
    • X.1 Preconditions
    • What needs to happen (in another use case) before this use case can start?
    • X.2 Main Flow
    • X.3 Subflows
    • Break “normal” flow into pieces
    • “called” by Main Flow or another subflow
    • X.4 Alternative Flows
    • Things that happen outside of the “normal” flow
    • “called” by Main Flow or a subflow
    •  Covers multiple related scenarios!!!
  7. Clear Intersection Example

    Slide 7 - Clear Intersection Example

    • User wants to drive through an intersection. The user can only clear through the intersection if the traffic light is green and there are no cars in the intersection. Otherwise, the car needs to join a queue.
  8. 1.  Flow of Events for the Clear Intersection Use Case

    Slide 8 - 1. Flow of Events for the Clear Intersection Use Case

    • 1.1 Preconditions
    • Traffic light has been initialized
    • 1.2 Main Flow
    • This use case begins when a car enters the intersection. The car checks its status [S1]. The use case ends when the car clears the intersection [S4].
    • 1.3 Subflows
    • S1 Check Status:
    • Check status [S2, S3]. If the light is green, and the queue is empty, the car clears the intersection [S4]. Otherwise, it joins a queue [S5].
    • S2 Check Light:
    • Send information on whether the light is red, yellow, or green.
    • S3 Check Queue:
    • Send information on whether the queue is empty or not
    • S4 Go:
    • The car clears the intersection and the use case ends.
    • S5 Join a Queue:
    • Car is added to queue
  9. Scenario:  Car approaches intersection with green light and no queue

    Slide 9 - Scenario: Car approaches intersection with green light and no queue

    • 1.1 Preconditions
    • Traffic light has been initialized
    • 1.2 Main Flow
    • This use case begins when a car enters the intersection. The car checks its status [S1]. The use case ends when the car clears the intersection [S4].
    • 1.3 Subflows
    • S1 Check Status:
    • Check status [S2, S3]. If the light is green, and the queue is empty, the car clears the intersection [S4]. Otherwise, it joins a queue [S5].
    • S2 Check Light:
    • Send information on whether the light is red, yellow, or green.
    • S3 Check Queue:
    • Send information on whether the queue is empty or not
    • S4 Go:
    • The car clears the intersection and the use case ends.
    • S5 Join a Queue:
    • Car is added to queue
  10. Scenario:  Car approaches intersection with red light and no queue

    Slide 10 - Scenario: Car approaches intersection with red light and no queue

    • 1.1 Preconditions
    • Traffic light has been initialized
    • 1.2 Main Flow
    • This use case begins when a car enters the intersection. The car checks its status [S1]. The use case ends when the car clears the intersection [S4].
    • 1.3 Subflows
    • S1 Check Status:
    • Check status [S2, S3]. If the light is green, and the queue is empty, the car clears the intersection [S4]. Otherwise, it joins a queue [S5].
    • S2 Check Light:
    • Send information on whether the light is red, yellow, or green.
    • S3 Check Queue:
    • Send information on whether the queue is empty or not
    • S4 Go:
    • The car clears the intersection and the use case ends.
    • S5 Join a Queue:
    • Car is added to queue
  11. Alternative flows

    Slide 11 - Alternative flows

    • 1.1 Preconditions
    • Traffic light has been initialized
    • 1.2 Main Flow
    • This use case begins when a car enters the intersection. The car checks its status [S1]. The use case ends when the car clears the intersection [S4].
    • 1.3 Subflows
    • S1 Check Status: Check status [S2, S3, E1, E2]. If the light is green, and the queue is empty, the car clears the intersection [S4]. Otherwise, it joins a queue [S5].
    • S2 Check Light: Send information on whether the light is red, yellow, or green.
    • S3 Check Queue: Send information on whether the queue is empty or not
    • S4 Go: The car clears the intersection and the use case ends.
    • S5 Join a Queue: Car is added to queue
    • 1.4 Alternative Flows
    • E1 Light Out: The light is not red, yellow, or green. Wait for clear intersection and gun it.
    • E2 Accident: An accident is blocking the intersection. Rubber neck and slowly drive around it.
  12. Flow of Events vs Scenario

    Slide 12 - Flow of Events vs Scenario

    • Flow of events enumerates all subflows and exception flows.
    • Scenario is one path through your flow of events
    • When you’re testing, make sure you cover a reasonable (80%??) set of scenarios.
  13. Stereotypes

    Slide 13 - Stereotypes

    • Use Case X (Login to System) includes Use Case Y (Update User Activity Log):
    • X has a multi-step subtask Y. In the course of doing X or a subtask of X, Y will always be completed.
    • Use Case X (Obtain Student info Updates) extends Use Case Y (Login to System):
    • Y performs a sub-task and X is a similar but more specialized way of accomplishing that subtask. X only happens in an exceptional situation. Y can complete without X ever happening.
    • L01 - 13