Professional Documents
Culture Documents
Central to UML
not well suited to nd out about constraints, high-level business and non-functional requirements, or domain requirements
2
Use cases
Could be any system, not just SW systems. Dene clear and precise boundaries:
Dont be too ambitious - think small ! Identify basic functionality and concentrate on dening a stable and well-dened architecture. More functionality can always be added later!
Communicates with the system by sending and receiving messages Actors are in control and initiate actions Actors can be ranked :
Primary and secondary actors
Always initiated by an actor Delivers an observable result of value to an actor Is connected to an actor through associations
Normally bidirected one-to-one relations
Use case
Specify desired behaviour
not how it is carried out (implemented) Therefore it is useful for communication between users and developers
not too big, nor too small does something thats of value to an actor
actor association
clearly enough for an outsider to understand it what a system does, not how!
Several ways
structured text (without/with pre-post conditions) pseudo-code sequence diagrams state diagrams
9
how and when the use case starts and ends when it interacts with actors and what objects are exchanged the basic ow and alternative ows of the behaviour
10
Description Example
Main ow of events: The use case starts when the system prompts the Customer for a PIN Number. The Customer can now enter a PIN number via the keypad. The Customer commits the entry by pressing the Enter button. The system then checks this PIN number to see if it is valid. If the PIN number is valid, the system acknowledges the entry, thus ending the use case. Exceptional ow of events: The Customer can cancel a transaction at any time by pressing the Cancel button, thus restarting the use case. No changes are made to the Customers account. Exceptional ow of events: The Customer can clear a PIN number anytime before committing it and reenter a new PIN number. Exceptional ow of events: If the Customer enters an invalid PIN number, the use case restarts. If this happens three times in a row, the system cancels the entire transaction, preventing the Customer from interacting with the ATM for 60 seconds.
Roel Wuyts - ULB - Analyse et Mthodologie Informatiques - 2005/2006 12
What is it trying to achieve Which functions does the actor require, what does he/ she need to do? Which actor initiates the use case and in which situations? Which messages or events are necessary
13
Which entities are modied and/or used? When is the use case considered to be nished and what kind of value is delivered to the actor?
14
Relationships
Between actors
generalization
15
Actor generalization
Can have general kinds of actors, and specialize them with the generalization relationship
Customer
Commercial Customer
16
child use case can be used wherever the parent use case is used
17
Validate User
Check password
Retinal Scan
18
Includes relationship
A base use case including a supplier use case means that the base use case explicitly incorporates the supplier use case at a certain location
the included use case never exists alone think of include as: the base case pulling behavior from the supplier case
Used to model common behaviour in one place, and afterwards use it in several other places
19
20
Description of Track Order use case: Main ow of events: Obtain and verify the order number. include (Validate User). For each part in the order, query its status, then report back to the user.
Roel Wuyts - ULB - Analyse et Mthodologie Informatiques - 2005/2006 21
Extends relationship
A base use case extends an extension use case means that the base use case implicitly incorporates the behaviour of the extension use case at a location specied by the extension use case
22
Extends relationship
extend relationship
<include>
extension point
Validate User
23
24
Example
Cellular Telephone <extend> Place phone call Cellular Network Place conference call
Use scheduler
25
Context of a system
Requirements of a system
26
let domain experts specify outward view (what) so that developers can construct inside view (how) let developers approach an element and understand it basis for testing
27
28
Example
Bill customer Place order <include>
Validate customer
29
Those inside carry out behaviour that those on the outside expect
30
which groups require help from the system which groups are needed to execute the system which groups interact with external hardware which groups perform secondary functions for administration and maintenance
Organize the actors (generalization relationships) When needed, stereotype actors Put them in a use case and connect to use cases
Roel Wuyts - ULB - Analyse et Mthodologie Informatiques - 2005/2006 31
Individual Customer
Corporate Customer
32
33
34
names a single identiable behaviour of the system factors common behaviour by using inclusion factors variants by using extension describes the ow of events clearly enough for an outsider to easily understand it uses a minimal set of descriptions that specify the normal and variant semantics of the use case
35
show only those use case that are important to understand the behaviour show only the actors relating to these use cases
give it a name communicating its purpose minimize lines that cross semantically close elements should be physically close Use different diagrams when needed
36
Examples
University Camera
37
Example 1 : University
38
Example 2 : University
39
Example 3 : Camera
Camera
Open Shutter
40
Example 4 : Camera
Camera
Take Picture
Photographer
Change Film
41
Conclusion
Use Use Case Diagrams to capture user requirements
Can have relations between use cases: generalization, inclusion and extension
42