soen343-week5-usecase - IntellAgile Writing Use Cases:...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: IntellAgile Writing Use Cases: Requirements in Context www.craiglarman.com Copyright 2002 Craig Larman. All rights reserved. IntellAgile DEFINITION: Use Case Informally, a use case is a story of using a system to fulfill a goal. Rent Videos Used by primary actors E.g., Clerk External agents something with behavior Use supporting actors. CreditAuthorizationSystem use cases sys. sequence diagrams 2 iterative requirements IntellAgile EXAMPLE: Use Case. DEFINITION: Brief Here's one in a brief format: Rent Videos. A Customer arrives with videos to rent. The Clerk enters their ID, and each video ID. The System outputs information on each. The Clerk requests the rental report. The System outputs it, which is given to the Customer with their videos. iterative requirements use cases sys. sequence diagrams 3 IntellAgile DEFINITION: Scenario Informally, a scenario is a specific sequence of actions and interactions in a use case. One path through the use case. E.g., The scenario of renting videos and first having to pay overdue fines. More formally, a use case is a collection of success and failure scenarios describing a primary actor using a system to support a goal. iterative requirements use cases sys. sequence diagrams 4 IntellAgile Use Cases There is nothing objectoriented about use cases. So, why bother in an OOA/D workshop? We need some kind of requirements input for the design steps. They are common/popular. There is a UMLrelated topic. Use case diagrams iterative requirements use cases sys. sequence diagrams 5 IntellAgile Levels of Use Cases A common challenge is identifying use cases at a useful goal level. For example, how do we know which of these is at a useful level? Negotiate a Supplier Contract Rent Videos Log In Start Up iterative requirements use cases sys. sequence diagrams 6 IntellAgile Levels of Use Cases One answer is that they are all use cases. Not helpful... We can end up with too many finegrain use cases management and complexity problems. Or "fat" use cases which span an entire organization. iterative requirements use cases sys. sequence diagrams 7 IntellAgile GUIDELINES: EBP for Use Case Levels Cockburn supports the Elementary Business Process (EBP) guideline. Focus on use cases at the level of EBPs. "A task performed by one person in one place at one time, in response to a business event, which adds measurable business value and leaves the data in a consistent state." iterative requirements use cases sys. sequence diagrams 8 IntellAgile GUIDELINES: EBP for Use Case Levels Naively, can you apply the "boss test" for an EBP? Boss: "What do you do all day?" Me: "I logged in!" Is Boss happy? iterative requirements use cases sys. sequence diagrams 9 IntellAgile GUIDELINES: Size for Use Case Levels An EBPlevel use case usually is composed of several steps, not just one or two. It isn't a single step. iterative requirements use cases sys. sequence diagrams 10 IntellAgile Use Case Levels: Applying the Guidelines Applying the EBP and size guidelines: Negotiate a Supplier Contract Rent Videos Log In Start Up The others can also be modeled as use cases. But, prefer a focus on the EBP level. iterative requirements use cases sys. sequence diagrams 11 IntellAgile Use Case Diagrams The UML has use case diagrams. Use cases are text, not diagrams. Use case analysis is a writing effort, not drawing. But a short time drawing a use case diagram provides a context for: identifying use cases by name creating a "context diagram" iterative requirements use cases sys. sequence diagrams 12 IntellAgile Use Case Diagrams Video Store Information System Clerk Pay Fines actor Credit Authorization Service Rent Items Manage Memberships Customer Log In Manage Inventory Administrator Manage Users Warning: Don't spend much time on diagramming. Use case work means to write text, not draw diagrams sys. sequence diagrams 13 iterative requirements use cases IntellAgile GUIDELINES: Use Case Diagrams Show computer system actors with an alternate notation to human actors. Prefer use cases at the EBP level. Video Store Information System Rent Videos actor Credit Authorization Service Clerk ... primary actors on the left iterative requirements use cases supporting actors on the right sys. sequence diagrams 14 IntellAgile GUIDELINES: Use Case Diagrams Types of Actors Primary actor has goal, initiates task Supporting actor involved in dialogue, provide services or information Offstage actor has an interest in the use case iterative requirements use cases sys. sequence diagrams 15 IntellAgile GUIDELINES: Use Case Modeling It is common to group CRUD (Create, Read, Update, Delete) operations into one use case. Manage Users Name starts with a verb. Manage Users All systems have a Start Up and Shut Down use case (perhaps trivial and low level). But sometimes, important. an avionics system iterative requirements use cases sys. sequence diagrams 16 IntellAgile GUIDELINES: Use Case Modeling Prefer EBPlevel use cases. AKA userlevel goal use cases. Common quality assurance checks. Are these present: Use Cases: Some variant of Configure System Sometimes, Start Up and Shut Down System Administrator iterative requirements use cases sys. sequence diagrams 17 Actors: IntellAgile Detail in Use Cases Iterative writing of use cases: idea, basics, scenarios, fully dressed description "brief" format = terse oneparagraph summary "casual" format = one informal paragraph per scenario "fully dressed" format = everything you want iterative requirements use cases sys. sequence diagrams 18 IntellAgile DEFINITION: Fully Dressed Use Cases Rich notation for detailed analysis. Shows branching scenarios. Can include nonfunctional requirements related to the functional. iterative requirements use cases sys. sequence diagrams 19 IntellAgile EXAMPLE: Fully Dressed Use Case UC1: Rent Video Level: Userlevel goal (EBP level) Primary Actor: Clerk Preconditions: Clerk is identified and authenticated. Stakeholders and their Interests: Clerk: Wants accurate, fast entry. Customer: Wants videos, and fast service with minimal effort. Accountant: Wants to accurately record transactions. Marketing: Wants to track customer habits. . . . iterative requirements use cases sys. sequence diagrams 20 IntellAgile EXAMPLE: Fully Dressed Main Success Scenario (or Basic Flow or "Happy Path"): 1. 2. 3. 4. 1. 2. 3. 4. 5. Customer arrives at a checkout with videos or games to rent. Clerk enters Customer ID. Clerk enters rental identifier. System records rental line item and presents item description. (Clerk repeats steps 34 until indicates done.) System displays total. Customer pays. System handles payment. Clerk requests rental report. System outputs it. Clerk gives it to Customer. Customer leaves with rentals and report. iterative requirements use cases sys. sequence diagrams 21 IntellAgile EXAMPLE: Fully Dressed Extensions (or Alternatives): a*. At any time, System fails: 1. Clerk restarts System 2. logs in 3. requests recovery from prior state 1a. New Customer. 1. Perform use case Manage Membership. 2a. Customer ID not found. 1. Cashier verifies ID. If entry error, reenter, else Manage Membership. 2b. Customer has unpaid fines (usually for late returns). 1. Pay Fines. iterative requirements use cases sys. sequence diagrams 22 IntellAgile EXAMPLE: Fully Dressed Special Requirements: s Language internationalization on the display messages and rental report. s Large text on display. Visible from 1 m. Technology and Data Variations: s ID entries by bar code scanner or keyboard. Frequency: s Near continuous Open Issues: s Should we support a magnetic stripe cards for customer ID, and allow customer to directly use card reader? iterative requirements use cases sys. sequence diagrams 23 IntellAgile USE CASES: nonfunctional requirements Note that use cases can capture nonfunctional requirements Performance: indicate performance constraints on individual scenarios Security: indicate which tasks must be secure Usability: indicate user characteristics with actor definitions; indicate frequency of user events with use case, ... Portability, etc: These are "developer" use cases, not "user" use cases iterative requirements use cases sys. sequence diagrams 24 IntellAgile DEFINITION: Essential & Concrete Use Cases "Keep the UI out" Essential use cases defer the details of the UI, and focus on the intentions of the actors. Essential: Clerk enters Customer ID. Concrete/worse: Clerk takes Customer ID card and reads the bar code with laser scanner. iterative requirements use cases sys. sequence diagrams 25 IntellAgile GUIDELINES: Use Case Writing Start sentence 1 with "<Actor> does <event>" Customer arrives with videos to rent. First write in the essential form, and "Keep the UI out." Capitalize "actor" names. 1. ... 2. Clerk enters... 3. System outputs... iterative requirements use cases sys. sequence diagrams 26 IntellAgile GUIDELINES: Use Case Writing Terse is good. People don't like reading requirements ;). Avoid noisy words. More verbose 1. ... 2. The Clerk enters... 3. The System outputs... Less 1. ... 2. Clerk enters... 3. System outputs... iterative requirements use cases sys. sequence diagrams 27 IntellAgile GUIDELINES: Types of Scenarios Main scenario Alternative scenario other ways of achieving the goal Exceptional scenario where something goes wrong Recovery scenario but we can recover Failure scenario alas, we cannot recover NB For Larman, "failure scenario" = "exceptional scenario" iterative requirements use cases sys. sequence diagrams 28 IntellAgile MOTIVATION: Comprehensible & Familiar Use cases are stories. A simple and familiar model that many people, especially nontechnical, can easily relate to. iterative requirements use cases sys. sequence diagrams 29 IntellAgile MOTIVATION: "Requirements in Context" The subtitle makes an important point: Use cases bring together related requirements. More cohesion and context for related requirements. iterative requirements use cases sys. sequence diagrams 30 IntellAgile Concrete Use Cases Sometime after the essential form of the use case has been written, one may optionally write it in a concrete form. 1. Customer arrives at a checkout with videos or games to rent. 2. Clerk scans Customer ID... Extensions 2a. Scanner failed. 1. Clerk enters ID on keyboard (see GUI window example, fig 5)... 31 IntellAgile Artifacts in the UP UseCase Model Partial artifacts, refined in each iteration. Use-Case Model :System Requirements foo( x ) bar( y ) text use cases use case diagrams system sequence diagrams system operations system operation contracts iterative requirements use cases sys. sequence diagrams 32 IntellAgile Artifacts in the UP UseCase Model Sample UP Artifact Relationships Domain Model Business Modeling Sale date ... 1 1..* Sales LineItem quantity objects, attributes, associations Use-Case Model Process Sale Process Sale Cashier ... ... scope, goals, actors, features Vision use case names 1. Customer arrives ... 2. Cashier makes new sale. 3. ... Use Case Text system events : System terms, attributes, validation Glossary Requirements Use Case Diagram Operation: enterItem(...) Post-conditions: -... : Cashier system operations make NewSale() enterItem (id, quantity) Supplementary Specification non-functional reqs, quality attributes Operation Contracts requirements : Register enterItem (itemID, quantity) System Sequence Diagrams Design Model : ProductCatalog : Sale Design spec = getProductSpec( itemID ) addLineItem( spec, quantity ) iterative requirements use cases sys. sequence diagrams 33 IntellAgile Context Organisational Enterprise Selling Things Checkout Service Sales Tax Agency Goal: Collect taxes on sales Sales Activity System Customer POS System Cashier Goal: Buy items Goal: Analyze sales and performance data Goal: Process sales iterative requirements use cases sys. sequence diagrams 34 IntellAgile Context System Subsystem Subsystem as target system Means other subsystems are actors external to the subsystem Means that a client of the service of the subsystem is an actor (client is another subsystem ...) Still have tasks, goals, scenarios, etc Can construct a use case model iterative requirements use cases sys. sequence diagrams 35 Userlevel use cases User work tasks User goals for task (External) actorsystem dialogue Target system being modeled is the whole system But ... can model use cases of a subsystem ... ...
View Full Document

Ask a homework question - tutors are online