Skip to content

Commit 2cf8ab7

Browse files
committed
add the design.md for the calculator-conundrum
1 parent 180525c commit 2cf8ab7

File tree

1 file changed

+15
-0
lines changed
  • exercises/concept/calculator-conundrum/.meta

1 file changed

+15
-0
lines changed

exercises/concept/calculator-conundrum/.meta/design.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,18 @@
1818

1919
- `conditionals-if`: know how to do conditional logic.
2020
- `switch-statement`: know how to work with a `switch` statement.
21+
22+
## Analyzer
23+
24+
This exercise could benefit from the following rules in the [analyzer]:
25+
26+
- `essential`: Verify that the solution is using the try catch statement for the division
27+
- `essential`: Verify that the solution is throwing an exception if the parameter "operation" is null
28+
- `essential`: Verify that the solution is throwing an exception if the parameter "operation" is empty
29+
- `essential`: Verify that the solution is throwing an exception if the parameter "operation" is not a mathematical operation.
30+
- `actionable`: If the solution is wrapping all the code in a try catch statement, instruct the student to only use the try catch for the division statement
31+
- `actionable`: If the solution uses only `if` statement, instruct the student that he/she can use the `switch case` statement also.
32+
- `informative`: If the solution does not throw the exception for `Operation cannot be null` and `Operation cannot be empty` at the beginning, instruct the student to do so
33+
Explain that it is better to fail fast, and it will make the code less error-prone and more readable. Check https://martinfowler.com/ieeeSoftware/failFast.pdf
34+
35+
[analyzer]: https://github.com/exercism/java-analyzer

0 commit comments

Comments
 (0)