intro: use case and use case diagram documentation
DESCRIPTION
Intro: Use Case and Use Case Diagram Documentation. Use Case. A use case is a contract of an interaction between the system and an actor . Use Case Diagram: an integration of use cases. Use Case Diagram. - PowerPoint PPT PresentationTRANSCRIPT
![Page 1: Intro: Use Case and Use Case Diagram Documentation](https://reader034.vdocuments.site/reader034/viewer/2022051115/56814860550346895db56cfb/html5/thumbnails/1.jpg)
Intro: Use Case and Use Case DiagramDocumentation
![Page 2: Intro: Use Case and Use Case Diagram Documentation](https://reader034.vdocuments.site/reader034/viewer/2022051115/56814860550346895db56cfb/html5/thumbnails/2.jpg)
Use Case
A use case is a contract of an interaction between the system and an actor.
Use Case Diagram: an integration of use cases
![Page 3: Intro: Use Case and Use Case Diagram Documentation](https://reader034.vdocuments.site/reader034/viewer/2022051115/56814860550346895db56cfb/html5/thumbnails/3.jpg)
Use Case Diagram
A use case diagram illustrates a set of use cases for a system, the actors, and the interactions between actors and use cases.
A graphical overview of the functionality provided by a system in terms of actors, their goals (represented as use cases), and any dependencies between those use cases.
![Page 4: Intro: Use Case and Use Case Diagram Documentation](https://reader034.vdocuments.site/reader034/viewer/2022051115/56814860550346895db56cfb/html5/thumbnails/4.jpg)
Use Case Diagram Objectives1. Create a semi-formal model of the functional
requirements
2. Analyze and define: • Scope • External interfaces • Scenarios and reactions
![Page 5: Intro: Use Case and Use Case Diagram Documentation](https://reader034.vdocuments.site/reader034/viewer/2022051115/56814860550346895db56cfb/html5/thumbnails/5.jpg)
![Page 6: Intro: Use Case and Use Case Diagram Documentation](https://reader034.vdocuments.site/reader034/viewer/2022051115/56814860550346895db56cfb/html5/thumbnails/6.jpg)
What makes a good Use Case Diagram?
Lack of ambiguity - Each requirement must be interpreted in a single manner.
Completeness - The collection of all use cases is everything that can be done to/with the system.
Consistency - Requirements should not conflict with each other. If there are, tradeoffs must be detected and discussed.
Avoid design- Requirements should raise a need, not answer it.
![Page 7: Intro: Use Case and Use Case Diagram Documentation](https://reader034.vdocuments.site/reader034/viewer/2022051115/56814860550346895db56cfb/html5/thumbnails/7.jpg)
Construct a Use Case Diagram
![Page 8: Intro: Use Case and Use Case Diagram Documentation](https://reader034.vdocuments.site/reader034/viewer/2022051115/56814860550346895db56cfb/html5/thumbnails/8.jpg)
Finding actors
External objects that produce/consume data:
1. Must serve as sources and destinations for data 2. Must be external to the system
Humans Machines External systems Sensors
![Page 9: Intro: Use Case and Use Case Diagram Documentation](https://reader034.vdocuments.site/reader034/viewer/2022051115/56814860550346895db56cfb/html5/thumbnails/9.jpg)
Actor Relationships – Generalization/Specialization
Define hierarchy for actors
Notation
The child actor inherits all use-cases associations
Should be used if (and only if), the specific actor has more responsibility than the generalized one (i.e., associated with more use-cases)
![Page 10: Intro: Use Case and Use Case Diagram Documentation](https://reader034.vdocuments.site/reader034/viewer/2022051115/56814860550346895db56cfb/html5/thumbnails/10.jpg)
Association: Actor and Use Case
Solid line:
Interaction between actors and use case
Arrowhead (optional)
• Control flow
• Initial invocation, primary actor
![Page 11: Intro: Use Case and Use Case Diagram Documentation](https://reader034.vdocuments.site/reader034/viewer/2022051115/56814860550346895db56cfb/html5/thumbnails/11.jpg)
Use Case Relationships
• Goal: enable flexibility in requirements specification 1. Isolating functionality 2. Enabling functionality sharing 3. Breaking functionality into manageable chunks
• Relationships1. Include 2. Extend 3. Generalization
![Page 12: Intro: Use Case and Use Case Diagram Documentation](https://reader034.vdocuments.site/reader034/viewer/2022051115/56814860550346895db56cfb/html5/thumbnails/12.jpg)
IncludeGoal: 1.Decomposing complicated behavior 2.Centralizing common behavior
the behavior of the included use case is inserted into the behavior of the including use case - The first use case often depends on the outcome of the included use case.
![Page 13: Intro: Use Case and Use Case Diagram Documentation](https://reader034.vdocuments.site/reader034/viewer/2022051115/56814860550346895db56cfb/html5/thumbnails/13.jpg)
Extendthe behavior of the extension use case may be inserted in the extended use case under some conditions
Note the direction of the arrow The base use-case does not know which use-case extends it
![Page 14: Intro: Use Case and Use Case Diagram Documentation](https://reader034.vdocuments.site/reader034/viewer/2022051115/56814860550346895db56cfb/html5/thumbnails/14.jpg)
![Page 15: Intro: Use Case and Use Case Diagram Documentation](https://reader034.vdocuments.site/reader034/viewer/2022051115/56814860550346895db56cfb/html5/thumbnails/15.jpg)
Generalization
use case may have common behaviors, requirements, constraints, and assumptions with a more general use case.
![Page 16: Intro: Use Case and Use Case Diagram Documentation](https://reader034.vdocuments.site/reader034/viewer/2022051115/56814860550346895db56cfb/html5/thumbnails/16.jpg)
Example: Cellphone Company System
Hint - Actors: Phones, Phone Companies
![Page 17: Intro: Use Case and Use Case Diagram Documentation](https://reader034.vdocuments.site/reader034/viewer/2022051115/56814860550346895db56cfb/html5/thumbnails/17.jpg)
![Page 18: Intro: Use Case and Use Case Diagram Documentation](https://reader034.vdocuments.site/reader034/viewer/2022051115/56814860550346895db56cfb/html5/thumbnails/18.jpg)
Writing Use Cases
• Name: • Actors:• Descriptions:
– Precondition– Main flow– Sub flow– Alternative flow
![Page 19: Intro: Use Case and Use Case Diagram Documentation](https://reader034.vdocuments.site/reader034/viewer/2022051115/56814860550346895db56cfb/html5/thumbnails/19.jpg)
Precondition
• What the system needs to be true before running the use-case. – User account exists – User has enough money in her account – There is enough disk space
![Page 20: Intro: Use Case and Use Case Diagram Documentation](https://reader034.vdocuments.site/reader034/viewer/2022051115/56814860550346895db56cfb/html5/thumbnails/20.jpg)
Main flowThe success scenario is the main story-line of the use-case • Assumption: everything is okay, no errors or problems occur, and it leads directly to the desired outcome of the use-case • It is composed of a sequence of subflows
Example:
Step 1: Administrator enters course name, code and description (interaction)Step 2: System validates course code Step 3: System adds the course to the db and shows a confirmation message (interaction)
![Page 21: Intro: Use Case and Use Case Diagram Documentation](https://reader034.vdocuments.site/reader034/viewer/2022051115/56814860550346895db56cfb/html5/thumbnails/21.jpg)
Branches:
If the user has more than 10000$ in her account, the system presents a list of commercials Otherwise…
Repeats:
User enters the name of the item he wishes to buy System presents the items User selects items to buy Systems adds the item to the shopping cart User repeats steps 1-4 until indicating he is done
Sub flow
![Page 22: Intro: Use Case and Use Case Diagram Documentation](https://reader034.vdocuments.site/reader034/viewer/2022051115/56814860550346895db56cfb/html5/thumbnails/22.jpg)
Used to describe exceptional functionality
Examples: 1. Errors 2. Unusual or rare cases 3. Failures 4. Starting points 5. Endpoints 6. Shortcuts
Alternative flows
![Page 23: Intro: Use Case and Use Case Diagram Documentation](https://reader034.vdocuments.site/reader034/viewer/2022051115/56814860550346895db56cfb/html5/thumbnails/23.jpg)
Write Include in User Case
Reference
![Page 24: Intro: Use Case and Use Case Diagram Documentation](https://reader034.vdocuments.site/reader034/viewer/2022051115/56814860550346895db56cfb/html5/thumbnails/24.jpg)
Write Exclude in Use Case
Extension Point
![Page 25: Intro: Use Case and Use Case Diagram Documentation](https://reader034.vdocuments.site/reader034/viewer/2022051115/56814860550346895db56cfb/html5/thumbnails/25.jpg)
Use Case sample
![Page 26: Intro: Use Case and Use Case Diagram Documentation](https://reader034.vdocuments.site/reader034/viewer/2022051115/56814860550346895db56cfb/html5/thumbnails/26.jpg)
Include Concept
![Page 27: Intro: Use Case and Use Case Diagram Documentation](https://reader034.vdocuments.site/reader034/viewer/2022051115/56814860550346895db56cfb/html5/thumbnails/27.jpg)
![Page 28: Intro: Use Case and Use Case Diagram Documentation](https://reader034.vdocuments.site/reader034/viewer/2022051115/56814860550346895db56cfb/html5/thumbnails/28.jpg)
Extend Concept
![Page 29: Intro: Use Case and Use Case Diagram Documentation](https://reader034.vdocuments.site/reader034/viewer/2022051115/56814860550346895db56cfb/html5/thumbnails/29.jpg)
![Page 30: Intro: Use Case and Use Case Diagram Documentation](https://reader034.vdocuments.site/reader034/viewer/2022051115/56814860550346895db56cfb/html5/thumbnails/30.jpg)
![Page 31: Intro: Use Case and Use Case Diagram Documentation](https://reader034.vdocuments.site/reader034/viewer/2022051115/56814860550346895db56cfb/html5/thumbnails/31.jpg)
Generalization Concept
![Page 32: Intro: Use Case and Use Case Diagram Documentation](https://reader034.vdocuments.site/reader034/viewer/2022051115/56814860550346895db56cfb/html5/thumbnails/32.jpg)
Effective Use Cases
• Only one side (system or actor) is doing something in a single step
• Write from an “objective” point of view using active tense
• Any step should lead to some progress
![Page 33: Intro: Use Case and Use Case Diagram Documentation](https://reader034.vdocuments.site/reader034/viewer/2022051115/56814860550346895db56cfb/html5/thumbnails/33.jpg)
Effective Use Cases
“Get the amount form the user and give him the money”
“User click the enter key”
ATM
![Page 34: Intro: Use Case and Use Case Diagram Documentation](https://reader034.vdocuments.site/reader034/viewer/2022051115/56814860550346895db56cfb/html5/thumbnails/34.jpg)
1. No actor 2. Too many user interface details “User types ID
and password, clicks OK or hits Enter” 3. Very low goal details
• User provides name• User provides address • User provides telephone number
Effective Use Cases – Common Mistakes
![Page 35: Intro: Use Case and Use Case Diagram Documentation](https://reader034.vdocuments.site/reader034/viewer/2022051115/56814860550346895db56cfb/html5/thumbnails/35.jpg)
From Use-Case to Use-Case Diagrams
• Top down ? Starting with an overview of the system, and
then splitting Use-cases
• Bottom up ?Starting with throwing all scenarios on the page, and then combining them:
Most of the analysis process are actually combined
![Page 36: Intro: Use Case and Use Case Diagram Documentation](https://reader034.vdocuments.site/reader034/viewer/2022051115/56814860550346895db56cfb/html5/thumbnails/36.jpg)
Common Rules
• Number Limit: The diagram should have between 3 to 10 base use-cases. No more than 15 use cases (base + included + extending).
---- If the dependency between two parts of a use-case is weak, they should be divided.
• Abstraction: All use-cases should be in similar abstraction levels.
• Size: Use cases should be described in half a page or more.
- split using include/exclude
![Page 37: Intro: Use Case and Use Case Diagram Documentation](https://reader034.vdocuments.site/reader034/viewer/2022051115/56814860550346895db56cfb/html5/thumbnails/37.jpg)
When we are done
• When every actor is specified. • When every functional requirement has a use-
case which satisfies it. • A tractability matrix can help us determine it:
![Page 38: Intro: Use Case and Use Case Diagram Documentation](https://reader034.vdocuments.site/reader034/viewer/2022051115/56814860550346895db56cfb/html5/thumbnails/38.jpg)
Use Case and Use Case Diagram a Summary
When to useWhat is Use Case and Use Case DiagramHow to Construct Use Case DiagramHow to Write Use Case
Questions?