Requirements: Use Cases and UCD Notes

Introduction to Use Cases and Use Case Diagrams (UCD)

  • Definition of a Use Case: A use case is defined as a set or sequence of actions that a system performs in order to yield an observable result of value to an actor.
  • Relationship to User Stories:     * One user story is typically converted into one or more use cases.     * One or more use cases related to each other work together to help achieve a user goal as described in a user story.
  • Properties of Use Cases:     * Event-triggered: The primary actor initiates or starts the sequence of steps.     * Action-oriented: The system performs a series of steps or tasks to achieve some part of a user’s goal.
  • Unified Modeling Language (UML 2.0): Use cases are a standard part of OO (Object-Oriented) Unified Modeling Language.     * Use Case Diagram (UCD): A diagrammatic way to model what actors want and what the system provides. It connects multiple use cases and actors.     * Use Case Narratives (UCN): A text description detailing the specific steps within one individual use case.

Elements of Use Case Diagrams

  • System Boundary:     * Encloses the system and separates it from external actors.     * Defines the "scope" of the system, indicating exactly what is included within the design.
  • Primary Actor:     * Represented by a stick figure.     * Describes user roles, not specific individuals.     * Represented as a noun.     * Typically shown on the left side of the system boundary.     * An external entity that interacts with and derives value from the system.     * The entity that initiates a use case.     * Specialized Actors: These are subclasses (child) of a superclass (parent) actor. They inherit attributes and behaviors from the parent; this is shown using a white arrowhead (generalization-specialization).
  • Secondary Actor:     * Represented by a stick figure or a colored box to represent an external system.     * Typically shown on the right side of the system boundary.
  • Use Case:     * Primary Use Case: Depicted by an oval. Represents a major functionality of the system and a major user goal (closely tied to a user story). It is described using a verb and written from the perspective of the focal system being designed. It connects directly to a primary actor.     * Secondary Use Case: These are not directly connected to primary actors. They are only connected to another use case. They represent tasks the system performs to satisfy, help, or support a primary use case.

Relationships within UCD

  • Association:     * Represented by a solid line.     * Signifies a two-way dialog between an actor and a use case.
  • Includes (<<include>><<include>>):     * Indicates that the "included" use case is always called by the base use case.     * The dashed arrowhead points toward the included use case.
  • Extends (<<extend>><<extend>>):     * Indicates that the base use case may call the extension use case when needed (optional functionality).     * The dashed arrowhead points toward the base use case.
  • Generalization-Specialization:     * Refers to parent-child relationships between actors or between use cases.

Technical and Logic Rules for UCD

  • Associations: An actor can be associated with multiple primary use cases. However, there is no inherent order or sequence implied by these associations.
  • Data Exchange: UCDs do not indicate what specific data is being sent or exchanged on association arrows.
  • Extends Logic: The base use case may optionally include a list of extension points or conditions for when the extension use case will execute. Critically, the specific condition that invokes an "extends" relationship is not listed on the arrows or as a separate use case.

Parent-Child Relationships (Generalization-Specialization)

  • Core Concept: The child object inherits everything (attributes and behaviors) from the parent object.
  • Customization: A child can add more custom logic in addition to what is inherited.
  • Purpose:     * To reduce code or object repetition.     * To prevent the creation of multiple objects with identical behaviors or properties.     * To build reusable objects.
  • Depiction: A solid white arrowhead points toward the parent from the child object.
  • Application to Use Cases: When multiple use cases share common steps, those steps are placed in a parent use case. The specific child use cases only contain the additional custom logic.
  • Application to Actors: Used when multiple child actors share common goals. Use cases available to all child actors are connected to the parent actor. Child actors are connected only to specialized use cases unique to them.

Use Case Scenarios

  • Definition: A use case scenario is a series of use cases or a connected pathway through the UCD that helps achieve a user goal or represents a specific way an actor interacts with the system.
  • Example Scenario: Appointment System:     1. An "Old Patient" (child actor) initiates the process to make an appointment.     2. Common steps are inherited from the parent "Make appointment" use case.     3. Additional custom steps are handled in the "Make old patient appt" use case.     4. The patient may optionally edit patient information (e.g., updating insurance) via an "extends" relationship.     5. The patient may optionally choose to call the "Make payment arrangement" use case via an "extends" relationship.
  • Logic Note: "Update patient information" and "make payment arrangements" are only optionally called because they are extension use cases intended to handle specific needs only when they arise, rather than being required for every appointment interaction.

Benefits of Use Case Diagrams

  • Communication and Validation: They are easy for users to understand and can be used for system validation and testing.
  • User-Centric Design: They ensure the right things are built by focusing on user needs, goals, and various types of actors.
  • Scenario Identification: Helps identify common use scenarios as well as exceptions or alternate scenarios.
  • Conceptual Focus: Focuses on the "what" (functional logic) rather than the "how" (technical design).     * Avoiding UI/Technology Details: UCDs should stay away from describing user interface elements or specific technical names.     * Endurance of Logic: Functional logic is more enduring than implementation technology. For example, a system's logic remains the same whether the user uses a touchscreen today or thought sensors tomorrow; focusing on logic avoids the need to redesign the entire functional system when hardware changes.