BankLab — the rubric

How the finished BankLab, A12, is assessed: four rows, each scored from 1 to 4. The same four rows are what A9 to A11 build toward.

BankLab is a bank server, built over four assignments, A9 to A12. Clients connect over the network and send text commands, REGISTER, LOGIN, BALANCE, DEPOSIT, WITHDRAW, TRANSFER and HISTORY. Each client is served on its own thread, and accounts and their history are kept in a database, so they survive a restart of the server. The protocol, with every error each command must handle, is the set of requirements.

The finished project, A12, is scored on the four rows below, each from 1 to 4. The total, out of 16, is A12’s mark, scaled to its points. The same scores are part of the department’s accreditation report, which is why they are written down here in advance. One mistake lowers one row: a lost update under load is scored under concurrency, and not again under requirements.

1. Requirements met

The finished server does what the protocol says, for the success cases and the error cases alike. The evidence is the 22 functional checks of the grading script, run against A12.

  • 4, Excellent. 20 to 22 checks pass, among them “state persists after the server is restarted”.
  • 3, Good. 16 to 19 checks pass.
  • 2, Marginal. 10 to 15 checks pass.
  • 1, Unsatisfactory. Fewer than 10 pass, or the server does not start.

2. Design

The project is divided into parts with one job each, so that changing one part does not ripple through the rest. The evidence is the code of A12, and its history across A9, A10 and A11.

  • 4, Excellent. Handling the protocol, the bank’s rules and storing the data are separate parts. The bank in memory from A9 was replaced by the database of A11 without rewriting the server. Each rule (no negative balance, no partial transfer, no transfer to oneself) is enforced in exactly one place.
  • 3, Good. The parts are mostly separate, with one lapse: a rule checked in two places, or one part reaching into another’s insides.
  • 2, Marginal. The bank’s rules are mixed into the code that handles requests, and moving to the database meant rewriting large parts of the server.
  • 1, Unsatisfactory. No visible structure: one class does everything, or every command repeats the rules.

3. Concurrency and the money

The server stays correct while many clients use it at once. The evidence is the check “works with multiple clients”, a run in which many clients transfer money at once and the bank’s total is compared before and after, and reading the code that locks and the code that uses transactions.

  • 4, Excellent. No update is lost under load, and the total never changes. A transfer is all or nothing, both in memory and in the database. No deadlock. No lock is wider than the rule it protects.
  • 3, Good. Correct under load, but coarse: for example, one lock around the whole bank.
  • 2, Marginal. Serves several clients, but loses updates or leaves transfers half done when they come at once.
  • 1, Unsatisfactory. Serves one client at a time, or two clients corrupt the data.

4. Testing against the requirements

You show, with tests of your own, which requirements your project meets and which it does not. The evidence is your own JUnit tests and the README.

  • 4, Excellent. Tests cover the success case and every error case of every command, and at least one test has clients, or threads, working at once. The README says which requirement each group of tests covers, and names anything known not to work.
  • 3, Good. Tests cover most commands, with some error cases. The README names what is known not to work.
  • 2, Marginal. Tests cover success cases only, or only a few commands. The README is missing or says nothing about what does not work.
  • 1, Unsatisfactory. No tests of your own, or tests that do not run.