The Seven Habits of Effective Use Case Writers
The Seven Habits of Effective Use Case Writers Matt Terski
The hardest single part of building a software system is deciding precisely what to build. -Frederick Brooks
When dual quote agent, must be able to identify which members are ER and which are MM. Sample Requirement
The Seven Habits 1. 2. 3. 4. Start with actors and goals Work breadth-first Get the scope right Include and extend judiciously 5. Use alternatives effectively 6. Extract business rules and requirements 7. Show what the actor does or gets ©Copyright 2007 Serlio Software Use Case Model Use Cases Use Case Steps
The Use Case Model
1. Start With Actors and Goals • Actors are – Unique to use cases – Abstract roles – The basis for requirements ©Copyright 2007 Serlio Software
1. Start with Actors and Goals • Without actors – We miss requirements – We miss the “why” of requirements • By confusing actors with users – We specify a rigid solution – Users can play multiple roles ©Copyright 2007 Serlio Software
©Copyright 2007 Serlio Software
©Copyright 2007 Serlio Software
2. Work Breadth-First • We are eager for detail • It’s a process of discovery • Early detail leads to wasted effort – Requirements “churn” – Prolonged requirements phase – Loss of patience ©Copyright 2007 Serlio Software
2. Work Breadth-First The use case process in a nutshell 1. 2. 3. 4. 5. 6. Actors Goals Use cases Main scenario Alternate conditions Alternate scenarios ©Copyright 2007 Serlio Software
The Use Cases
3. Get the Scope Right • How big? • Where does it start? • When does it end? • How much detail? ©Copyright 2007 Serlio Software
3. Get the Scope Right • Either 100% complete or 0% complete • Named after a goal • Verb Noun (e. g. Schedule Flight) • Six to ten steps • One actor, one place, one time ©Copyright 2007 Serlio Software
©Copyright 2007 Serlio Software
©Copyright 2007 Serlio Software
4. Include and Extend Judiciously • Include: Share common behavior • Extend: Separate complex alternatives ©Copyright 2007 Serlio Software
4. Include and Extend Judiciously • Include relationship – Share common behavior – More than “a few” steps – Avoids inconsistent requirements • Risks – Behavior becomes scattered – No single-source to view a use case ©Copyright 2007 Serlio Software
©Copyright 2007 Serlio Software
©Copyright 2007 Serlio Software
©Copyright 2007 Serlio Software
©Copyright 2007 Serlio Software
4. Include and Extend Judiciously • Use the extend relationship when: – Alternate condition affects many steps • More than 2 -3 steps – Alternate flow becomes complex • More than 3 -4 steps • Risks – Must read more than one use case ©Copyright 2007 Serlio Software
©Copyright 2007 Serlio Software
The Use Case Steps
5. Use Alternatives Effectively • Variations to the main flow – Most interesting – Most important – Most effort ©Copyright 2007 Serlio Software
5. Use Alternatives Effectively • Baseline: Main flow with no conditions – Most likely path – No “if” statements • Brainstorm each step – What could go wrong? – Write this as an assertion/condition • Limit alternatives – Only conditions the system can detect – Combine conditions with the same result ©Copyright 2007 Serlio Software
©Copyright 2007 Serlio Software
6. Extract Business Rules and Requirements • Manage complexity • Use cases are functional requirements – Visible behavior • Non-functional requirements – Business rules, performance, usability, reliability, etc. – Don’t capture in the use case steps – But keep them nearby ©Copyright 2007 Serlio Software
©Copyright 2007 Serlio Software
©Copyright 2007 Serlio Software
7. Show What the Actor Does or Gets • What scope for each step? • Large grained steps – Important detail is lost • Fine grained steps – Flow becomes unreadable ©Copyright 2007 Serlio Software
©Copyright 2007 Serlio Software
7. Show What the Actor Does or Gets • Each step shows either: – What the actor does – The system is waiting for input or – What the actor gets – The system is doing work for the actor ©Copyright 2007 Serlio Software
©Copyright 2007 Serlio Software
©Copyright 2007 Serlio Software
Practice these habits, write better use cases.
- Slides: 37