An Introduction To Use Case Modeling
An Introduction To Use Case Modeling
An Introduction To Use Case Modeling
Agenda
Requirements Use Cases Use Case Diagrams Use Case Scenarios Use Case Modeling with UML
Requirements
Look at how the traditional approach to requirements has
severely limited our ability to satisfy our customer and stabilize our work effort. Establish a requirement structure that will help ask the right questions and capture the information the Architects, Developers, Testers, and others will need. Recognize that requirements strategies for categorizing, relating and agreeing requirements can greatly minimize the risk for building the wrong product. Embrace the critical nature of a user-centric approach and employ techniques which keep user satisfaction at the center of our effort.
Technical Writers
To know how to document the system IT Operations/Support To know how to install and maintain the system Users To know how to use the system
Use Cases are: One of many techniques to elicit and elaborate user requirements. A common presentation of requirements for different roles. A handy unit of planning and estimation.
System Boundary
Marks off the system as
separate from its environment
Actor
Someone or something outside
the system that interacts with it
Use Case
A use case achieves a goal of
value to an actor System does these things for actors What system is for not how it does it Starts with an active verb from the point of view of the system
Communications
When do we stop doing use case analysis? When the use cases meet the communication needs
Stakeholders reach consensus
Less is more
Scenarios
Scenario is another name for a
particular flow of events. A use case covers a range of situations a scenario is just one. Each use case typically has: a main flow describing the happy path alternate flows describing major exceptions Several alternatives exist for specifying the use case scenarios.
3.
4. 5. 6. 7.
Error case 1: UPC code unreadable If after step 2, the UPC code was invalid or was not properly read, emit an audible bonk sound. Error case 2: No item in database If after step 3 no database entry is found for the UPC flash the manual entry button on the terminal. Accept key entry of price and tax code from Sales Clerk. Set Item description to Unknown item. Go to step 4.
Reap the benefits of Model-Driven Development (MDD) Get ready for Model-Driven Architecture (MDA)
Composite Structure Diagram Package Diagrams Object Diagrams User View Class Diagrams Use Case Diagrams Activity Diagrams Sequence Diagrams Collaboration Diagrams State Machine Diagrams Interaction Overview Diagrams
Deployment Diagrams
Behavioral View
Environment View
Adapted from [Kruchten]
Association
Multiplicity
Typically,
An actor will have up to one interaction with a given use case. A use case instantiation interacts with one and only one of a given actor. Previous to UML 2.0 this was the default association. There are cases where we have multiple interactions simultaneously.
Direction
Labels
UML allows:
Labels for the association Labels for roles on each end Usage is uncommon and is not recommended
Specialization/Generalization of Actors
Using Generalization
Includes
Included use case embodies common behavior
Extends
Extending use case adds behavior
Generalization
Shows inheritance and specialization One use case is simply a special kind of another
Includes
Factor out of a use case commonly used behavior Allows reuse of functionality by multiple use cases
Extends
Indicates that one use case adds or replaces behavior of another Must have a an associated extension point May have a condition
Code
Level 5
Adapted from the Final Adopted Specification for the UML 2.0 Superstructure
Activity
Activity diagrams are an easy way
to represent the high-level flow of activity. Show how activities connect to one another in a process. Sequential or concurrent activities Often used to: model the flow of events in a use case model business processes model internal system processes
Interaction
Interaction diagrams help
capture who does what when Most popular way to show dynamic aspects of models. Reveal the details of message passing how objects respond to messages by delegating to others.
State Machine
Use case analysis often reveals
state-based behavior. When you hear status, think of a state machine. Exception flows may occur based on state. The user may operate directly on the state of something in the system.
A Parting Thought
The term use-case driven is a wonderful marketing term but the reality is that use cases arent sufficient to drive much of anything. Use cases are a good technique to document behavioral requirements but thats only a small part of the functional requirements picture and an even smaller part of the total requirements picture they arent very good at documenting business rules, user interface requirements, constraints, or non-functional requirements. [Ambler]
References
[Fowler] Fowler, Scott, UML Distilled 2nd Edition, AddisonWesley [Jacobson] Jacobson, Booch, Raumbaugh, The Unified Software Development Process, Addison-Wesley [Ambler] Scott Ambler, www.agile-modeling.com [Kruchten] Philippe Kruchten, Architectural BlueprintsThe 4+1 View Model of Software Architecture, IEEE Software 1995
Recommended Reading
Armour, Frank, and Granville Miller, Advanced Use Case Modeling: Software Systems, Addison-Wesley Charbonneau, Serge, Modeling Use Cases with the Borland Suite of Tools, BDN Cockburn, Alistair, Writing Effective Use Cases, Addison-Wesley Miller, Granville, Gathering Requirements: Use Cases, BDN Miller, Randy, Practical UML: A Hands-On Introduction for Developers, BDN Miller, Randy, What's New in UML 2? The Use Case Diagram, BDN Overgaard, Gunnar, and Karin Palmkvist, Use Cases: Patterns and Blueprints, Addison-Wesley BDN content can be found at http://bdn.borland.com/