https://github.com/elie29/calculator-kata
simple calculator kata with spring boot and junitparams
https://github.com/elie29/calculator-kata
java kata spring spring-boot
Last synced: 2 months ago
JSON representation
simple calculator kata with spring boot and junitparams
- Host: GitHub
- URL: https://github.com/elie29/calculator-kata
- Owner: elie29
- Created: 2019-07-02T17:20:54.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2019-07-02T17:22:10.000Z (almost 7 years ago)
- Last Synced: 2025-03-18T03:43:34.573Z (over 1 year ago)
- Topics: java, kata, spring, spring-boot
- Language: Java
- Size: 3.91 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# Best practices of OO and Object Calisthenics
## SOLID
1. Single responsibility principle
2. Open/closed principle
3. Liskov substitution principle
4. Interface segregation principle
5. Dependency inversion principle
## 9 OC Rules
1. Only One Level Of Indentation Per Method
2. Don't Use The ELSE Keyword
3. Wrap All Primitives And Strings
4. First-Class Collections
5. One Dot Per Line
6. Don't Abbreviate
7. Keep All Entities Small
8. No Classes With More Than Two Instance Variables
9. No Getters/Setters/Properties
## TDD
1. Write the test
2. Make it compile
3. Watch it fail
4. Make it pass
5. Refactor
a. SOLID
b. 9 OC Rules
6. Replay test
## String Calculator Problem
> The purpose consists in a method that given a delimited string, returns the sum of the values.
### Rules
- An empty string returns zero
- A single number returns the value
- Two numbers, comma delimited, returns the sum
- Two numbers, newline delimited, returns the sum
- Three numbers, delimited either way, returns the sum
- Negative numbers throw an exception
- Numbers greater than 1000 are ignored
- A single char delimiter can be defined on the first line (e.g. //# for a ‘#’ as the delimiter)
## Run the tests
mvn clean test