Professional Documents
Culture Documents
Writing Use Case Descriptions - Revisited: Materials Taken Directly From Kurt Bittner and Ian Spence
Writing Use Case Descriptions - Revisited: Materials Taken Directly From Kurt Bittner and Ian Spence
Descriptions - Revisited
PIN …
Now, see how this changes the flow of events:
Evolving Flow of Events
1. The use case starts when the Customer inserts the automated
bank card
2. The system reads the bank card and obtains the bank number,
the account number, and the Personal information Number (PIN).
The system requests the Customer to enter the (PIN). The PIN can
be up to six numbers in length and must not include any repeated
digits.
3. The system queries the Customer’s bank to ensure that the
Customer’s account is active at the financial institution identified by
the inter-bank number.
4. The system prompts the Customer for the identification number,
which the Customer enters.
5. The system validates the number entered by the Customer
with the number read from the card. (Note: Alternate flows
describing how to handle errors would be described below).
6. The system prompts the customer to enter the amount of the
withdrawal.
7. The system indicates that the amount entered must be a
multiple of $5. (Assume for the moment that this system allows
only withdrawals and that the Customer has only one account.)
8. The Customer enters the desired amount.
ETC
In retrospect…
Don’t have to define these terms when we
write the next use case.
If relationships exist between the concepts
in the glossary, a domain model can be used…
The domain model would include definitions of
things like customer, accounts, account types,
etc. as the use cases are expanded to provide
functionality that exercised these concepts.
Domain Model should never exist on its own,
but rather should be used to augment the use-
case descriptions (at least in the context of use
case modeling)
Managing the Detail of a Use Case
- Writing “Named” Subflows
Very important behaviors – but perhaps that are not essential to
understanding the basic flow of events.
In Withdraw Cash:
4. The system prompts the Customer for PIN
5. The Customer enters the PIN
6. The system validates the entered PIN with the PIN read
from the card.
These steps perform an essential function – validating the
customer – but the details start to get in the way.
Will have many such groups of steps that can be isolated, given
a name, and moved into sections on their own.
Called: named subflows, and are presented at the end of the
Basic Flow in a section of the use case called Subflows.
SubFlow Designation
Give subflow an active name and a number.
E.g S1. Authenticate Customer not
S1. Customer Authentication…
Consider the Basic Flow ‘segment’
1. The use case begins when the actor Customer
inserts the bank card.
2. The system reads the bank card information from
the card
3. Perform Authenticate Customer
4. the system prompts the Customer to enter the
amount of the withdrawal.
(The remainder of the use case has been deleted for
purposes of brevity) - and the Sub Flows:
The Subflows themselves
S2. Assess Funds on Hand
1. The system determines whether it has
sufficient funds on hand to dispense the
requested amount.
A. The system checks to see if the total amount
requested is greater than the amount on hand.
B. The system checks to see if the requested
amount can be dispensed with the denominations
on hand. (Note that it is spossible to have
sufficient funds in total and still be unable to
dispense funds; consider the case where the
Customer has requested $35 but the system only
has $40 in the form of two $20 bills.)
2. Resume at the next step
One more…
S3. Conduct Withdrawal
1. The system contacts the financial institution to see if
the Customer has sufficient funds in the account.
2. The system begins a transaction with the
Customer’s bank and requests to withdraw the amount
requested plus the transaction fee from the Customer’s
account.
3. The amount of the transaction fee is transferred to
the organization owning the system.
4. The system closes the transaction with the
Customer’s bank.
5. Resume at the next step.
Revisited Basic Course of Events
Use Case – Withdraw Cash (refined, incorporating glossary terms)
1. The use case begins when the actor Customer inserts the bank card.
2. The system reads the bank card information from the card.
3. Perform Authenticate Customer
4. The system prompts the Customer to enter the amount of the
withdrawal. (Assume for the moment that this system allows only
withdrawals and that the Bustomer has only one account.)
5. The system indicates that the amount entered must be a multiple of $5.
6. The Customer enters the desired amount.
7. Perform Assess Funds on Hand
8. Perform Conduct Withdrawal
9. The system then dispenses the requested amount to the Customer
10. The system records a log entry for the transaction
11. The Customer’s banking card is ejected.
12. The use case ends when the Customer takes the bank card from the
machine.
More…
Notice the creation of a few named subflows:
Simplifies the description of the main flow
Given coherent meaning to several groups of steps –
making them more understandable.
Use Case is simpler, more readable, and yet at the
same time – more detailed.
Can actually recognize that a subflow will be
necessary and merely ‘name’ them in the basic flow
– and construct them later.
Great for repetitive descriptions with same use case.
Now, one more step:
Writing optional, alternative, and exception flows…
Managing the Detail of a Use Case
Writing Optional, Alternative, and Exception Flows
Optional, alternative, and exception flows are flows of
events that occur when something other than the normal
course of events has occurred..
They are really all the same thing.
Optional flows implies that behavior is optional and doesn’t
always need to be performed
Alternative flows imply some sort of alternate decision is
taken, and
Exception flows imply that something other than the
ordinary has occurred.
In ALL cases, we need to describe what happens when
something occurs at a particular point in the use case.
Can be done in line if alternate steps are few, and short,