130 likes | 633 Views
Use Cases. References From Alistair Cockburn Writing Effective Use Cases (Book) http://alistair.cockburn.us/ - Use Case Fundamentals (Article) - Structuring Use Cases with Goals (Article). What is an Actor?. Basically users of the system Actually user groups or categories
E N D
Use Cases References From Alistair Cockburn Writing Effective Use Cases (Book) http://alistair.cockburn.us/ - Use Case Fundamentals (Article) - Structuring Use Cases with Goals (Article)
What is an Actor? • Basically users of the system • Actually user groups or categories • External entities (people or systems) • That interact with the system • In order to achieve a desired goal
What is a Use Case? • A description of what happens when users interact with the system • A collection of scenarios about how an Actor uses the system to achieve a particular goal
Use Cases • Hold Functional Requirements in an easy to read, easy to track text format • Represents the goal of an interaction between an actor and the system. The goal represents a meaningful and measurable objective for the actor. • Records a set of paths (scenarios) that traverse an actor from a trigger event (start of the use case) to the goal (success scenarios) • Records a set of scenarios that traverse an actor from a trigger event toward a goal but fall short of the goal (failure scenarios) • Are multi-level: one use case can include/extend the functionality of another Use Cases Do Not… • Specify user interface design. They specify the intent, not the action Detail • Specify implementation detail (unless it is of particular importance to the actor to be assured that the goal is properly met)
How Are Use Cases Used? • To Capture the Functional Requirements of the system • To act as a springboard for the software design • To validate the software design • For Software Test and Quality Assurance. (Tests are performed to validate proper and complete implementation of the use cases) • Potentially as an initial framework for the on line help and user manual
Types of Actors • Primary Actor • The Actor(s) using the system to achieve a goal. • The Use Case documents the interactions between the system and the actors to achieve the goal of the primary actor • Secondary Actor • Actors that the system needs assistance from to achieve the primary actors goal
Use Case Writing Process • Suggested in Writing Effective Use Cases • Managing Your Energy • Start out at a high level and add detail as you go • Too much detail too fast puts you in a corner, change becomes difficult • It is an iterative, incremental process (use cases, and OO software development)
Four levels of Use Case “Precision” • Actors and Goals – List all of the Actors and their goals • Use Case Brief (or Main Success Scenario) – Write the trigger and the main success scenario • Failure Conditions – Brainstorm all the failures that could occur. • Failure Handling – Describe how the system should handle each type of failure
An Example Add Media Copy Actors: Librarian Goal: Add a copy of a media item to the library. Precondition: Media Item exists in library. LibrarianSystem 1. Searches for the media item 2. Displays media item information. 3. Issues the command to add a new copy. 4. Requests copy information (according to media type) 5. Supplies copy information. 5. Validates the information. 6. Saves the information and informs user. Exceptions 1a – Media item is not found (redirect to Add media item) 3a, 5a – Librarian cancels operation. 6a – 1 – Copy is a duplicate 6a – 2 - Required information is missing 6a – 3 – Data does not meet expected format
Trouble Getting Started? • Cockburn recommends the use of Usage Narratives as a “warm-up” • A Usage Narrative describes a particular interaction, such as “Joe enters the copy information…” • User Stories are utilized in eXtreme Programming are similar to Usage Narratives
Validating Use Cases • Since Use Cases are used in so many stages of software development, it is important to validate them • Questions to ask: • Is the Use Case complete? Are there any details that need to be added? • Do I feel confident that the actor’s goal is going to be properly met? • Are there any procedural or requirement changes I can suggest that would simplify the process depicted in the Use Case? • Are there any additional Goals of the Actors that are not addressed? • Are there any additional Actors that are not represented (directly or indirectly)?