Professional Documents
Culture Documents
IFS231 Unit+4 2022
IFS231 Unit+4 2022
Requirements analysis
(part 2)
Documenting requirements
Orientation for online teaching and learning programme
Learning objectives
open account
Role of actor
customer
System boundary
Use case
Example of simple Use Case Description
actor
Actors (2)
Child
Include
Include Examples
Extend
ATM Example
Request
assistance <<include>> Replenish
cash
<<extend>>
Make
withdrawal <<include>>
Remove
Make Make cash
transaction deposit
Check
Bank
<<extend>>
Cancel balance Secure
User option facility
Make
payment
Via Cash
Via EFT
deposit
Example 2 - Class discussion
Control System
Scan
Set limits
Liason Physicist
Take profile
Experimental
Physicist
Calibrate
Hardware Specialist 28
Example 3 - Class discussion
Food delivery system
Order Food
Customer
Service Person
Hire Employee
Applicant
Reorder
supplies
<<uses>> Manager
Supplier
Track sales
and inv. data <<uses>>
Produce
mgt. reports
29
What is a use case?
• A use case is a scenario that describes the use of a system by
a user (role) to accomplish a specific goal.
• A use case indicates how each user interacts with the system
interface.
• A scenario is a sequence of steps that describe the
interactions between a user (role) and the system.
32
Benefits of doing use cases
Pro: Con:
(primary actor)
"Place an order" (User goal / Clerk)
Main scenario: (action steps:
full sentences showing
1. Clerk identifies customer, item and quantity. who takes the action!
2. System accepts and queues the order. 3 - 9 steps long.)
50
Other formal use case examples
51
Other formal use case examples
Use Case 12. Buy stocks over the web
Primary Actor: Purchaser (user) Scope: PAF
Level: user goal Precondition: User already has PAF open.
Guarantees: sufficient log information exists that PAF can detect what went wrong.
Success Guarantees: remote web site acknowledged purchase, user's portfolio updated.
Extensions:
2a. User wants a web site PAF does not support:
2a1. System gets new suggestion from user, with option to cancel use case.
3a. ... 52
Precondition
• See page 54 in Cockburn document.
• Sometimes the use case will only be triggered if the user is
already logged on and validated, or some other condition is
known to be true.
• Writing style: The Precondition is written as simple assertions
about the state of the world at the moment the use case
opens.
Suitable examples are:
Primary Actor • <a role name for the primary actor, or description>
Stakeholders & Interests • <list of stakeholders and key interests in the use case>
Success End Condition • <the state of the world upon successful completion>
• Now that we know the syntax for doing use cases, what 4
steps does Cockburn recommend when actually
brainstorming and writing our use cases?
1. identify actors and their goals
2. write the main success scenario (MSC)
3. identify and list possible failure extensions
4. describe how the system handles each failure
57
1. Identify actors and goals
58
Exercise: Identify actors/goals
• Together, let's identify some major actors and their goals for
software for a video store kiosk system:
• The software can be used for looking up movies and actors by
keywords, as well as usable to check out movies from the kiosk
to known customers, without a cashier present.
• A customer can check out up to 3 movies at a time, for up to 5
days each.
• If a movie is returned late, late fees can be paid at the time of
return or time of next checkout.
• The data is stored internally in a database system, which
communicates with the kiosk.
• The manager of the store can log in to update employee data.
59
2. Write the MSC
60
3. List the failure extensions
61
4. Describe failure/error-handling
• Recoverable extensions rejoin main course
– Example: low credit + valued customer -> accept
– Example: low stock + reduce quantity -> accept
• Non-recoverable extensions fail directly
– Not a valued customer -> decline order
– Out of stock -> decline order
• Each scenario goes from trigger to completion
– "Extensions" are merely a writing shorthand
– Can write "if" statements
– Can write each scenario from beginning to end
• Remember the numbering to follow the Failure extensions
<<include>> Make
Enable sound
alarm <<extend>> Activate
Snooze
64
Example 2 - Class discussion
65
Example 2 - Solution
Use Case Name Set Alarm
The user sets the alarm to the preferred time, in order for it to
Description
be activated at the required time
Goal Level User goal
Actor/s User
The alarm clock must be switched on
Precondition/s
The date and time must be set in real time
1. User selects alarm option
Main success 2. User selects the hours of the desired alarm time
scenario 3. User selects the minutes of the desired alarm time
3. User verifies selection by pressing ‘set’ button
1a. The setting time button is pressed instead of the alarm
Failure extension button
3a. The selection is incorrect
1a1. The user goes back and presses the set alarm button
Error handling
3a1. The user restarts the process of setting the alarm
Think – pair – share class exercise
• Consider the case of a video store that wants a kiosk with
intelligent software that can replace human checkout workers.
• A customer with an account can simply use their membership
and credit card with a reader at the kiosk to check out a video.
• Come up with 5 use case names for such software, and draw a
UML use case diagram of these cases and their actors.
• Write a formal (complete) use case for the Customer Checks Out
a Movie scenario.
67