Professional Documents
Culture Documents
Use Case
Use Case
21
4/11/13
2 ways of wri.ng use case documenta.on for withdraw, deposit and approval process
Approach
1:
Write
use
case
documenta5on
for
withdraw
&
deposit
only
Use-Case:
UC-002:
Withdraw
Cash
Brief
Descrip5on
This
use
case
describes
how
the
Bank
Client
uses
the
ATM
to
withdraw
money
from
his
bank
account.
Actors:
Bank
Client
Precondi5ons:
There
is
an
ac.ve
network
connec.on
to
the
Bank.
The
ATM
has
cash
available
4/11/13
Normal Flow: 1. The use case begins when Bank Client inserts their Bank Card. 2. The ATM reads the code from the magne.c strip of the Bank Card and checks with the Bank to see if it is an acceptable Bank Card. The Bank conrms the card is valid. If the card is invalid, Alterna.ve ow 1 is performed. If there is no response from the Bank within 3 seconds, Alterna.ve ow 4 is performed. 3. The ATM asks for the Bank Client PIN code (4 digits). 4. The Bank Client enters a PIN code. If there is no response from the Bank Client within 15 seconds, Alterna.ve ow 5 is performed. 5. The ATM validates the PIN code with the Bank. The Bank conrms the PIN is valid. If the PIN code is invalid for the rst and second .me, Alterna.ve ow 2 is performed. If the PIN code is invalid for the third .me, Alterna.ve ow 3 is performed. If there is no response from the Bank within 3 seconds, Alterna.ve ow 4 is performed. : : :
Alterna.ve Flow: 1. Not a valid card The ATM shall display a Sorry not a valid card message and return the card. The use case ends with an indica.on of the failure. 2. Wrong PIN code (1st. and 2nd .me) The ATM shall display a Sorry invalid PIN code message. The use case resume at Normal ow 3. 3. Wrong PIN code (3rd. .me) The ATM shall display a Sorry invalid PIN code Please contact your branch message. The card is kept by the ATM and a receipt is printed telling how and where to get a new card. The use case ends with an indica.on of the failure.
4/11/13
Post-Condi.ons
Successful
Comple.on
The
user
has
received
their
cash
and
the
internal
logs
have
been
updated.
Failure
Condi.on
The
logs
have
been
updated
accordingly.
Approach
2:
Write
use
case
documenta5on
for
withdraw,
deposit
&
validate
user
Use-Case:
UC-001:
Validate
User
Brief
Descrip5on
This
use
case
describes
general
behaviour
for
the
ATM
to
validate
the
user.
It
includes
all
steps
that
are
the
same
no
ma]er
what
kind
of
transac.on
the
Bank
Client
does.
Actors:
Bank
Client
Precondi5ons:
There
is
an
ac.ve
network
connec.on
to
the
Bank.
4/11/13
Normal Flow: The use case begins when Bank Client inserts their Bank Card. The ATM reads the code from the magne.c strip of the Bank Card and checks with the Bank to see if it is an acceptable Bank Card. The Bank conrms the card is valid. If the card is invalid, Alterna.ve ow 1 is performed. If there is no response from the Bank within 3 seconds, Alterna.ve ow 4 is performed. The ATM asks for the Bank Client PIN code (4 digits). The Bank Client enters a PIN code. If there is no response from the Bank Client within 15 seconds, Alterna.ve ow 5 is performed. The ATM validates the PIN code with the Bank. The Bank conrms the PIN is valid. If the PIN code is invalid for the rst and second .me, Alterna.ve ow 1.2 is performed. If the PIN code is invalid for the third .me, Alterna.ve ow 1.3 is performed. If there is no response from the Bank within 3 seconds, Alterna.ve ow 4 is performed. The ATM displays the dierent alterna.ves that are available on this unit. : :
Alterna5ve Flow: 1. Not a valid card The ATM shall display a Sorry not a valid card message and return the card. The use case ends with an indica.on of the failure. 2. Wrong PIN code (1st. and 2nd .me) The ATM shall display a Sorry invalid PIN code message. The use case resume at Normal ow 3. 3. Wrong PIN code (3rd. .me) The ATM shall display a Sorry invalid PIN code Please contact your branch message. The card is kept by the ATM and a receipt is printed telling how and where to get a new card. The use case ends with an indica.on of the failure. : :
4/11/13
Post-Condi5ons
Successful
Comple.on
The
user
is
validated
and
may
con.nue
with
the
specic
transac.on
Failure
Condi.on
The
ATM
shall
log
the
event
including
the
reason
for
the
failure.
Special
Requirements
Related
Use
Cases
UC-002:
Withdraw
Cash
UC-003:
Deposit
Cash
This
part
is
to
show
which
use
case
will
use
this
use
case
Use-Case: UC-002: Withdraw Cash Brief Descrip5on This use case describes how the Bank Client uses the ATM to withdraw money from his bank account. This statement just Actors: Bank Client call all the process Precondi5ons: inside the Validate There is an ac.ve network connec.on to the Bank. User. So, we dont The ATM has cash available need to respecify the process. Normal Flow: The use case begins when Bank Client inserts their Bank Card. Use Case: UC-001: Validate User is performed. If the use case does not complete successfully, AlternaCve ow 1 is performed. The ATM displays the dierent alterna.ves that are available on this unit. In this case, the Bank Client select Withdraw Cash. : :
4/11/13
Alterna5ve Flow: 1. Invalid User The use case ends with a failure condi.on. Post-Condi5ons Successful Comple.on The user has received their cash and the internal logs have been updated. Failure Condi.on The logs have been updated accordingly. Special Requirements Use Case Extensions This part is to show the UC-001: Validate User <<includes>> rela.on between the use cases.
Sequence
Diagram
Represents
the
sequence
and
interac.ons
of
a
given
use
case
or
scenario.
Steps:
1. Iden.fying
classes
in
a
scenario.
2. Iden.fying
interac.ons
between
class
3. Iden.fying
stereotype
of
the
class.
34
4/11/13
Normal Flow: a. The use case begins when Bank Client inserts their Bank Card. b. The ATM reads the code from the magne.c strip of the Bank Card and checks with the Bank to see if it is an acceptable Bank Card. The Bank conrms the card is valid. If the card is invalid, Alterna.ve ow 1 is performed. If there is no response from the Bank within 3 seconds, Alterna.ve ow 4 is performed. c. The ATM asks for the Bank Client PIN code (4 digits). d. The Bank Client enters a PIN code. If there is no response from the Bank Client within 15 seconds, Alterna.ve ow 5 is performed. e. The ATM validates the PIN code with the Bank. The Bank conrms the PIN is valid. If the PIN code is invalid for the rst and second .me, Alterna.ve ow 2 is performed. If the PIN code is invalid for the third .me, Alterna.ve ow 3 is performed. If there is no response from the Bank within 3 seconds, Alterna.ve ow 4 is performed. f. The ATM displays the dierent alterna.ves that are available on this unit. In this case, the Bank Client select Withdraw Cash. g. The ATM prompts for an account. h. The Bank Client selects an account.
i. The ATM prompts for an amount. j. The Bank Client enters an amount. k. Money is dispensed. l. The Bank Card is returned. m. The receipt is printed. Alterna5ve Flow: 1. Not a valid card a. The ATM shall display a Sorry not a valid card message and return the card. b. The use case ends with an indica.on of the failure. 2. Wrong PIN code (1st. and 2nd .me) a. The ATM shall display a Sorry invalid PIN code message. b. The use case resume at Normal ow 3. 3. Wrong PIN code (3rd. .me) a. The ATM shall display a Sorry invalid PIN code Please contact your branch message. b. The card is kept by the ATM and a receipt is printed telling how and where to get a new card. c. The use case ends with an indica.on of the failure.
4/11/13
37
38
4/11/13
39
If
dierent
words
are
being
used
to
describe
the
same
idea,
we
must
select
the
one
that
is
the
most
meaningful
in
the
context
of
the
system
and
eliminate
the
others.
Client,
Bank
Client
=
Bank
Client
(the
term
chosen)
40
10
4/11/13
41
42
11
4/11/13
43
12
4/11/13
45
13
4/11/13
47
48
14
4/11/13
49
15