what are use cases Arlow Neustadt A specification



















- Slides: 19
what are use cases? Arlow, Neustadt “A specification of sequences of actions, including variant sequences and error sequences, that a system, subsystem or class can perform by interacting with outside actors” The UML Reference Manual. Use cases are a way of capturing requirements. You specify: • actors - roles played by people or things that use the system • use cases - things the actors can do with the system • relationships - a meaningful relationships between actors and uses cases • system boundary - a box drawn around the use cases to denote the edge or boundary of the system being modeled. Use cases are always started by an actor and are always written from the point of view of the actor. University of Toronto at Scarborough © Kersti Wain-Bantin CSCC 40 Use Case 1
In Inception and Elaboration Phases Requirements Analyst (and Architect) Project Initiation Document Elicit requirements Glossary Candidate Requirements Select requirements Develop use cases University of Toronto at Scarborough © Kersti Wain-Bantin Requirements List Use Case Model CSCC 40 Use Case 2
In Inception and Elaboration Phases Deliverables Use Case Model Input Requirements Team Project Initiation Document Requirements capture and modelling Requirements List Interface Prototypes Initial System Architecture Glossary University of Toronto at Scarborough © Kersti Wain-Bantin CSCC 40 Use Case 3
use cases • do something of value to an actor: • calculate a result • generate a new object • change the state of an object • can be high level (e. g. process a loan) • can be more specific (e. g. complete loan application) use case diagrams contain: • use cases • actors • relationships University of Toronto at Scarborough are used: • to document requirements • as guidelines for system testing © Kersti Wain-Bantin CSCC 40 Use Case 4
an actor is… • a coherent set of roles that the user of use cases plays when interacting with use cases • human, department, hardware device, another system… • not part of the system (lives outside the system) • connected by association with the use case by sending and/or receiving message(s) University of Toronto at Scarborough © Kersti Wain-Bantin CSCC 40 Use Case 5
use case diagrams model the context and requirements of a system capture the intended behavior of a system without having to specify how that behavior is implemented University of Toronto at Scarborough © Kersti Wain-Bantin CSCC 40 Use Case 6
documenting use cases University of Toronto at Scarborough • name of use case • purpose • actors • stakeholders and interests • description • relationships to other use cases • flow of events: • trigger • basic flow • alternative flows • exceptional flows • pre-conditions • post-conditions © Kersti Wain-Bantin CSCC 40 Use Case 7
Arlow, Neustadt Use case: display. Shopping. Basket ID: UC 11 Actors: customer Preconditions: 1. the customer is logged on the system 1. Flow of Events: 1. the use case starts when the customer selects “display basket” 2. if there are not items in the basket 2. 1 the system informs the customer there are no items in the basket yet 2. 2 the use case terminates 3. the system displays a list of all items in the customer’s shopping basket giving their product id and name, quantity and item price Postconditions: Alternative flow 1: 1. at any time the customer may leave the shopping basket display screen Postconditions: Alternative flow 2: 1. at any time the customer may leave the system sample Postconditions: use case Alternative flow 3: documentation University of Toronto at Scarborough © Kersti Wain-Bantin CSCC 40 Use Case 8
Arlow, Neustadt sales system list. Products actor generalization order. Products customer accept. Payment sales agent sales system list. Products calculate. Commission purchaser accept. Payment before after calculate. Commission customer University of Toronto at Scarborough order. Products © Kersti Wain-Bantin sales agent CSCC 40 Use Case 9
actor / use case multiplicity clinic system * * book. Appointment patient * returning patient 1 new patient * University of Toronto at Scarborough add. New. Patient revise. Patient. Info * © Kersti Wain-Bantin CSCC 40 Use Case 10
Arlow, Neustadt use case generalization sales system parent use case find. Product customer find. Book find. CD child use cases may: • inherit features from parent use case • add new features • override (change inherited features) University of Toronto at Scarborough © Kersti Wain-Bantin CSCC 40 Use Case 11
use case generalization University of Toronto at Scarborough © Kersti Wain-Bantin CSCC 40 Use Case 12
include relationship common behavior can be a use case of it’s own University of Toronto at Scarborough © Kersti Wain-Bantin CSCC 40 Use Case 13
Arlow, Neustadt include relationship personnel system change. Employee. Details <<include>> view. Employee. Details <<include>> find. Employee. Details manager delete. Employee. Details University of Toronto at Scarborough © Kersti Wain-Bantin <<include>> CSCC 40 Use Case 14
extend relationship add optional or conditional behavior to base case University of Toronto at Scarborough © Kersti Wain-Bantin CSCC 40 Use Case 15
conditional extension University of Toronto at Scarborough © Kersti Wain-Bantin CSCC 40 Use Case 16
showing system context University of Toronto at Scarborough © Kersti Wain-Bantin CSCC 40 Use Case 17
example University of Toronto at Scarborough © Kersti Wain-Bantin CSCC 40 Use Case 18
University of Toronto at Scarborough © Kersti Wain-Bantin CSCC 40 Use Case 19