Use Cases in Theory & Practice

Slides:



Advertisements
Similar presentations
Object-Oriented Analysis and Design Evolutionary Requirements.
Advertisements

CPSC 333: Foundations of Software EngineeringJ. Denzinger 2.2. Use Cases: Scenario based requirements modeling Recommended: Booch, Rumbaugh, Jacobson:
Process Redesign Stages Developing Business Vision Understanding the Existing Business Designing the New Business Installing the New Business.
Use Case & Use Case Diagram
© 2010 Bennett, McRobb and Farmer1 Use Case Description Supplementary material to support Bennett, McRobb and Farmer: Object Oriented Systems Analysis.
Conversation Form l One path through a use case that emphasizes interactions between an actor and the system l Can show optional and repeated actions l.
Fall 2009ACS-3913 Ron McFadyen1 Use Cases Used to capture functional requirements – there are other requirements categories such as usability, reliability,
Humans and Technology Alistair Cockburn Page 1 ©Humans and Technology Use Cases in Theory & Practice Alistair Cockburn Humans and Technology Salt Lake.
Use Case Modeling. Kendall & Kendall© 2005 Pearson Prentice Hall18-2 Commonly Used UML Diagrams The most commonly used UML diagrams are: – Use case diagram,
The first step in getting what you want is to decide what you want.
CS499 Use Cases References From Alistair Cockburn Writing Effective Use Cases (Book) - Use Case.
Humans and Technology Alistair Cockburn Page 1 ©Humans and Technology Use Cases in Theory & Practice Alistair Cockburn Humans and Technology Salt Lake.
Systems Analysis and Design – Week 4. SAD – Week 4 Finish off last weeks workshop Finish off last weeks workshop Homework review Homework review Recap.
Object-Oriented Analysis - Instructor Notes
® IBM Software Group © 2006 IBM Corporation Rational Software France Object-Oriented Analysis and Design with UML2 and Rational Software Modeler 06. Requirements.
Introduction to Sequence Diagrams
Use Cases Ivar Jacobson - guru at Rational Corp., defined UML.
ZEIT2301 Design of Information Systems Functional Design: Use Cases School of Engineering and Information Technology Dr Kathryn Merrick.
Developing Use Cases in a Group Carolyn L. Cukierman Face-to-Face Technology Conference March 27, 2000.
Chapter 6 Use Cases. Use Cases: –Text stories Some “actor” using system to achieve a goal –Used to discover and record requirements –Serve as input to.
© 2007 First Data Corporation. All Rights Reserved. RFP 101 – Requirements Management Dave Halbig December 6, 2007.
 Development is organized in a series of short, fixed-length mini-projects called iterations  Iterations are also incremental  Successive enlargement.
Behavior Modeling (based on Alistair Cockburn book) PA116 – L11 (c) Zdenko Staníček, Sept 2010.
Adv. Use cases Actor generalization – general and special actors Use case generalization – general and special use cases Include and extend relationships.
Unified Modeling Language User Guide Section 4 - Basic Behavioral Modeling Chapter 16 - Use Cases Chapter 17 - Use Case Diagrams.
Requirements specification Why is this the first major stage of software development? –Need to understand what customer wants first Goal of requirements.
CS212: Object Oriented Analysis and Design Lecture 32: Use case and Class diagrams.
Scenario A scenario is a sequence of steps describing an interaction between a user and a system. Use case is a set of scenarios tied together by a common.
CMSC 345 Use Cases. u Describes the system’s behavior under various conditions as the system responds to a request from one of the stakeholders, called.
Sept Ron McFadyen1 Use Cases Introduced by Ivar Jacobson in 1986 literal translation from Swedish ”usage case” Used to capture and describe.
IntellAgile Copyright © 2002 Craig Larman. All rights reserved. Writing Use Cases: Requirements in Context.
Jan Ron McFadyen1 Use Cases Used to capture functional requirements – there are other requirements categories such as usability, reliability,
Use Cases Discuss the what and how of use cases: Basics Examples Benefits Parts Stages Guidelines.
Relevant Reading: Writing Effective Use Cases A. Cockburn
Writing Effective Use Cases
Discovering Use Cases.
Essentials of UrbanCode Deploy v6.1 QQ147
Using Use Case Diagrams
CMPE 280 Web UI Design and Development August 29 Class Meeting
Use Case Modeling - II Lecture # 27.
Use Cases Discuss the what and how of use cases: Basics Benefits
Chapter 5 유스케이스 개요 Introduction to Use Cases
Storyboarding and Game Design SBG, MBG620 Full Sail University
Use Case Model.
Intercompany Project Time and Expenses Scenario Overview
Exercices & Corrections Week 3
UML Use Case Diagrams.
Start at 17th March 2012 end at 31th March 2012
Overview of Business Processes
SE-565 Software System Requirements IV. Use Cases
Customer Contract Management Scenario Overview
Use Case Modeling.
Concepts, Specifications, and Diagrams
Oracle Sales Cloud Sales campaign
SAD ::: Spring 2018 Sabbir Muhammad Saleh
Order-to-Cash (Project-Based Services) Scenario Overview
Object Oriented Analysis and Design
Software Engineering System Modeling Chapter 5 (Part 1) Dr.Doaa Sami
Course: Module: Lesson # & Name Instructional Material 1 of 32 Lesson Delivery Mode: Lesson Duration: Document Name: 1. Professional Diploma in ERP Systems.
Requirements Management
Customer Contract Management Scenario Overview
Using Use Case Diagrams
Order-to-Cash (Project-Based Services) Scenario Overview
Software Engineering System Modeling Chapter 5 (Part 1) Dr.Doaa Sami
Software Requirements
Object-Oriented Software Engineering
Applying Use Cases (Chapters 25,26)
Applying Use Cases (Chapters 25,26)
Use cases Dr. X.
Presentation transcript:

Use Cases in Theory & Practice Alistair Cockburn Humans and Technology Salt Lake City, UT arc@acm.org http://members.aol.com 801.947-9275

A use case tells a story of reaching a goal, or a set of stories of both getting and failing. UC 4: “Place an order” “ 1. The clerk identifies the customer, each item and quantity. 2. System accepts and queues the order.” Extensions: “1a. Low credit: Clerk takes prepayment” “2a. Low on stock: Customer accepts reduced...”

Use cases address “how to make functional requirements readable, reviewable.” 1. Use cases hold functional requirements in an easy-to-read, easy-to-track, text format. 2. A use case collects how a goal succeeds / fails; a scenario shows one specific condition; scenarios & use cases nest. 3. Use cases show only the Functional req’ts. 4. They make a framework for non-functional requirements & project details. 5. Design is not done only in use case increments.

The IT industry now loves use cases, but The IT industry now loves use cases, but... how do you write large volumes of them? Common agreement that use cases are useful. Adopted by every OO methodology Repeated commendation from developers, users But what are they really? How do you structure 180 of them? what is their format? level of detail? Jacobson invented “uses” and “extends” relations: when do you use each, how do you type it in?

Many meanings of “Use Case” are around Many meanings of “Use Case” are around. This model has both theory & practice. A workshop of 14 leading OO consultants had 14 definitions of “use case” Value: user story / requirements Structure: none / semi-formal / formal Content: contradictory / consistent / formal Scenario =? Use case: same / different Common agreement: no standard form valuable

The model: an interaction is a sequence or set of possible sequences of interactions. Actor 1 Actor 2 Interaction Goal Responsibility Set of sequences Sequence of Interactions Single Message Condition Result

An actor’s action triggers an interaction, calling upon another actors responsibility. Internal External System in Design Person Group Subsystem System Object Interaction Behavior Set of sequences Sequence of Interactions Single Message calls upon Responsibility Goal Action triggers Condition Result

person or system with goal for s.u.d. The basic model of use cases is that Actors interact to achieve their goals Primary Actor person or system with goal for s.u.d. System under design could be any system Secondary Actor other system against which s.u.d. has a goal Responsibility - Goal 1 - Goal 2 ... action 1 . : - backup goal for Goal 2 (Interaction 1) Responsibility - Goal 1 ...action 1 (Interaction 2) Responsibility

Examing the Goals the system supports makes good functional requirements. “Place an order.” “Get money from my bank account.” “Get a quote.” “Find the most attractive alternative.” “Set up an advertising program.” Goals summarize system function in understandable, verifiable terms of use.

Users, executives and developers appreciate seeing requirements in the form of goals. “We can understand what these mean” “You mean we are going to have to ...?” Executives: “You left out one thing here ...” Developers: “These are not just a pile of paragraphs!”

Structured narrative keeps the context visible, the value to the user clear. Compare just paragraphs: “The order entry system has an interface to system EBMS and to a terminal. It computes and displays the sum of the order items’ cost. ...” With structured narrative: “The orderer (EBMS or an entry person) identifies the name of the customer & the items on the order. The system displays the cost of the total order. If the items are in stock and the client has sufficient credit, ...” When? How?

The use case pulls goal & scenarios together, Each scenario says how 1 condition unfolds. The use case name is the goal statement: “ Order product from catalog” Scenario (1): Everything works out well ... Scenario (2): Insufficient credit ... Scenario (3): Product out of stock ... Use case is goal statement plus the scenarios. (Note the grammar: active verb first) Why was this important? It clarified our vocabulary and It included all the parts we needed to function Discuss other ways to write use cases narrative formal scripts

The collected scenarios are like stripes on trousers, with success and failure legs. Goal: “Place order” Subgoal: sc1 ... sc2 sc3 sc4 sc5 sc6 sc7 Establish ... credit S S F S F ... stock S F S F F S F (Success scenarios) (Failure sc.)

How to do it: (1). Identify the actors and their goals. What computers, subsystems and people will drive our system? An “actor” is anything with behavior. What does each actor need our system to do? Each need shows up as a trigger to our system. Result: a list of use cases, a sketch of the system. Short, fairly complete list of usable system function.

How to do it: For each use case. (2) How to do it: For each use case... (2). Write the simple case: goal delivers. The main success scenario, the happy day case. Easiest to read and understand. Everything else is a complication on this. Capture each actor’s intent and responsibility, from trigger to goal delivery. Say what information passes between them. Number each line. Result: readable description of system’s function.

How to do it: (3). Write failure conditions as extensions. Usually, each step can fail. Note the failure condition separately, after the main success scenario. Result: list of alternate scenarios.

How to do it: For each failure condition, (4) How to do it: For each failure condition, (4). Follow the failure till it ends or rejoins. Recoverable extensions rejoin main course. Non-recoverable extensions fail directly. Each scenario goes from trigger to completion. “Extensions” are merely a writing shorthand. Can write “if” statements. Can write each scenario from beginning to end. Result: Complete use case

How to do it: (5). Note the data variations. Some extensions are too low-level to cover “here”. e.g. “Reimburse customer” Reimburse by cash, check, EFT, or purchase credit? Deferred variations note cases that must be handled eventually, by lower-level use cases. Useful for tracking requirements at high level. Result: Feed-forward information, rolled up into an easy-to-track format.

An actor has goals; goals name use cases; a use case has scenarios naming sub-use cases. conditions oucome has names contains calls out

Review: Make scenarios run from trigger event to goal completion or abandonment. UC 4: “Place an order” Trigger: the request (phone call, EDI, ...). End: order started or canceled. Scenario Scenario Scenario all ok: Insufficient $: No product: Start order. Refuse order Issue raincheck and forget. and forget. (Use case in “decision-table” format)

The value of failure scenarios is detecting unusual situations, completeness “What if their credit is too low?” “What if they run over the extended credit limit?” “What if we cannot deliver the quantity?” “What if data is corrupt in the database?” (These are commonly overlooked situations)

Both recoverable and non-recoverable failures are part of requirements. Ideal situation (s1): Good credit, items in stock -> accept order. Recoverable situation (s2, s3): Low credit -> valued customer? -> accept. Low stock -> reduce quantity? -> accept. Unrecoverable situations (s4, s5): Not a valued customer -> decline order Out of stock -> decline order Examine all the ways the goal can fail.

Write the recoverable and failure scenarios as “extensions” to the ideal one. UC 4: “Place an order” “ 1. Clerk identifies the customer, each item and quantity. 2. System accepts and queues the order.” Extensions: “1a. Low credit: Customer is ‘Preferred’...” “1b. Low credit & not Preferred customer: ...” “2a. Low on stock: Customer accepts reduced...” Note: there are many, many ways to write them, this is one we have found to be efficient and easy to understand.

A scenario refers to lower-level goals: subordinate use cases or common functions. UC 4: “Place an Order” 1. Identify customer (UC 41) 2. ... UC 41: “Identify Customer” 1. Operator enters name. 2. System finds near matches. Extensions: 2a. No match found: ... Note the active verbs!

The outer use case only cares if the inner one succeeds, avoiding proliferation. UC 4: “Place an Order” 1. Identify customer <- (assumes success) 2. ... Extensions: 1a. Customer not found: <- (does not care why it failed, only if it is recoverable)

Each scenario step is a sub-goal, hiding a nested use case (striped trousers image). Goal: “Place order” Subgoal: s1 ... s2 s3 s4 s5 s6 s7 Establish ... credit S S F S F ... stock S F ..?S F F S F (Success scenarios) (Failure sc.)

Every sentence at every level is a goal Every sentence at every level is a goal. Use cases are one sentence style repeated. Goal: “Customer places an order.” how why Step: “Customer prepays for the order.” Substep: “Customer gives credit card number.”

Strategic use cases, tasks, and subfunctions link together as a graph. Sailboat image: User goals are at sea level. project goal Strategic Goals “white” advertise order invoice “blue” User Goals set up promotion reference promotion monitor promotion place order create invoice send invoice “indigo” Subfunctions register user identify promotion identify product identify customer

The use case goal level is higher than the steps’ The use case goal level is higher than the steps’. They white to blue, indigo, black Goal of use case Goal of steps (white) Goal of use case Why? (blue=user goal) Goal of steps How? (indigo) (black)

Use cases nest by (level, scope, detail). Which should you write in? Level: Why do we want this goal? enter $ amount, to get $, to buy lunch (“subfunction” vs. “task” vs. “strategic” goal) Scope: Which system boundary do we mean? The panel is part of the ATM, is part of the bank. (“internal” vs. “system” vs. “organization/corporation”) Detail: Do we describe intent, or action detail? hit number buttons to enter $ amount (“dialog description” vs. “semantic / intent”)

Systems are recursive in nature, from enterprise down to program modules. company computer system other dept. System Our Sys. subsystem

(strategic, corp., semantic) Capture strategic & task goals; system & corporate scope; capture intent (semantics). (strategic, corp., semantic) (task, system, dialog) corp. cust. “Trade money for goods.” Program subsystem “Go to next entry field” (task, system, semantic) (task, internal, semantics) Program subsystem “order (p1, p2)” “Enter order”

Goals make a good structure on which to hang requirements & project details. Some requirements are not in the use cases: Performance, delivery time window. Interface and business rule usage Project planning capitalizes on goal structure: (Useable) Releases. Priorities, schedule, staffing. Growth of the somponent base.

Unresolved scheduling problem: system features slice and cross use cases Example: 1. Place an order - using standard pricing. 2. Place an order - using Preferred pricing. 3. Place an order - do not check credit limit. With full use case / feature -> use case explosion. Use case for many features -> scheduling difficulty. ( Still looking for a way to avoid use case duplication. )

Use cases do not show interface requirements. Collect them by use case. Form In Out set up promotion new promotion on-line products, dates reference promotion promotion value on-line promotion # enter an order customer, products, ... on-line new order create an invoice database order number new invoice send an invoice paper or EDI tape invoice #

Use cases do not capture performance requirements Use cases do not capture performance requirements. Connect them to use cases. Use case ... Frequency Performance set up promotion 10 / mo interactive reference promotion 500 / day sub-second enter an order 80 / day interactive create an invoice 80 / dy 3 seconds send an invoice 1600/mo 420/hr (10 sec.)

Use cases do not collect formulae, state, cardinality Use cases do not collect formulae, state, cardinality. Capture them separately. ... in any form available (“just a tool problem”) Examples: 1. Order sum = order item costs * 1.06 tax 2. Promotions may not run longer than 6 months. 3. Customers only become Preferred after an initial 6 month period. 4. A customer has one and only one sales contact. 5. An order item may use many promotions.

Need a list of actual clients of each use case, for use in packaging and training. Users set up promotion Marketing managers reference promotion Managers, order clerks, other subsystems enter an order Managers, order clerks, other subsystems create an invoice Managers, invoicing subsystem send an invoice Managers, invoicing subsystem

Project management: Schedule releases by clusters of use cases. (#1&#2) Set up & reference promotion (#4) Enter order Release 2: (#5) Create invoice (#3) Monitor promotion Release 3: (#6) Send invoice Now let’s look at one particular use case: enter an order

Use cases can be managed in text, in Lotus Notes, or in “use case” OO database. Group 1: Tried Word / Wordperfect (unsatisfactory) Hard to share, hard to modify format. Group 2: Used Lotus Notes (good) Excellent for sharing, evolving format, data. Contents slowly became inconsistent. Group 2 converting to Intelligent Software Factory Has places for performance, etc. (like L.Notes) OODB with semantic model, consistency, etc.

Now for Design: Scenarios provide the basis for design with responsibilities. Responsibility-based design is based on role-playing a walkthrough of a scenario. Multiple scenarios provide the basis for asserting that the design delivers the required function. Use of failure scenarios make the design complete & robust.

Designers can use the scenarios directly to design the system. What if...? Scenarios “Knows how to...” “Knows how to...” “Knows how to...”

Robust design requires examining use cases out of schedule sequence. A new use case may add to existing classes. -> Harder to schedule class design milestones. -> The object model is never complete, only “complete with respect to these use cases.” New use cases may change optimal design -> Use all use cases or do incremental design? Just make sure someone is responsible for delivering the total function.

Visit http://members.aol.com/acockburn to read more on use cases. 1. Use cases hold functional requirements in an easy-to-read, easy-to-track, text format. 2. A use case collects how 1 goal succeeds or fails; a scenario shows one specific condition; scenarios / use cases nest inside each other. 3. Use cases show only the Functional req’ts. 4. They make a framework for non-functional requirements & project details. 5. Design is not done only in use case increments.

The system protects the interests of all the stakeholders. want ... “Enter order” System under Design The primary actor wants...