Title: Lecture 3: Requirements and Use Cases
1Lecture 3 Requirements and Use Cases
- Requirements capture
- Requirements modelling
- Use-cases
- UML Use-Case Diagrams
- Basic notation
- Use-Case Descriptions
- Other notation generalizes, includes, extends
2Requirements Capture
- Aim to develop system to meet user needs
- Capture user requirements capture through
- Background reading/research
- Interviews with users/clients
- Observation of current practices
- Sampling of documents
- Questionnaires
- This is hard!
3Functional and Non-Functional Requirements
- Functional requirements
- What processing system must perform
- Details of inputs and outputs
- Details of data held by system
- Non-functional requirements
- Performance criteria (time/space)
- Security
- Usability requirements
- HCI issues
4ATM Case StudyStatement of Purpose
- The design task is to implement an Automated
Teller Machine (ATM) - An ATM is an electronic device designed for
automated dispensing of money. A user can
withdraw money quickly and easily after
authorization. The user interacts with the system
through a card reader and a numerical keypad. A
small display screen allows messages and
information to be displayed to the user. Bank
members can access special functions such as
ordering a statement
5ATM Case StudyRequirements Summary
- To allow card holders to make transactions
- To view and/or print account balances
- To make cash withdrawals
- To allow bank members to access special services
- To order a statement
- To change security details
- To allow access to authorized bank staff
- To re-stock the machine
- To keep track of how much money it contains
6Use Cases
- Use cases used to model functionality
- What system does, not how
- Focus on functionality from users perspective
- not appropriate for non-functional requirements
- UML use case diagrams
- Document system functionality
- Useful for communicating with clients/users
- Supported by more detailed descriptions of system
behaviour (e.g. text documents, other UML
diagrams)
7UML Use Case Diagrams
Communication association
Withdraw Cash
(Sub)system boundary
Check Balance
CardHolder
Actor
Use case
8Basic Notation
- Use case diagrams show
- Actors people or other systems interacting with
system being modelled - Use cases represent sequences of actions
carried out by the system
- Communication between actors and use cases
9Behaviour Specifications
- Document sequence of actions carried out by
system to realize a use case - Other UML diagrams e.g.
- sequence diagrams
- activity diagrams
- Textual description
- use-case descriptions
- use-case scenarios
10Simple Use Case Description
- Outline of typical course of events
- The primary flow or path
- ATM system example
11Elaborated Use-Case Description
Withdraw Cash basic course of events
- The user selects the cash withdrawal option
- The system displays the cash withdrawal menu
- The use selects the required amount of cash
- The system returns the users card
- The user takes the card
- The system dispenses the cash
- The user takes the cash
12Alternative Courses of Events
- Use case represents a typical case of interaction
- For example, there may be many Withdraw Cash
scenarios where no cash is withdrawn! - Card holder has insufficient funds on account
- ATM cannot connect to banks system
- ATM does not contain enough cash
- Customer cancels the transaction for some reason
13Withdraw Cash - Alternative Course of Events
- Withdraw Cash -- insufficient funds available
- The user selects the cash withdrawal option
- The system displays the cash withdrawal menu
- The user selects the required amount of cash
- The system reports that there are insufficient
funds available and the use case terminates
14Other Types of Relationship
- Generalizes
- Permits actors/use cases to inherit properties of
more general actors/use cases - Include
- Permits use case to include functionality of
another use case - Extend
- Allows for optional extensions of use case
functionality
15Generalizes Relationship
BankMember specializes CardHolder
Withdraw Cash
CardHolder
Check Balance
Generalizes Relation
Order Statement
BankMember
16Include Relationship
Select Account is included in each of the use
cases
Withdraw Cash
include
include
Check Balance
Select Account
BankMember
Order Statement
include
Note include was formerly called uses
17Include Relationship
- Check Balance basic course of events
- The user performs the Select Account use case
- The system displays the main menu
- The user selects the check balance option
- The system displays the users balance
18Extend Relationship
CardHolder has the option of printing out a
balance when the Check Balance use case is
invoked.
Print Balance
extend
Check Balance
Extend relationship
CardHolder
19Extend Relationship
Check Balance basic course of events (revised)
- The user performs the Select Account use case
- The system displays the main menu
- The user selects the display balance option
- The system displays the users balance
- The user optionally performs the Print Balance
use case.
20Summary
- Use case analysis often a first step in system
development - provide high-level view of system functionality
(what rather than how) and its users - A use case represents a typical course of events
- UML use case diagrams
- Contain actors, use cases and associations
- supported by behaviour specifications (e.g.
use-case descriptions)