Skip to content

Commit fe96f3c

Browse files
committed
docs: add bank-account design.md
1 parent a606586 commit fe96f3c

File tree

1 file changed

+15
-0
lines changed
  • exercises/practice/bank-account/.meta

1 file changed

+15
-0
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Design
2+
3+
## Analyzer
4+
5+
This exercise could benefit from the following rules in the [analyzer](https://github.com/exercism/java-analyzer):
6+
7+
- `essential`: Verify that the solution **guards `deposit`, `withdraw`, and `getBalance` with `synchronized`** to avoid
8+
race conditions.
9+
- `essential`: Verify that the solution **checks the account’s open/closed state before every balance operation**
10+
- `essential`: If the solution **allows negative amounts** in `deposit` or `withdraw`, instruct the student to reject
11+
them early.
12+
- `essential`: If the solution **does not throw an exception when `amount` exceeds `balance` during withdrawal**,
13+
instruct the student to add this check.
14+
- `actionable:`: If the solution **declares zero or more than one `boolean`/`Boolean` field to track account state**,
15+
instruct the student to use exactly one such field.

0 commit comments

Comments
 (0)