L10: Modelling Use Cases in UML Flashcards
What is a use case diagram?
Use case diagram defines the system boundary, the actors who interact directly with the system and the functionality (use cases) provided by the system to actors.
High level view of the functionality of the system
- What the system does and who uses it
Use case modelling is a form of requirement engineering
- Eliciting and documenting functional requirements
Best used when
- The system is dominated by functional requirements
- The system has many types of users to whom it delivers different functionality
What is the use case modelling process?
- Identifying a system boundary (what is inside or outside a system)
- Identifying actors (the entities that are interacting with and using the system)
- Identifying the use cases (the functionality that is used by the actors)
Iterating these steps until use cases and system boundary are stable. Create iterations and work with stakeholder to refine the model.
What is an actor?
Someone or something that interacts with the system. External to the system
UML Notation: a stick person that could be the customer or an external system.
What is the use case?
- A use case is something an actor wants the system to do
- Use cases are always started by an actor
- Use cases are always written from the point of view of the actor
UML Notation: an oval titled by the interaction, e.g. PlaceOrder
How do we identify use cases?
One obvious way is to start with the list of actors, and then consider how each actor is going to use the system.
“as … I want to do … so i can get the benefit …”
You may find new actors when identifying use cases. Use case modelling is iterative and proceeds via a process of stepwise refinement.
What is a communication link?
Participation of an actor in a use case
UML Notation: a line between and actor and a use case
What is a system boundary?
System boundary is used to define
* What is part of the system (inside the boundary)
* What is external to the system (outside the boundary)
UML Notation: A system boundary is represented as a box labelled with the name of the system with actors drawn outside the box with use cases inside the box
What are the 4 relationships in use case diagrams?
Actor generalisation
A relationship between a general actor and a more specific actor
Use case generalisation
A relationship between a general use case and a more specific use case
«include»
A relationship between use cases that lets one use case include behaviours from others
«extend»
A relationship between use cases that lets one use case extend its behaviour with one or more behaviour fragments from another
What is actor generalisation?
An actor generalisation from a more specific, or specialised, actor to a more general, or generalised, actor indicates that instances of the more specific actor may be substituted for instances of the more general actor.
Less general actors can have their own use cases, specific to them.
Notation: Tree of specialised actors pointing towards a more general actor. The arrow is a hollow triangle, pointing to the more general version of the concept.
Actor generalisation reduces duplication and clutter in the diagram.
What is use case generalisation?
Factors out behaviour common to one or more use cases into a parent use case.
Child use cases represent more specific forms of the parent.
Children may:
- inherit features from their parent use case
- add new features
- override (change) inherited features.
Notation: Tree of specialised use cases pointing towards a more general use case. The arrow is a hollow triangle, pointing to the more general version of the concept.
What is the «include» relationship?
The base use case explicitly incorporates the behaviour of another use case (inclusion use case) at a location specified in the base use case.
Uses
- To avoid repetition of a use case in multiple base use cases
- To show how the system can reuse a pre-existing component
- To show common functionalities between use cases
- To document the fact that the project has developed a new reusable component
Notation: A dotted line with an arrow pointing towards the inclusion use case labelled ‘«include»’
What is the «extend» relationship?
A way to insert new behaviour into an existing use case if a condition is met. The base use case provides a set of extension points where new behaviour (extension use case) may be added .
Notation: A dotted line with an arrow pointing towards the base use case labelled ‘«extend»’. Also a short description of the condition.
What is the different between the «include» and «extend» relationships?
«include»
No matter what, the inclusion use case is always included. The arrow points towards the inclusion use case.
«extend»
The extension use case is only included if a certain condition is met. The arrow points towards the base use case.
What is the specification for use cases?
A document for each use case
No UML standard
Typical content
- How the use case starts and ends
- Normal flow of events
- Alternate flow of events
What is included in the general use case template?
- Use case name
- Use case ID
- Brief description
- Actors
- Precondition
- What must be true before the use case starts
- Main flow
- Steps in the use case
- Postcondition
- What must be true at the end of the use case
- Alternative flows