Week6 Study Notes
Week6 Study Notes
KEY DEFINITIONS
Use Case: A description of a sequence of interactions between a system and an external actor
that results in something of value to the actor. Named using a verb + object format (e.g.
'Withdraw Cash', 'Search for an Item').
Actor: A role that a user, organisation, or external system plays with respect to the system being
built. Actors initiate or participate in use cases. They are always outside the system boundary.
System Boundary: The box in a use case diagram that separates what is inside the system (use
cases) from what is outside it (actors). Clarifies the scope of the system being designed.
Scenario: A specific path through a use case — a concrete sequence of steps describing one
particular interaction between a user and the system. A use case may have many scenarios
(normal and alternative).
Primary Scenario: The normal, expected flow of events in a use case — the 'happy path' where
everything goes as planned.
Secondary Scenario: An alternative or exception flow — a 'what-if' case that handles situations
where the normal flow cannot be completed (e.g. user cancels, data is invalid, or a dependency
fails).
<> Relationship: A use case relationship where one use case (X) always invokes another use
case (Y) as part of its own execution. Y is a mandatory sub-task of X. Notation: X --<>--> Y. Think
of it like a function call.
<> Relationship: A use case relationship where one use case (Y) is a special, more specific
version of another use case (X). Y extends X by adding extra steps in specific conditions.
Notation: Y --<>--> X.
Actor Generalisation: A relationship where one actor (e.g. 'Individual Customer') inherits all the
use cases of a more general actor (e.g. 'Customer') and may have additional ones. Shown as an
arrow from specialised to general actor.
Precondition: A condition that must be true before a use case can begin executing. Documents
the state the system must be in for the use case to start.
Postcondition: A condition that is guaranteed to be true after a use case finishes executing
successfully. Documents the resulting system state.
Use Case Verification: Checking that the use case correctly matches the user requirements —
i.e. it is correctly specified. Done through reviews.
Use Case Validation: Checking that the system built actually implements the use case correctly
— i.e. the use case is correctly implemented in working software.
Business Rule: A constraint or policy from the business domain that governs how a use case
executes. Can restrict who can perform a use case, define valid inputs, or dictate how
computations are performed.
Data Flow Diagram (DFD): A graphical model that shows how data flows through a system —
from external entities, through processes, to data stores and back. Used to model system
functionality without specifying implementation.
External Entity (DFD): A person, organisation, or system that is outside the system boundary
but sends data to or receives data from the system. Named with a noun. Equivalent to an actor in
use case diagrams.
Process (DFD): A function or activity within the system that transforms input data into output
data. Named with a verb phrase (e.g. 'Record Order', 'Calculate Payroll'). Shown as a circle or
rounded rectangle.
Data Flow (DFD): An arrow showing the movement of data between components (external
entities, processes, data stores). Named with the name of the data being transferred (e.g.
'Customer Order', 'Payment').
Data Store (DFD): A repository where data is held at rest — a database, file, or any persistent
storage. Named with a noun (e.g. 'PAYMENTS', 'INVENTORY'). Shown as an open-ended
rectangle.
Context Level DFD (Level 0 / Context Diagram): The highest-level DFD — shows the entire
system as a single process (Process 0.0), surrounded only by external entities and the data flows
between them. Defines the system boundary and its interactions with the outside world.
Level 0 DFD: The first decomposition of the context diagram. Breaks the single system process
into major sub-systems or functional areas (e.g. Sales, Production, Procurement, Payroll). Shows
data flows between sub-systems.
Level 1 DFD (and beyond): Further decomposition of each Level 0 process into detailed
sub-processes. This level also introduces data stores. Each sub-process is numbered (e.g. 1.1,
1.2, 1.3 for sub-processes of Process 1.0).
A use case describes a sequence of interactions between a system and an external actor that
produces something of value. Use cases capture user actions and the system responses to them —
they describe software behaviour from the user's point of view.
Technique Description
Use Cases Structured, diagram-based technique using UML. Formally documents sequences of interactions betw
User Stories Informal, short descriptions of features from the user's perspective. Used in Agile (XP, Scrum). Less s
Note: Both techniques focus on understanding what different types of users need to accomplish through
interactions with a software system. Use cases lead to functional requirements; user stories are directly
used in sprint planning.
Component Description
Use Case Specifies a complete piece of system functionality. Must always deliver some output or response to th
Actor A role that a user, organisation, or external system plays. Initiates or participates in use cases. Always
System Boundary A rectangle that separates the system (use cases inside) from the external world (actors outside). Def
Association A straight line or arrow connecting an actor to a use case. Shows which actors participate in which use
Relationship A dotted arrow between two use cases. Shows <<include>> or <<extend>> relationships.
A use case describes all possible interactions for a given piece of functionality. A scenario is one
specific path through that use case — a concrete example of one interaction.
<> Relationship
Use <> when one use case (X) always calls another use case (Y) as a mandatory sub-step during
its own execution. X cannot complete without Y. This is similar to a function calling another function.
Rules:
• The included use case (Y) is always executed when X runs — it is not optional
• X depends on the outcome of Y
• Used to extract common behaviour shared by multiple use cases
• Notation: X --<>--> Y
<> Relationship
Use <> when one use case (Y) is a special, more specific version of another use case (X). Y adds
extra steps to X that only apply in certain conditions. Y inherits everything from X and adds more on
top.
Rules:
• Y is a conditional extension — it only applies in specific situations
• X is complete on its own — Y is not required for X to finish
• Think of it as a generalisation-specialisation relationship
• Notation: Y --<>--> X
Example — Place Phone Call:
• 'Place Conference Call' <> 'Place Phone Call'
• A conference call does everything a normal phone call does, plus sets up a multi-party
connection
What it means X always does Y as a sub-step Y is a special case of X with extra steps
Example 'Withdraw Cash' includes 'Validate Account''Place Conference Call' extends 'Place Phone Call'
5. ACTOR GENERALISATION
Just as use cases can be related by <>, actors can also be generalised. A specialised actor inherits
all the use cases of the general actor and may have additional ones of its own.
Note: This is the same concept as inheritance in object-oriented programming — the child actor inherits all
properties of the parent actor.
A use case diagram alone is not enough. Each use case must be fully documented in a structured
template covering the following fields:
Field Description
Priority How important is this use case? (e.g. High, Medium, Low)
Summary A brief plain-English description of what the use case does and why.
Preconditions What must be true before this use case can begin?
Postconditions What is guaranteed to be true when the use case finishes successfully?
Includes / Extends Which other use cases does this one include or extend?
Normal course of events Step-by-step table of user actions and system responses in the happy path.
Alternative path What happens if the user takes a different route (e.g. cancels)?
Exception / Alert What errors or system-level problems can occur and how are they handled?
Assumptions Any assumptions made about the system state or user behaviour.
Actor:
User
Summary:
Allows the user to permanently remove a complete set of information from the system. Deletion is
only possible when the information is not being used by any other part of the system.
Precondition:
The information has been previously saved to the system and the user needs to permanently
remove it.
Postcondition:
The information is no longer available anywhere in the system.
Includes:
Record Transaction, Cancel Action
Extends:
None
2 User selects the information to delete and instructs the system to delete it.
Alternative path:
• If the user does not confirm deletion, the information is NOT deleted
• Includes: Cancel Action
Exception:
• The system will not allow deletion of information that is currently being used by another part of
the system
Assumptions:
• Deleted information is permanently removed and not retained anywhere
• Deleting only part of a record constitutes modification, not deletion
# Approach Description
1 Actor-first Identify all actors first. Then for each actor, ask: what tasks does this actor need to perform using th
2 Process-first Start from a description of the business process. Ask: 'What tasks must the system perform to comp
3 Event-first Identify external events the system must respond to. Then relate each event to the actor that trigger
Note: Use cases emerge through brainstorming sessions with clients and by studying domain documents.
There is no single correct set of use cases for a system — they depend on the level of detail and the scope
agreed with the client.
Type Description
Verification Checks that the use case correctly matches the user requirements — i.e. it is correctly specified. Done th
Validation Checks that the system built actually implements the use case correctly — i.e. the use case is correctly re
Use cases describe systems from the user's external perspective — they treat the system as a black
box. This means they have important limitations:
Because of these limitations, use cases must always be supplemented with additional
documentation: non-functional requirements, business rules, domain models, and detailed
functional specifications.
Example: An airline charges a premium for preferred seats. When a passenger runs the 'Select
Seat' use case and picks a premium seat, the relevant business rule changes the airfare — this rule
is not captured in the use case itself.
A Data Flow Diagram (DFD) visualises how data flows through a system — from external entities,
through processes, into data stores, and back out. DFDs model what a system does with data
without specifying how it is implemented.
External Entity Rectangle Noun A person, system, or organisation outside the system that pro
Data Flow Arrow (labelled) Name of the data Shows the movement of data between components. The labe
Data Store Open-ended rectangle Noun A repository where data is stored at rest (database, file). Data
Data Store Noun (often in CAPITALS) PAYMENTS, INVENTORY, ORDER, TIME CARDS
Note: A common mistake is drawing a data flow directly from an external entity to a data store (or vice versa)
— all data must pass through a process before being stored or sent out.
DFDs are built in levels of increasing detail. You start with the big picture and progressively
decompose each process into sub-processes.
Context Level The entire system shown as ONE single process (e.g.
Lemonade
'0.0 Lemonade
SystemSystem').
(0.0) receives:
Only external
Customerentities
Order,and
Time
th
(Level 0)
The lemonade stand is used in the slides to demonstrate DFD construction step by step. Here is
how it breaks down:
Area Activities
External entities:
• CUSTOMER — sends: Customer Order; receives: Product Served, Payment
• EMPLOYEE — sends: Time Worked, Sales Forecast; receives: Pay
• VENDOR — sends: Received Goods; receives: Purchase Order, Payment
Sub-System Responsibility
1.0 Sale Handles customer interactions — receiving orders, serving product, collecting payment.
2.0 Production Manages product creation and storage — using raw materials from inventory.
3.0 Procurement Manages purchasing — generating purchase orders, receiving goods, paying vendors.
4.0 Payroll Manages employee payment — recording time worked and calculating and issuing pay.
The full decomposition hierarchy for the Lemonade Stand system looks like this:
0.0 Lemonade System 1.0 Sale 1.1 Record Order, 1.2 Receive Payment, 1.3 Produce Sales Forecast
2.0 Production 2.1 Serve Product, 2.2 Produce Product, 2.3 Store Product
3.0 Procurement 3.1 Produce Purchase Order, 3.2 Receive Items, 3.3 Pay Vendor
4.0 Payroll 4.1 Record Time Worked, 4.2 Calculate Payroll, 4.3 Pay Employee
Focus User interactions with the system How data moves through the system
Perspective External (user's view — black box) Internal (how data is processed)
Main elements Actors, use cases, relationships External entities, processes, data flows, data stores
Shows What users can do with the system What the system does with data
Captures NFRs? No No
Best used for Defining scope, user requirements, functionalUnderstanding
requirements data processing, system structure
UML standard? Yes (UML diagram) No (predates UML, still widely used)
Week 6 Study Notes | Use Case Models & Data Flow Diagrams