Use case relationships: includes and extends

Tip: Choose Save as PDF in the print dialog to download. Use A4 paper size.

Use case relationships: includes and extends

Name:
Date:
Class:

Quick Questions

Shade in the A or B circle for each question.

1. In an online shop, 'Make Payment' must always run 'Validate Card'. Which relationship links them?
A <<include>>
B <<extend>>
2. 'Add Gift Message' only happens if the customer chooses it while placing an order. Which relationship is this?
A <<extend>>
B <<include>>
3. For an <<include>> relationship, which way does the arrow point?
A From the included use case to the base use case
B From the base use case to the included use case
4. For an <<extend>> relationship, which way does the arrow point?
A From the extending use case to the base use case
B From the base use case to the extending use case
5. Which statement about an included use case is true?
A It runs only when the user chooses it
B It runs every time the base use case runs

Match the Pairs

Draw a line connecting each item on the left to its match on the right.

Left columnRight column
1Checkout - - <<include>> - -> Verify Card AThe arrow points the wrong way. An extend arrow must point from Download Receipt (the optional extension) to the base use case, Pay Fees.
2Apply Discount - - <<extend>> - -> Checkout BApply Discount optionally adds behaviour to Checkout, and the arrow points to the base use case.
3A base use case that always needs another use case to finish uses an include relationship CCheckout always uses Verify Card, and the arrow points to the included use case.
4An optional extra step uses an extend relationship, with the arrow pointing from the extra step to the base DEntering a PIN always happens when withdrawing cash, so it should be <<include>>, not <<extend>>.
5Withdraw Cash - - <<extend>> - -> Enter PIN EAdd Gift Wrap - - <<extend>> - -> Place Order
6Pay Fees - - <<extend>> - -> Download Receipt FBorrow Book - - <<include>> - -> Scan Library Card

Definitions

<<include>> vs <<extend>>

Fill in the Blanks

Complete each line of code by filling in the missing parts.

1.
# Every checkout needs a login Checkout --> Login : <<_______>>
2.
# A coupon is optional at checkout Apply Coupon --> Checkout : <<______>>
3.
Base: Book Flight Optional: Add Meal Add Meal --> ___________ : <<extend>>
4.
Included: Log In Place Order --> ______ : <<include>>
5.
# Making a sale always checks stock _________ --> Check Stock : <<include>>

Spot the Error

Shade in the letter of the line that contains an error.

Question 1
A Actor: Customer
B Order ..> Pay <<include>>
C Order ..> Login <<extend>>
Question 2
A Pay ..> Order <<include>>
B Order ..> Login <<include>>
C Actor: Customer
Question 3
A Actor: Shopper
B Checkout ..> Gift <<extend>>
C Checkout ..> Pay <<include>>
Question 4
A Actor: Member
B Borrow ..> Login <<include>>
C Return ..> Scan <<include>>
D Fine ..> Return <<include>>
Question 5
A Actor: Customer
B Receipt ..> Buy <<extends>>
C Buy ..> Pay <<include>>

Answer Key

Use case relationships: includes and extends
Section A: Quick Questions
Q1
A — <<include>>
Q2
A — <<extend>>
Q3
B — From the base use case to the included use case
Q4
A — From the extending use case to the base use case
Q5
B — It runs every time the base use case runs
Section B: Match the Pairs
Q1
Checkout - - <<include>> - -> Verify Card → Checkout always uses Verify Card, and the arrow points to the included use case.
Q2
Apply Discount - - <<extend>> - -> Checkout → Apply Discount optionally adds behaviour to Checkout, and the arrow points to the base use case.
Q3
A base use case that always needs another use case to finish uses an include relationship → Borrow Book - - <<include>> - -> Scan Library Card
Q4
An optional extra step uses an extend relationship, with the arrow pointing from the extra step to the base → Add Gift Wrap - - <<extend>> - -> Place Order
Q5
Withdraw Cash - - <<extend>> - -> Enter PIN → Entering a PIN always happens when withdrawing cash, so it should be <<include>>, not <<extend>>.
Q6
Pay Fees - - <<extend>> - -> Download Receipt → The arrow points the wrong way. An extend arrow must point from Download Receipt (the optional extension) to the base use case, Pay Fees.
Section C: Definitions
Q1
<<include>> vs <<extend>> — <<include>>: a use case always uses another (arrow points to the included one). <<extend>>: optionally adds behaviour (arrow points from the extending case to the base).
Section D: Fill in the Blanks
Q1
# Every checkout needs a login Checkout --> Login : <<include>>
Q2
# A coupon is optional at checkout Apply Coupon --> Checkout : <<extend>>
Q3
Base: Book Flight Optional: Add Meal Add Meal --> Book Flight : <<extend>>
Q4
Included: Log In Place Order --> Log In : <<include>>
Q5
# Making a sale always checks stock Make Sale --> Check Stock : <<include>>
Section E: Spot the Error
Q1
C — Logging in always happens when an order is placed, so it must be <<include>>, not <<extend>>. <<extend>> is only for optional behaviour.
Q2
A — For <<include>> the arrow points from the base use case to the included one. It should be Order ..> Pay <<include>>.
Q3
B — For <<extend>> the arrow points from the extending (optional) use case to the base use case. It should be Gift ..> Checkout <<extend>>.
Q4
D — A fine is only charged when a book is late, so it is optional behaviour. It should be <<extend>>, not <<include>>.
Q5
B — The stereotype is spelled <<extend>>, not <<extends>>.