02 RequirementModelingWithUC
02 RequirementModelingWithUC
vn 2
System engineering
System integrators System topology, delivery,
Performance, scalability, throughput installation, communication
Some slides extracted from IBM coursewares
1 2
3 4
1
5 6
5 6
5. Supplementary Specification
Register for Courses
Student
Login
7
7 8
2
9 10
Identification
Communication Verification
Actor
• A use case describes a sequence
of events, performed by the
software, that yields an observable
result of value to a particular actor. Use Case
End User Domain Expert Users
9 10
11
11 12
3
13 14
13 14
15 16
4
17 18
17 18
19 20
19 20
5
21 22
21 22
23 24
Student
23 24
6
25
Communicates-Association
2.4.2. Between actor and use case
• Establish the actors that interact with related use cases à Use • A channel of communication between an
actor and a use case.
associations
• Associations clarify the communication between the actor and use case. Actor 1 • A line is used to represent a
• Association indicate that the actor and the use case instance of the communicates-association.
system communicate with one another, each one able to send and • An arrowhead indicates who initiates each
receive messages. Use Case interaction.
• The arrow head is optional but it’s commonly used to denote • No arrowhead indicates either end can initiate
each interaction.
the initiator.
Actor
25 26
27
Arrowhead Conventions
2.4.3. Between use cases
Passive sensor • Generalization <<extend>>
• always use
Hybrid sensor Pay order
• <<extend>>
• sometimes use Check password
Passive sensor
Validate user
Monitor
for alarms
Supervisor Active sensor
Retinal scan
Hybrid sensor 28
27 28
7
29 30
29 30
31 32
<<extend>>
Place order Place rush order
31 32
8
33
Notes Content
• Should notuse two many relationships between 1. Requirements
use case in the Use case diagram
• Tangle and make the diagram difficult to observe 2. Use case diagram
• Only use the relationship if necessary 3. Use case specification/scenario
• In the Use case diagram, the sequence do use cases
are not specified 4. Glossary
5. Supplementary Specification
34
33 34
35 36
Use-Case Specification
The System Use-Case Specification
Use-Case Model
Use case 1 • Code
Use-Case-Model Survey Actor 1
- survey description • Name
Actor 2
- list of all actors Use case 2
• Brief description
- list of all use cases Actors
• Flow of Events
Use case 3
• Relationships Use Cases
Actor 3
• Activity diagrams
• Use-Case diagrams
• Special requirements
...
Use-Case 1 Spec • Pre-conditions
Use-Case 2 Spec Use-Case 3 Spec
- brief description - brief description - brief description • Post-conditions Use-Case Specifications
- flow of events - flow of events - flow of events • Other diagrams
35 36
9
37 38
37 38
39 40
39 40
10
41 42
Flow of events
UC Login in the ATM system Success / Main flow of event
# Doer Action
• Main flows of events: The use case starts when system 1 Customer requests to log in
prompts the Customer for a PIN Number. The Customer can 2 software prompts a Log in screen
now enter a PIN number. The Customer commits the entry. The 3 Customer enters a PIN number
system then checks this PIN number to see if it is valid. If valid, 4 Customer submit to login
the system acknowledges the entry, thus ending the use case 5 software checks if the PIN number is valid
• Regular variants: The Customer cancel a transaction at any 6 software displays the main menu if the PIN number is valid
time, thus restart the UC. No changes are made to the
Customer’s account. Alternative flow of event
• Odd case: The Customer clear a PIN number anytime before # Doer Action
committing it and re-enter a new PIN number Customer cancels a transation at any time
• Exceptional flow of events: If the Customer enter an invalid PIN 4a Customer clears PIN number before submitting
number, the UC restarts. If this happens 3 times in a row, the 6a software notifies Invalid PIN number, goes to Step 2 if the PIN
system cancel the entire transaction, and keep the ATM card. number is not valid less than 3 times
6b software notifies invalid PIN number 3 times, keep the ATM card if the
PIN number is not valid 3 times
41 42
@Nguyễn Thị Thu Trang, [email protected] 43 @Nguyễn Thị Thu Trang, [email protected] 44
43 44
11
@Nguyễn Thị Thu Trang, [email protected] 45 @Nguyễn Thị Thu Trang, [email protected] 46
E.g. Include use case in specification E.g. Extend use case in specification
Base
Use-Case Base
• Use case “Place order” Use Case
Instance Use Case
Basic flow Use-Case • Use case “Place order”
1. … Instance Extension
Basic flow Point
2. … 1.… Extension
3. Passenger confirm to buy tickets 2.Customer enters and submits shipping info Use Case
4. Software calls the use case “Pay receipt” 3.Software displays receipt
Included 4.…
5. Software calls the use case “Print receipt” Use Case
Alternative flow
6. …
A1. In the step 2, if customer chooses to place a rush
• Use case “Pay receipt” order, insert use case “Place rush order”, then resume at
the step 3.
Basic flow
…
1. Software asks passenger to insert a credit card
• Use case “Place rush order”
2. Passenger inserts a credit card to the credit card slot 1. Software displays rush order form
3. … 2. Customer
3. …
45 46
@Nguyễn Thị Thu Trang, [email protected] 47 @Nguyễn Thị Thu Trang, [email protected] 48
How do you handle repetitive behavior? How do you handle repetitive behavior? (cont.)
Basic Flow
1. Log On. Register for Courses
…
Register for Courses 2. Create Schedule.
1.2. The system displays the functions available to the student. These
functions are Create A Schedule, Modify a Schedule and Delete a Schedule.
The student selects ‘Create a Schedule’.
3. Perform Subflow Select Courses
Repetitive flow of 4. Submit Schedule
Simple, repetitive events can be …
Alternative Flows
behavior can be captured using a 1. Modify Schedule.
captured within subflow. 1.1 In the Create Schedule step of the Basic Flow, if the student already has a
schedule that has been saved; the system retrieves and displays the Student’s
the basic flow. current schedule (e.g., the schedule for the current semester) and allows
him/her to use it as a starting point.
1.2 Perform Subflow Select Courses.
1.3 The use case resumes at the Submit Schedule step of the Basic Flow.
…
Subflows
1. Select Courses.
1.1 The system retrieves a list of available course offerings from the Course
Catalog System and displays the list to the student.
1.2 The Student selects up to 4 primary course offerings and 2 alternative
course offerings from the list of available offerings.
1.3 The student can add and delete courses as desired until choosing to submit
the schedule.
47 48
12
@Nguyễn Thị Thu Trang, [email protected] 49 @Nguyễn Thị Thu Trang, [email protected] 50
49 50
52
51 52
13
53 @Nguyễn Thị Thu Trang, [email protected] 54
Partitions Preconditions
u Each partition should Sales Fulfillment • Describe the state that the system must be in before the use case can
start
represent a responsibility • Simple statements that define the state of the system, expressed as
Determine
for part of the overall Need conditions that must be true
• Should never refer to other use cases that need to be performed prior to
workflow, carried by a part this use case
of the organization.
Take Order
• Should be stated clearly and should be easily verifiable
• Optional: Use only if needed for clarification
u A partition may eventually • Example
be implemented by an Setup Payment
Fill Order Register for Courses use case
53 54
@Nguyễn Thị Thu Trang, [email protected] 55 @Nguyễn Thị Thu Trang, [email protected] 56
55 56
14
@Nguyễn Thị Thu Trang, [email protected] 57
• Extension points
2. Use case diagram
• Name a set of places in the flow of events where extending behavior 3. Use case specification/scenario
can be inserted
• Additional information 4. Glossary
• Any additional information required to clarify the use case
5. Supplementary Specification
58
57 58
59 60
59 60
15
61 62
2. Definitions
The glossary contains the working definitions for the key concepts in the
Course Registration System.
Glossary
Glossary 2.1 Course: A class offered by the university.
2.2 Course Offering: A specific delivery of the course for a specific
semester – you could run the same course in parallel sessions in the semester.
Includes the days of the week and times it is offered.
2.3 Course Catalog: The unabridged catalog of all courses offered by the
university.
61 62
63 64
63 64
16
65 66
65 66
67
Checkpoints: Actors
Case study: Supplementary Specification
• Have all the actors been identified?
• Make the Supplementary Course
Registration • Is each actor involved with at least
Specification for the Course
Registration System
Requirements one use case?
Document
• Is each actor really a role? Should
any be merged or split?
• Do two actors play the same role in
relation to a use case?
• Do the actors have intuitive and
descriptive names? Can both users
and customers understand the
names?
Supplementary
Specification
67 68
17
Checkpoints: Use-Cases Checkpoints: Use-Case Model
• Is the Use-Case Model
• Is each use case involved with at least understandable?
one actor? • By studying the Use-Case Model,
• Is each use case independent of the can you form a clear idea of the ...
69 70
72
71 72
18
73 74
Review Question?
• What are the main artifacts of Requirements?
• What are the Requirements artifacts used for?
• What is a Use-Case Model?
• What is an actor?
• What is a use case? List examples of use case properties.
• What is the difference between a use case and a scenario?
• What is a Supplementary Specification
and what does it include?
• What is a Glossary and what does
it include?
73 74
19