04 - Functional Modeling
04 - Functional Modeling
04 - Functional Modeling
Scenarios
♦ Scenario
A synthetic description of an event or series of
actions and events
A textual description of the usage of a system. The
description is written from an end user’s point of
view
A scenario can include text, video, pictures and
story boards. It usually also contains details about
the work place, social situations and resource
constraints.
More Definitions
♦ Scenario:
“A narrative description of what people
do and experience as they try to make use of
computer systems and applications”
[M. Carroll, Scenario-Based Design, Wiley, 1995]
♦ A concrete, focused, informal description of a
single feature of the system used by a single actor
Scenario become the basis of interaction for a new
design or allow better understanding of the new
design.
Types of Scenarios
♦ As-is scenario:
Describes a current situation. Commonly used in
re-engineering projects. The user describes the
system
♦ Visionary scenario:
Describes a future system
Often used in greenfield engineering and interface
engineering projects
Visionary scenarios are often not done by the user
or developer alone.
Types of Scenarios (2)
♦ Evaluation scenario:
Description of a user task against which the
system is to be evaluated.
♦ Training scenario:
A description of the step by step instructions
that guide a beginner user through a system
Scenario-Based Design
Scenarios can have many different uses during the
software lifecycle:
Requirements Elicitation: As-is scenario, visionary
scenario
Client Acceptance Test: Evaluation scenario
System Deployment: Training scenario
Scenario-Based Design: The use of scenarios in a
software lifecycle activity
Scenario-based design is iterative
Each scenario should be considered as a work document
to be augmented and rearranged (“iterated upon”)
Scenario-Based Design
♦ Focuses on concrete descriptions and
particular instances, not abstract generic ideas
♦ It is work driven not technology driven
♦ It is open-ended, it does not try to be complete
♦ It is informal
♦ Is about intended outcomes, not about
specified outcomes.
How do we find scenarios?
♦ Don’t expect the client to be very helpful if the system
does not exist (greenfield engineering)
➢Client understands the application domain (problem
domain), not the solution domain
♦ Engage in a interaction approach
You help the client to formulate the requirements
The client helps you to understand the requirements
The requirements evolve while the scenarios are being
developed.
Heuristics for finding scenarios
♦ Ask yourself or the client the following questions:
What are the primary tasks that the system needs to perform?
What data will the actor create, store, change, remove or add in the
system?
What external changes does the system need to know about?
What changes or events will the actor of the system need to be
informed about?
♦ However, don’t rely on questions and questionnaires alone
♦ Insist on task observation if the system already exists (interface
engineering or reengineering)
Ask to speak to the end user, not just to the client
Expect resistance and try to overcome it.
Use Cases Approach
♦ Use cases is a technique for specifying behavior
(functionality)
♦ I.e. focuses on functional specs only
♦ Though primarily for specification, can be used in
analysis and elicitation
♦ Can be used to specify business or organization
behavior also, though we will focus on software
♦ Well suited for interactive systems
Use Cases Basics
♦ A use case captures a contract between a user and
system about behavior
♦ Basically a textual form; diagrams are mostly to
support
♦ Also useful in requirements elicitation as users like
and understand the story telling form and react to it
easily
Basics..
♦ Actor: a person or a system that interacts with the
proposed system to achieve a goal (external entity)
Eg. User of an ATM (goal: get money); data entry
operator; (goal: Perform transaction)
♦ Actors can be people or systems
♦ Primary actor: The main actor who initiates a UC
UC is to satisfy his goals
Basics..
♦ Flow of Events (or Main scenario): a set of actions
performed to achieve a goal under some conditions
Actions specified as a sequence of steps (events)
A step is a logically complete action performed either by
the actor or the system
<<things go normally and the goal is achieved>>
2. Failure handling
Perhaps the hardest part
Specify system behavior for the failure conditions
New business rules and actors may emerge
Basics..
♦ Entry condition (or Pre-condition):
➢what should be True before starting the first step in UC
-ATM
-Bank -ATM
-ATM
-Customer - Bank
- Customer - Customer
- Bank
2. Identify actors
• Choose actors’ names carefully
• Actors give value, get value from system or both
• Should reflect roles rather than actual people
Use Case Development – Example: ATM System (2)
3. Identify use cases Example actor: Customer
Identify and refine actors’ goals Goal: Access account 24/7 for
⧫ Why would actor AAA use the regular banking operations
system? (withdrawal, deposit, statement...)
Identify actors’ tasks to meet in a timely and secure way.
goals To be refined into sub-goals.
⧫ What interactions would meet goal
From goals we can identify tasks:
GGG of actor AAA?
Withdraw Cash, Make Deposit,
Print Account Statement....
Use Case Development – Example: ATM
System (3)
3. Identify use cases (cont’d)
Develop a brief description in narrative form
e.g., description of use case Withdraw Cash
The Customer identifies herself to the system, then selects the cash
withdrawal operation. The system asks for the amount to withdraw.
The Customer specifies the amount. The system provides the
requested amount if it is less than the account’s balance. The
Customer takes the amount and leaves.
♦ Participating actors
Bob, Alice and John.
After the scenarios are formulated
ReportEmergency
FieldOfficer Dispatcher
OpenIncident
ReportEmergency
AllocateResources
UML Use Case Diagram
Watch System
Use Case
Watch
Actor.
ReadTime
SetTime
WatchUser WatchRepairPerson
<<include>>
<<include>> <<include>>
<<include>>
OpenIncident
ViewMap
Base Use
Case <<include>>
Supplier
AllocateResources
Use Case
<<extend>> Association for Use Cases
♦ Problem: The functionality in the original problem statement
needs to be extended.
♦ Solution: An extend association from use case A to use case B
♦ Example: “ReportEmergency” is complete by itself, but can be
extended by use case “Help” for a scenario in which the user
requires help
<<extend>>
Help
FieldOfficer
ReportEmergency
Generalization in Use Cases
♦ Problem: We want to factor out common (but not identical)
behavior.
♦ Solution: The child use cases inherit the behavior and meaning of
the parent use case and add or override some behavior.
♦ Example: “ValidateUser” is responsible for verifying the identity
of the user. The customer might require two realizations:
“CheckPassword” and “CheckFingerprint”
Child
Use Case
CheckPassword
Parent
ValidateUser
Case
CheckFingerprint
Generalization in Use Cases (cont.)
♦ Generalization of actors is supported
The open triangle points toward the more general case
UML Use Case Diagram Example:
- ATM System -
Withdraw Cash
<<include>> <<include>>
Customer
Make Deposit
Print Account
Statement
Extension Points
▪ To describe where or when to execute the “extend use case”
▪ Extension points are either written:
▪directly within the use case
▪As a label and location
▪ Specification of multiple Extension Points is possible.
▪ Example:
Example: University Registration System (1)
Enroll in
University <<includes>> Enroll in
Registrar Course
XPCheck :7
<<extends>>
Applicant
Perform
Security Check
International Applicant
Security System
Example: University Registration System (2)
♦ Use Case 1: Enroll in University
♦ Goal: Enroll applicant in the university
♦ Preconditions:
The Registrar is logged into the system.
The Applicant has already pass initial checks to verify that they are
eligible to enroll.
♦ Postconditions:
The Applicant will be enrolled in the university as a student if they are
eligible.
Example: University Registration System (3)
♦ Flow of Events:
1. An applicant wants to enroll in the university.
2. The applicant hands a filled out copy of form UI13 University Application Form to the registrar.
3. The registrar visually inspects the forms.
4. The registrar determines that the forms have been filled out properly.
5. The registrar selects to Create New Student.
6. The system displays the Create Student Screen.
7. The registrar inputs the name, address, and phone number of the applicant.
[Extension Point: XPCheck]
8. The system determines that the applicant does not already exist within the system.
9. The system determines that the applicant is on the eligible applicants list.
10. The system adds the applicant to its records.
11. The registrar enrolls the student in courses via use case Enroll in Course.
12. The system prepares a bill for the applicant enrollment fees.
♦ Alternate Flows of Events:
(4) a The forms have not been adequately filled…
Example: University Registration System (4)
♦ Use Case 2: Perform Security Check
♦ Flows of Events:
♦ Exceptions:
3.a The Security System responds that applicant has not been
cleared
Use Case Development – Rules of Thumb
➢ Be careful not to over specify behavior
Keep it short, keep it simple: main flow should fit on a single page
Focus on what, not how
➢ Be careful not to under specify behavior
Do not forget variations on basic flow
Do not forget exceptions (cover both valid and invalid inputs)
▪ Actors are not part of the system, hence, they are positioned
outside the system boundaries!
Best Practices
Typical Errors To Avoid
▪ Many small use cases that have the same objective may be
grouped to form one use case
✓
Best Practices
Typical Errors To Avoid
▪ The various steps are part of the use cases, not separate use cases
themselves! -> NO functional decomposition
✓
Notation Elements (1/2)
Name Notation Description