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
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’ Goal: Access account 24/7 for
goals regular banking operations
Why would actor AAA use the (withdrawal, deposit, statement...)
system? in a timely and secure way.
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.
Incorrect identification
Customer forgets card in card reader
Incorrect amount entered Customer forgets cash in dispenser
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
Thevarious steps are part of the use cases, not separate use cases
themselves! -> NO functional decomposition
Notation Elements (1/2)
Name Notation Description