Wednesday, September 29, 2010

Writing Effective Use Cases













Table of Contents
Preface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Audience . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Organization. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Heritage of the ideas in this book . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
The place of use cases in the Crystal book collection . . . . . . . . . . . . . . . . . . . . . . . . 3
The samples used . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
Chapter 1 Introduction to Use Cases . . . . . . . . . . . . . . . . . . . . . . . . 15
1.1 WHAT IS A USE CASE (MORE OR LESS)? . . . . . . . . . . . . . . . . . . . . . . . . . . . .15
Use Case 1: Buy stocks over the web . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
Use Case 2: Get paid for car accident . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
Use Case 3: Register arrival of a box . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
1.2 YOUR USE CASE IS NOT MY USE CASE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .20
Use Case 4: Buy something (Casual version) . . . . . . . . . . . . . . . . . . . . . . . . . 22
Use Case 5: Buy Something (Fully dressed version) . . . . . . . . . . . . . . . . . . . . 22
Steve Adolph: "Discovering" Requirements in new Territory . . . . . . . . . . . . . 25
1.3 REQUIREMENTS AND USE CASES. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .26
A Plausible Requirements File Outline . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
Use cases as a project linking structure. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
(Figure 1.: "Hub-and-spoke" model of requirements) . . . . . . . . . . . . . . . . . . . . . . . . 28
1.4 WHEN USE CASES ADD VALUE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .28
1.5 MANAGE YOUR ENERGY . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .29
1.6 WARM UP WITH A USAGE NARRATIVE. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .30
Usage Narrative: Getting "Fast Cash" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
PART 1
The Use Case Body Parts
Chapter 2 The Use Case as a Contract for Behavior. . . . . . . . . . . . 34
2.1 INTERACTIONS BETWEEN ACTORS WITH GOALS . . . . . . . . . . . . . . . . . . . . . . .34
Actors have goals. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
(Figure 2.: An actor with a goal calls upon the responsibilities of another) . . . . . . . . 35
Goals can fail . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
Interactions are compound. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
A use case collects scenarios . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
(Figure 3.: Striped trousers: scenarios succeed or fail) . . . . . . . . . . . . . . . . . . . . . . . . 38
(Figure 4.: The striped trousers showing subgoals.) . . . . . . . . . . . . . . . . . . . . . . . . . . 39
2.2 CONTRACT BETWEEN STAKEHOLDERS WITH INTERESTS . . . . . . . . . . . . . . . . .40
(Figure 5.: The SuD serves the primary actor, protecting off-stage stakeholders) . . . 40
2.3 THE GRAPHICAL MODEL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .41
(Figure 6.: A stakeholder has interests) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
(Figure 7.: Goal-oriented behavior made of responsibilities, goals and actions). . . . 43
(Figure 8.: The use case as responsibility invocation) . . . . . . . . . . . . . . . . . . . . . . . . 43
(Figure 9.: Interactions are composite) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
Chapter 3 Scope . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
A Sample In/Out List . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
3.1 FUNCTIONAL SCOPE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .45
The Actor-Goal List . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
A Sample Actor-Goal List: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
The Use Case Briefs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
A sample of use case briefs. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
3.2 DESIGN SCOPE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .47
(Figure 10.: Design scope can be any size) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
Using graphical icons to highlight the design scope. . . . . . . . . . . . . . . . . . . . . . . . . 49
Examples of design scope . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
Use Case 6: Add New Service (Enterprise). . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
Use Case 7: Add new Service (Acura) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
(Figure 11.: System scope diagram for Acura - BSSO.). . . . . . . . . . . . . . . . . . . . . . . 52
Use Case 8: Enter and Update Requests (Joint System) . . . . . . . . . . . . . . . . . 52
Use Case 9: Add new Service (into Acura) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
Use Case 10: Note new Service request (in BSSO) . . . . . . . . . . . . . . . . . . . . . 53
Use Case 11: Update Service request (in BSSO) . . . . . . . . . . . . . . . . . . . . . . . 53
Use Case 12: Note updated Request (in Acura) . . . . . . . . . . . . . . . . . . . . . . . . 53
(Figure 12.: Use case diagrams for Acura - BSSO) . . . . . . . . . . . . . . . . . . . . . . . . . . 54
(Figure 13.: A combined use case diagram for Acura-BSSO.). . . . . . . . . . . . . . . . . . 54
Use Case 13: Serialize access to a resource . . . . . . . . . . . . . . . . . . . . . . . . . . 55
Use Case 14: Apply a Lock Conversion Policy . . . . . . . . . . . . . . . . . . . . . . . . . 56
Use Case 15: Apply Access Compatibility Policy . . . . . . . . . . . . . . . . . . . . . . . 56
Use Case 16: Apply Access Selection Policy . . . . . . . . . . . . . . . . . . . . . . . . . . 57
Use Case 17: Make Service Client Wait for Resource Access . . . . . . . . . . . . . 57
3.3 THE OUTERMOST USE CASES . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .58
3.4 USING THE SCOPE-DEFINING WORK PRODUCTS. . . . . . . . . . . . . . . . . . . . . . .60
Chapter 4 Stakeholders & Actors . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
4.1 STAKEHOLDERS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .61
4.2 THE PRIMARY ACTOR OF A USE CASE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .62
Why primary actors are unimpotant (and impotant) . . . . . . . . . . . . . . . . . . 63
Characterizing the primary actors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
A sample actor profile map: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
4.3 SUPPORTING ACTORS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .66
4.4 THE SYSTEM UNDER DISCUSSION, ITSELF . . . . . . . . . . . . . . . . . . . . . . . . . . . .67
4.5 INTERNAL ACTORS AND WHITE-BOX USE CASES . . . . . . . . . . . . . . . . . . . . . . .67
Chapter 5 Three Named Goal Levels . . . . . . . . . . . . . . . . . . . . . . . . 69
(Figure 14.: The levels of use cases) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
5.1 USER-GOALS (BLUE, SEA-LEVEL) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .70
Two levels of blue. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
5.2 SUMMARY LEVEL (WHITE, CLOUD / KITE) . . . . . . . . . . . . . . . . . . . . . . . . . . . . .72
Use Case 18: Operate an Insurance Policy . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
The outermost use cases revisited. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
5.3 SUBFUNCTIONS (INDIGO/BLACK, UNDERWATER/CLAM) . . . . . . . . . . . . . . . . . . .73
Summarizing goal levels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
5.4 USING GRAPHICAL ICONS TO HIGHLIGHT GOAL LEVELS . . . . . . . . . . . . . . . . . .75
5.5 FINDING THE RIGHT GOAL LEVEL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .75
Find the user’s goal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
Merge steps, keep asking "why" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
(Figure 15.: Ask "why" to shift levels) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
5.6 A LONGER WRITING SAMPLE: "HANDLE A CLAIM" AT SEVERAL LEVELS . . . . . . .77
Use Case 19: Handle Claim (business) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
Use Case 20: Evaluate Work Comp Claim . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
Use Case 21: Handle a Claim (systems) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
Use Case 22: Register Loss . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
Use Case 23: Find a Whatever (problem statement) . . . . . . . . . . . . . . . . . . . . 86
Chapter 6 Preconditions, Triggers, Guarantees . . . . . . . . . . . . . . . 87
6.1 PRECONDITIONS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .87
6.2 MINIMAL GUARANTEES . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .89
6.3 SUCCESS GUARANTEE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .90
6.4 TRIGGERS. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .91
Chapter 7 Scenarios and Steps. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
7.1 THE MAIN SUCCESS SCENARIO, SCENARIOS . . . . . . . . . . . . . . . . . . . . . . . . .92
Main success scenario as the simple case . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
Common surrounding structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
The scenario body . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
7.2 ACTION STEPS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .94
Guidelines for an action step . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
Guideline 1: It uses simple grammar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
Guideline 2: It shows clearly, "Who has the ball" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
Guideline 3: It is written from a bird's eye point of view. . . . . . . . . . . . . . . . . . . . . . . . . . . 95
Guideline 4: It shows the process moving distinctly forward . . . . . . . . . . . . . . . . . . . . . . . 95
Guideline 5: It shows the actor’s intent, not movements.. . . . . . . . . . . . . . . . . . . . . . . . . . . 96
Guideline 6: It contain a ’reasonable’ set of actions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
(Figure 16.: A transaction has four parts) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
Guideline 7: It doesn’t "check whether", it "validates" . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
Guideline 8: It optionally mentions the timing. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100
Guideline 9: Idiom: "User has System A kick System B" . . . . . . . . . . . . . . . . . . . . . . . . . 100
Guideline 10: Idiom: "Do steps x-y until condition" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100
To number or not to number. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101
Chapter 8 Extensions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
8.1 THE EXTENSION CONDITIONS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .104
Brainstorm all conceivable failures and alternative courses. . . . . . . . . . . . . . . . . . 105
Guideline 11: The condition says what was detected. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106
Rationalize the extensions list. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108
Roll up failures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108
8.2 EXTENSION HANDLING. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .109
Guideline 12: Condition handling is indented. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111
Failures within failures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111
Creating a new use case from an extension . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
Chapter 9 Technology & Data Variations . . . . . . . . . . . . . . . . . . . . 114
(Figure 17.: Technology variations using specialization). . . . . . . . . . . . . . . . . . . . . 115
Chapter 10 Linking Use Cases . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116
10.1 SUB USE CASES . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .116
10.2 EXTENSION USE CASES . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .116
(Figure 18.: UML diagram of extension use cases) . . . . . . . . . . . . . . . . . . . . . . . . . 117
When to use extension use cases . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118
Chapter 11 Use Case Formats. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120
11.1 FORMATS TO CHOOSE FROM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .120
Fully dressed form . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120
Use Case 24: Fully Dressed Use Case Template . . . . . . . . . . . . . . . 120
Casual form . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121
Use Case 25: Actually Login (casual version) . . . . . . . . . . . . . . . . . . . . . . . . . 121
One-column table. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122
Two-column table. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123
RUP style . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124
Use Case 26: Register for Courses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125
If-statement style . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127
OCCAM style . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128
Diagram style . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129
The UML use case diagram. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129
11.2 FORCES AFFECTING USE CASE WRITING STYLES . . . . . . . . . . . . . . . . . . . .130
11.3 STANDARDS FOR FIVE PROJECT TYPES. . . . . . . . . . . . . . . . . . . . . . . . . . . .134
For requirements elicitation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135
Use Case 27: Elicitation Template - Oble a new biscum . . . . . . . . . . . . . . . . 135
For business process modeling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136
Use Case 28: Business Process Template - Symp a carstromming . . . . . . . . 136
For sizing the requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137
Use Case 29: Sizing Template: Burble the tramling . . . . . . . . . . . . . . . . . . . . 137
For a short, high-pressure project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138
Use Case 30: High-pressure template: Kree a ranfath . . . . . . . . . . . . . . . . . . 138
For detailed functional requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139
Use Case 31: Use Case Name: Nathorize a permion . . . . . . . . . . . . . . . . . . . 139
11.4 CONCLUSION ABOUT FORMATS. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .139
PART 2
Frequently Asked Questions
Chapter 12 When are we done? . . . . . . . . . . . . . . . . . . . . . . . . . . . 142
Chapter 13 Scaling up to Many Use Cases . . . . . . . . . . . . . . . . . . 144
Chapter 14 Two Special Use Cases . . . . . . . . . . . . . . . . . . . . . . . . 146
14.1 CRUD USE CASES . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .146
Use Case 32: Manage Reports . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146
Use Case 33: Save Report . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148
14.2 PARAMETERIZED USE CASES . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .150
Chapter 15 Business Process Modeling . . . . . . . . . . . . . . . . . . . . 153
Modeling versus designing. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153
(Figure 19.: Core business black box). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154
(Figure 20.: New business design in white box) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154
(Figure 21.: New business design in white box (again)). . . . . . . . . . . . . . . . . . . . . . 155
(Figure 22.: New business process in black-box system use cases) . . . . . . . . . . . . . 156
Linking business- and system use cases . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157
Rusty Walters: Business Modeling and System Requirements . . . . . . . . . . 158
Chapter 16 The Missing Requirements . . . . . . . . . . . . . . . . . . . . . 160
Precision in data requirements. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161
Cross-linking from use cases to other requirements . . . . . . . . . . . . . . . . . . . . . . . 163
(Figure 23.: Recap of Figure 1.“"Hub-and-spoke" model of requirements”) . . . . . . 163
Chapter 17 Use Cases in the Overall Process . . . . . . . . . . . . . . . . 164
17.1 USE CASES IN PROJECT ORGANIZATION . . . . . . . . . . . . . . . . . . . . . . . . . .164
Organize by use case titles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 164
(Figure 24.: Sample planning framework.) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 164
Use cases cross releases . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 166
Deliver complete scenarios . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167
17.2 USE CASES TO TASK OR FEATURE LISTS . . . . . . . . . . . . . . . . . . . . . . . . . .167
Use Case 34: Capture Trade-in . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169
Feature list for Capture Trade-in . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 170
17.3 USE CASES TO DESIGN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .171
A special note to Object-Oriented Designers. . . . . . . . . . . . . . . . . . . . . . . . 172
17.4 USE CASES TO UI DESIGN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .174
17.5 USE CASES TO TEST CASES . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .174
Use Case 35: Order goods, generate invoice (testing example) . . . . . . . . . . . 175
Acceptance test cases . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175
17.6 THE ACTUAL WRITING. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .176
A branch-and-join process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 176
Time required per use case.. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 180
Collecting use cases from large groups . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 180
Andy Kraus: Collecting use cases from a large, diverse lay group . . . . . . . 180
Chapter 18 Use Cases Briefs and eXtremeProgramming. . . . . . . 184
Chapter 19 Mistakes Fixed. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 185
19.1 NO SYSTEM. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .185
19.2 NO PRIMARY ACTOR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .186
19.3 TOO MANY USER INTERFACE DETAILS . . . . . . . . . . . . . . . . . . . . . . . . . . . . .187
19.4 VERY LOW GOAL LEVELS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .188
19.5 PURPOSE AND CONTENT NOT ALIGNED. . . . . . . . . . . . . . . . . . . . . . . . . . . .189
19.6 ADVANCED EXAMPLE OF TOO MUCH UI. . . . . . . . . . . . . . . . . . . . . . . . . . . .189
Use Case 36: Research a solution - Before . . . . . . . . . . . . . . . . . . . . . . . . . . . 190
Use Case 37: Research possible solutions - After . . . . . . . . . . . . . . . . . . . . . . 195
PART 3
Reminders for the Busy
Chapter 20 Each Use Case . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 200
Reminder 1. A use case is a prose essay . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 200
Reminder 2. Make the use case easy to read. . . . . . . . . . . . . . . . . . . . . . . . . . . . 200
Reminder 3. Just one sentence form . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 201
Reminder 4. Include sub use cases . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 201
Reminder 5. Who has the ball? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 202
Reminder 6. Get the goal level right . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 202
Reminder 7. Keep the GUI out . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 203
Reminder 8. Two endings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 204
Reminder 9. Stakeholders need guarantees . . . . . . . . . . . . . . . . . . . . . . . . . . . . 204
Reminder 10. Preconditions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 205
Reminder 11. Pass/Fail tests for one use case . . . . . . . . . . . . . . . . . . . . . . . . . . 206
Chapter 21 The Use Case Set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 208
Reminder 12. An ever-unfolding story . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 208
Reminder 13. Corporate scope and system scope . . . . . . . . . . . . . . . . . . . . . . . 208
Reminder 14. Core values & variations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 209
Reminder 15. Quality questions across the use case set . . . . . . . . . . . . . . . . . . 212
Chapter 22 Working on the Use Cases. . . . . . . . . . . . . . . . . . . . . . 213
Reminder 16. It’s just chapter 3 (where’s chapter 4?) . . . . . . . . . . . . . . . . . . . . . 213
Reminder 17. Work breadth first . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213
(Figure 25.: Work expands with precision). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 214
Reminder 18. The 12-step recipe. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 215
Reminder 19. Know the cost of mistakes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 215
Reminder 20. Blue jeans preferred . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 216
Reminder 21. Handle failures. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 216
Reminder 22. Job titles sooner and later . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 217
Reminder 23. Actors play roles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 217
Reminder 24. The Great Drawing Hoax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 218
(Figure 26.: "Mommy, I want to go home") . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219
(Figure 27.: Context diagram in ellipse figure form.) . . . . . . . . . . . . . . . . . . . . . . . . 219
(Figure 28.: Context diagram in actor-goal format.). . . . . . . . . . . . . . . . . . . . . . . . . 220
Reminder 25. The great tool debate. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 220
Reminder 26. Project planning using titles and briefs . . . . . . . . . . . . . . . . . . . . . 222
PART 4
End Notes
Appendix A: Use Cases in UML. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 224
23.1 ELLIPSES AND STICK FIGURES. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .224
23.2 UML’S INCLUDES RELATION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .225
Guideline 13: Draw higher goals higher. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 225
(Figure 29.: Drawing Includes.) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 225
23.3 UML’S EXTENDS RELATION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .226
(Figure 30.: Drawing Extends). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 226
Guideline 14: Draw extending use cases lower . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 227
Guideline 15: Use different arrow shapes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 227
Correct use of extends . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 227
(Figure 31.: Three interrupting use cases extending a base use case). . . . . . . . . . . . 228
Extension points . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 228
23.4 UML’S GENERALIZES RELATIONS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .229
Correct use of generalizes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 229
Guideline 16: Draw generalized goals higher . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 230
(Figure 32.: Drawing Generalizes.) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 230
Hazards of generalizes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 230
(Figure 33.: Hazardous generalization, closing a big deal). . . . . . . . . . . . . . . . . . . . 231
(Figure 34.: Correctly closing a big deal) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 231
23.5 SUBORDINATE VS. SUB USE CASES. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .232
23.6 DRAWING USE CASE DIAGRAMS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .232
Guideline 17: User goals in a context diagram. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233
Guideline 18: Supporting actors on the right . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233
23.7 WRITE TEXT-BASED USE CASES INSTEAD . . . . . . . . . . . . . . . . . . . . . . . . . .233
Appendix B: Answers to (some) Exercises . . . . . . . . . . . . . . . . . . . 234
Exercise 6 on page 58 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 234
Exercise 7 on page 58 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 234
(Figure 35.: Design scopes for the ATM) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 234
Exercise 13 on page 68 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 235
Exercise 14 on page 68 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 235
Exercise 16 on page 77 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 236
Exercise 17 on page 77 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 236
Exercise 20 on page 89 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 237
Exercise 23 on page 90 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 237
Exercise 26 on page 102 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 237
Exercise 27 on page 102 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 238
Exercise 29“Fix faulty ’Login’” . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 238
Use Case 38: Use the order processing system . . . . . . . . . . . . . . . . . . . . . . . 239
Exercise 30 on page 109 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 239
Exercise 34 on page 113 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 240
Use Case 39: Buy stocks over the web . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 240
Exercise 37 on page 128: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 241
Use Case 40: Perform clean spark plugs service . . . . . . . . . . . . . . . . . . . . . . . 241
Chapter 25 Appendix C: Glossary. . . . . . . . . . . . . . . . . . . . . . . . . . 242
Main terms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 242
Types of use cases . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 243
Diagrams . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 245
Chapter 26 Appendix D: Reading . . . . . . . . . . . . . . . . . . . . . . . . . . 246
Books referenced in the text. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 246
Articles referenced in the text. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 246
Online resources useful to your quest.. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 246

Download
Another Software Engineering Books

No comments:

Post a Comment

Related Posts with Thumbnails

Put Your Ads Here!