CSE Roadmap

Core tier · about 4 hours · 6 parts

Part 2 of 6 · 1 min read

Requirements

Sessions, limits and what can fail.

Think of a bank counter, with a clerk replaced by a machine. The clerk would check your identity, check your balance, count out notes and only then write the withdrawal in the ledger. The machine must keep that order, or it may write a withdrawal for notes it never counted out.

Questions and the answers assumed here:

  1. What can a customer do? Insert a card, enter a PIN, see the balance, withdraw cash, and take the card back.
  2. How many PIN tries? Three. After three failures the card is blocked and kept.
  3. Which notes? 500, 200 and 100, with a limited number of each (made up).
  4. Which amounts are allowed? Multiples of 100, up to 20,000 per withdrawal and 40,000 per day (made up).
  5. Who knows the PIN and the balance? The bank, not the machine. The machine asks it.
  6. Out of scope: deposits, transfers, receipts, and the network between machine and bank.

The numbered requirements:

  • R1. A customer signs in with a card and a PIN. Three wrong PINs block the card.
  • R2. Only a signed-in customer can see a balance or withdraw.
  • R3. A withdrawal must be a multiple of 100, within the per-transaction and daily limits, and within the balance.
  • R4. The machine pays with the notes it has. If it cannot make the amount, it refuses.
  • R5. The account is charged only if the cash is actually dispensed.
  • R6. Ejecting the card ends the session.

The nouns are card, PIN, account, bank, note, dispenser, session and limit. The verbs are insert, verify, withdraw, dispense and eject.

Check yourself: 1. How many wrong PINs block a card? 2. Which requirement protects the customer from a jam? 3. Who owns the PIN: the machine or the bank?