• Aucun résultat trouvé

TD2: Use Cases and State Machines

N/A
N/A
Protected

Academic year: 2022

Partager "TD2: Use Cases and State Machines"

Copied!
5
0
0

Texte intégral

(1)

Master2 TSM January 2009

TD2: Use Cases and State Machines

1 ATM Specifications

ATM = Automatic Teller Machine

ATM offers the following services:

1. Distribution of money to every holder of a smartcard via a card reader and a cash dispenser.

2. Report of account balance, cash and checks deposit facilities for bank customers who hold a smartcard from their bank.

3. All transactions are made sure.

4. The dispenser has to be refilled from time to time.

Abbreviations used in this text:

• CardHolder = Visa Card holder

• BankCustomer = Bank customer who holds a smartcard from his/her bank

• VisaAS = Visa Authorization System

• BankIS = Bank Information System

2 Example of Use Case Specification

2.1 Withdraw money using a Visa card

Summary: This use case allows a Visa card holder, who is not a customer of the bank to withdraw money if his/her daily limit allows it.

1. The Visa CardHolder inserts his/her smart card in the ATM’s card reader.

2. The ATM verifies that the card that has been inserted is a smartcard.

3. The ATM asks the Visa CardHolder to enter his/her pin number.

4. The Visa CardHolder enters his/her pin number.

5. The ATM compares the pin number with the one that is encoded on the chip of the smartcard.

6. The ATM requests an authorization from the Visa authorization system

7. The Visa authorization system confirms its agreement and indicates the daily withdrawal limit.

8. The ATM asks the Visa CardHolder to enter the desired withdrawal amount.

9. The Visa CardHolder enters the desired withdrawal amount.

10. The ATM checks the amount against the daily withdrawal limit.

11. The ATM asks the Visa CardHolder if he/she would like a receipt.

12. The Visa CardHolder requests a receipt.

13. The ATM returns the card to the Visa CardHolder.

14. The Visa CardHolder takes his/her card.

15. The ATM issues the banknotes and a receipt.

16.

The Visa CardHolder takes the banknotes and the receipt.

Variations: Temporarily incorrect pin number

• At step 5, the Visa CardHolder fails to enter a correct pin number

• 6. The ATM informs the CardHolder that the pin is incorrect for the first or second time.

• 7. The ATM records the failure on the smartcard.

• The scenario goes back to step 3.

Variations: The amount requested is greater than the daily withdrawal limit

Variations: The Visa CardHolder does not want a receipt

(2)

2.2 Withdraw money using a Bank card

Similar to Withdrawal using a Visa card

1. The Bank customer inserts his/her smart card in the ATM’s card reader.

2. The ATM verifies that the card that has been inserted is a smartcard.

3. The ATM asks the Bank customer to enter his/her pin number.

4. The Bank customer enters his/her pin number.

5. The ATM compares the pin number with the one that is encoded on the chip of the smartcard.

6. The ATM requests an authorization from the Bank information system 7. The BankIS confirms its agreement and indicates the daily withdrawal limit.

8. The ATM asks the Bank customer to enter the desired withdrawal amount. Extension point:

verify amount.

9. The Bank customer enters the desired withdrawal amount.

10. The ATM checks the amount against the daily withdrawal limit.

11. The ATM asks the Bank customer if he/she would like a receipt.

12. The Bank customer requests a receipt.

13. The ATM returns the card to the Bank customer.

14. The Bank customer takes his/her card.

15. The ATM issues the banknotes and a receipt.

16.

The Bank customer takes the banknotes and the receipt.

3 Use Case Diagram

3.1 Relationships

Complete the Use Case diagram Figure 1. Justify your choice for the best relationship (associations, generalization, include, extend).

(3)

VisaCardHolder

Withdraw money with a

Visa card

VisaAS

BankCustomer

BankIS Withdraw

money with a bank card

Consult balance

Deposit money

Deposit cash Deposit checks

Authenticate

Maintenance operator Refill dispenser

Retrieve swallowed cards

Retrieve cheques ATM

Figure 1: ATM Use Case Diagram

3.2 Use Case Specification

Give a textual specification for each use case.

3.3 Papyrus modeling

Use Papyrus to model ATM.

4 Class Diagram

(4)

Figure 2: Class diagram of the ATM

Signals are specified by a signal object, whose type represents the kind of message transmitted between objects, and can be dynamically created. The receipt of signals may be bound to activities, state machine transitions, or other behaviors.

5 State machines

CardEntry

PINEntry Verification AmountEntry

ReturningCard abort

/ bank.verifyPIN()

reenterPIN

PINVerify

Counting

Dispensing Giving Money

/ bank.done ATMClass_SM

Figure 3: State machine for class ATM

(5)

Idle done

verifyPIN()

VerifyingCard [cardValid] CardValid [else] / atm.abort

VerifyingPIN

entry/ numCorrect=0 PINCorrect

PINIncorrect /atm.PINVerified [else]/cardValid=false;atm.abort

[numIncorrect,maxNumIncorrect] / numIncorrect++;atm.reenterPIN

Verifying BankClass_SM

Figure 4: State machine for class Bank

5.1 Behavior

Justify the state machines in Figure 3 and Figure 4.

Analyze interactions.

Represent some possible interactions with Communication diagrams Represent some possible interactions with Sequence diagrams.

5.2 Modifications

The specification is modified:

• The transaction can be canceled at each instant by depressing a Cancel button.

• After three incorrect PIN code, the card is swallowed by the ATM

Modify the class diagram (add signals), the interaction diagrams, and the state machines to respect the new specification.

5.3 Experimentation

Model the ATM using Papyrus.

Références

Documents relatifs

19.1 La fourniture d’une carte de débit (carte de paiement internationale à débit immédiat), la fourniture d’une carte de débit (carte de paiement international à

X carried out his/her internship at Y company where he/she performed to full satisfaction, once again demonstrating the organisational, interpersonal and

Also, use this command (or the DISKCOPY utility) periodically to make backup copies of often used diskettes. Refer to the MS-DOS System User's Guide for further

These are the ability to encrypt and decrypt data crossing the card interface, the ability to hold the data stored on the card in a secure manner, and the ability to process the

It is meant to provide an overview of the features and benefits of the insurance coverage (“Coverage”) provided with the Visa* Business Advantage card, Visa* Corporate card and

of the Insured Items, not exceeding the full cost charged to Your Cash Back credit card and/or paid for with Your

This method for the link-local scope is preferred over unicast- prefix-based IPv6 multicast addresses [RFC3306], since by delegating multicast addresses using the IID, each

We will roll up our sleeves and work with other provinces and the federal government to protect and improve universal health care in BC and across Canada.. My government believes