https://github.com/tedyoung/expense-report-template
The Expense Report legacy code refactoring kata (adapted from https://github.com/christianhujer/expensereport).
https://github.com/tedyoung/expense-report-template
Last synced: about 1 year ago
JSON representation
The Expense Report legacy code refactoring kata (adapted from https://github.com/christianhujer/expensereport).
- Host: GitHub
- URL: https://github.com/tedyoung/expense-report-template
- Owner: tedyoung
- Created: 2023-03-12T00:31:59.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2023-09-05T00:36:55.000Z (almost 3 years ago)
- Last Synced: 2025-03-08T02:04:52.620Z (over 1 year ago)
- Language: Java
- Size: 4.88 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Expense Report Kata
This is the Java-only version of the kata from https://github.com/christianhujer/expensereport.
The relevant parts of the README are below.
## Changes I (Ted aka jitterted) Made
I've updated it to the latest JUnit, added the AssertJ assertion library, and bumped the Java version to 17.
I also split the classes/enums into separate files and added a starter test method.
## Commit Notation
You might try using Arlo Belshee's Commit Notation and make the smallest commits you can.
See https://github.com/RefactoringCombos/ArlosCommitNotation/blob/main/Learning%20Path.md on how to get started.
----
# ExpenseReport
The ExpenseReport legacy code refactoring kata in various languages.
This is an example of a piece of legacy code with lots of code smells.
The goal is to support the following new feature as best as you can:
* Add Lunch with an expense limit of 2000.
## Process
1. ๐ Read the code to understand what it does and how it works.
2. ๐ฆจ Read the code and check for design and code smells. Make a list of all code and design smells that you find.
3. ๐งโ๐ฌ Analyze what you would have to change to implement the new requirement without refactoring the code.
4. ๐งช Write a characterization test. Expand your list of code and design smells. Add those smells that you missed earlier and discovered now because they made your life writing a test miserable.
5. ๐ง Refactor the code.
6. ๐ง Refactor the test.
7. ๐ผ Test-drive the new feature.
## Other plans
- Make sure that all languages are providing the identical challenge.
To be practical, this will require the removal of the timestamp side-effect.
- Provide the time-stamp side-effect on a separate branch.
- Provide a test setup (without test) on a separate branch so that folks can choose whether they want to include the setup work in the kata or not.
- Provide a level 2 challenge for creating an HTML report besides the Plain Text report.
## Credits
I first encountered the ExpenseReport example during a bootcamp at Equal Experts.
I also have seen the ExpenseReport example being used by Robert "Uncle Bob" C. Martin.
However, he seems to not be the original author (https://twitter.com/unclebobmartin/status/1537063143326855176?s=20&t=lh_vVb9jUQmY6PYG50974w)
I have tried to research its origins but so far I have failed.
If you know who has first come up with this example, please get in touch with me.