From fe96f3cd197f8572d2f712771054d303bc32a629 Mon Sep 17 00:00:00 2001 From: masiljangajji Date: Thu, 29 May 2025 23:31:34 +0900 Subject: [PATCH 1/4] docs: add bank-account design.md --- exercises/practice/bank-account/.meta/design.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 exercises/practice/bank-account/.meta/design.md diff --git a/exercises/practice/bank-account/.meta/design.md b/exercises/practice/bank-account/.meta/design.md new file mode 100644 index 000000000..e3368a7a9 --- /dev/null +++ b/exercises/practice/bank-account/.meta/design.md @@ -0,0 +1,15 @@ +# Design + +## Analyzer + +This exercise could benefit from the following rules in the [analyzer](https://github.com/exercism/java-analyzer): + +- `essential`: Verify that the solution **guards `deposit`, `withdraw`, and `getBalance` with `synchronized`** to avoid + race conditions. +- `essential`: Verify that the solution **checks the account’s open/closed state before every balance operation** +- `essential`: If the solution **allows negative amounts** in `deposit` or `withdraw`, instruct the student to reject + them early. +- `essential`: If the solution **does not throw an exception when `amount` exceeds `balance` during withdrawal**, + instruct the student to add this check. +- `actionable:`: If the solution **declares zero or more than one `boolean`/`Boolean` field to track account state**, + instruct the student to use exactly one such field. \ No newline at end of file From 7d754ce7e45e13072d653ecb34ee67064917e94d Mon Sep 17 00:00:00 2001 From: masiljangajji Date: Thu, 29 May 2025 23:43:07 +0900 Subject: [PATCH 2/4] docs: update bank-account design.md --- exercises/practice/bank-account/.meta/design.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/exercises/practice/bank-account/.meta/design.md b/exercises/practice/bank-account/.meta/design.md index e3368a7a9..fcc9d6f37 100644 --- a/exercises/practice/bank-account/.meta/design.md +++ b/exercises/practice/bank-account/.meta/design.md @@ -11,5 +11,4 @@ This exercise could benefit from the following rules in the [analyzer](https://g them early. - `essential`: If the solution **does not throw an exception when `amount` exceeds `balance` during withdrawal**, instruct the student to add this check. -- `actionable:`: If the solution **declares zero or more than one `boolean`/`Boolean` field to track account state**, - instruct the student to use exactly one such field. \ No newline at end of file +- `actionable`: Verify that the solution **declares exactly one `boolean`/`Boolean` field to track account state**; if the count is zero or greater than one, instruct the student to use exactly one such field. \ No newline at end of file From 48c514a1681455966306562e94f870cf40da4601 Mon Sep 17 00:00:00 2001 From: masiljangajji Date: Thu, 29 May 2025 23:48:32 +0900 Subject: [PATCH 3/4] docs: update bank-account design.md --- exercises/practice/bank-account/.meta/design.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/practice/bank-account/.meta/design.md b/exercises/practice/bank-account/.meta/design.md index fcc9d6f37..e42bec5a4 100644 --- a/exercises/practice/bank-account/.meta/design.md +++ b/exercises/practice/bank-account/.meta/design.md @@ -11,4 +11,4 @@ This exercise could benefit from the following rules in the [analyzer](https://g them early. - `essential`: If the solution **does not throw an exception when `amount` exceeds `balance` during withdrawal**, instruct the student to add this check. -- `actionable`: Verify that the solution **declares exactly one `boolean`/`Boolean` field to track account state**; if the count is zero or greater than one, instruct the student to use exactly one such field. \ No newline at end of file +- `actionable`: Verify that the solution **declares exactly one `boolean`/`Boolean` field to track account state**; if the count is zero or greater than one, instruct the student to use exactly one such field. From 9ee8cd9dc531b231423789bfbf454ed45cb70ff3 Mon Sep 17 00:00:00 2001 From: masiljangajji Date: Thu, 29 May 2025 23:49:42 +0900 Subject: [PATCH 4/4] docs: update bank-account design.md --- exercises/practice/bank-account/.meta/design.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/exercises/practice/bank-account/.meta/design.md b/exercises/practice/bank-account/.meta/design.md index e42bec5a4..9ad77642e 100644 --- a/exercises/practice/bank-account/.meta/design.md +++ b/exercises/practice/bank-account/.meta/design.md @@ -2,7 +2,7 @@ ## Analyzer -This exercise could benefit from the following rules in the [analyzer](https://github.com/exercism/java-analyzer): +This exercise could benefit from the following rules in the [analyzer]: - `essential`: Verify that the solution **guards `deposit`, `withdraw`, and `getBalance` with `synchronized`** to avoid race conditions. @@ -12,3 +12,5 @@ This exercise could benefit from the following rules in the [analyzer](https://g - `essential`: If the solution **does not throw an exception when `amount` exceeds `balance` during withdrawal**, instruct the student to add this check. - `actionable`: Verify that the solution **declares exactly one `boolean`/`Boolean` field to track account state**; if the count is zero or greater than one, instruct the student to use exactly one such field. + +[analyzer]: https://github.com/exercism/java-analyzer