140 likes | 353 Views
Small Test: Bank account manager. System has to run on an automated teller machine. User must be able to deposit checks into the account. User must be able to draw money from the account. User should be able to query the balance of his/her account.
E N D
Small Test:Bank account manager • System has to run on an automated teller machine. • User must be able to deposit checks into the account. • User must be able to draw money from the account. • User should be able to query the balance of his/her account. • The user should get a receipt for a transaction on request. The transaction type (withdrawal or deposit), the transaction date, the account number, the amount, and the new balance should be visible on the receipt. • After each transaction the new balance should be displayed to the user. CPSC 333: Foundations of Software Engineering J. Denzinger
Errors regarding arrows (connections) • connection between actors and use cases have no direction • Connections between use cases are dotted ( ) and should be labeled <<extend>> or <<include>> • <<extend>>:arrow points from use case describing the alternative event flow to the “standard” case • <<include>>:arrow points from “calling” use case to use case that describes actions to include CPSC 333: Foundations of Software Engineering J. Denzinger
Errors regarding relation graphics and description • If use cases are connected then in the textual description we have to “mirror” this: • <<include>>…- include (verify user)… • <<extend>>…- (print receipt)... CPSC 333: Foundations of Software Engineering J. Denzinger
Errors regarding textual descriptions of use cases • Preconditions not given • No connection to graphical representation • Different names in graphical and textual representation: user vs visitor use case name different bank info vs user info • But also: use case name appearing several time in diagram CPSC 333: Foundations of Software Engineering J. Denzinger
Other often occuring errors • Flow charts instead of use casesremember: use case = sequence of actions achieving a goalnot: action = use case • Exceptional flow: not only exception condition, but also actions if it occurs • Exceptional flow: indicate in main flow at which point to check for this exception (if not obvious)! CPSC 333: Foundations of Software Engineering J. Denzinger
User Good solution (1): <<extend>> (print receipt) withdraw with receipt withdraw <<include>> check balance <<include>> Verify user <<include>> deposit with receipt deposit <<extend>> (print receipt) CPSC 333: Foundations of Software Engineering J. Denzinger
Good solution (2): Use case: withdraw Precondition: User has selected withdraw option Main flow: • Include (Verify user) • Prompt user for amount to withdraw • Check available funds of user • Check available money of ATM • Remove amount from account • Give money • (print receipt) • Print current balance Exceptional flow • If not sufficient funds or money available, prompt user for lower amount CPSC 333: Foundations of Software Engineering J. Denzinger
Good solution (3): Use case: deposit Precondition: User has selected deposit option Main flow: • Include (Verify user) • Prompt user for amount of deposit • Open slot • Get check • (print receipt) • Print (balance + deposited amount) CPSC 333: Foundations of Software Engineering J. Denzinger
Good solution (4): Use case: check balance Precondition: User has selected balance option Main flow: • Include (Verify user) • Print balance CPSC 333: Foundations of Software Engineering J. Denzinger
Good solution (5)(not required in test): Use case: verify user Precondition: none Main flow: • User enters ID card • User enters PIN number • System checks validity of card and number Exceptional flow: • If combination is not valid, reject user CPSC 333: Foundations of Software Engineering J. Denzinger
Good solution (6)(not required in test): Use case: withdraw with receipt Precondition: User has selected withdraw option and print receipt option … Use case: deposit with receipt Precondition: User has selected deposit option and print receipt option ... CPSC 333: Foundations of Software Engineering J. Denzinger
User Acceptable solution (1): <<extend>> (print receipt) withdraw with receipt withdraw check balance deposit with receipt deposit <<extend>> (print receipt) CPSC 333: Foundations of Software Engineering J. Denzinger
Acceptable solution (2): Use case: withdraw Precondition: User is verified and has selected withdraw option … Similar for other use cases CPSC 333: Foundations of Software Engineering J. Denzinger