Starter solution for refactoring exercises
Exercise to modify some legacy code: We have a new request to support "Conjured" items that degrade in Quality twice as fast as normal items
- Read the requirements
- Add tests before you make any changes
- Refactor
- Add tests for the new requirement
- Make the change to support the new requirement
Exercise to modify some legacy code: We have a new request to support lunch expenses with a limit of 2000
- Try to understand the code
- Add tests to help you understand it and make changes safe
- Why is it hard to test this code?
- Refator to make the code easier to test
- Why is this code hard to change?
- Refactor to make the code easier to change
- Add tests for the new case
- Add the logic for the new case
- Anything else we can improve on?
Exercise to test legacy code: TripService returns trips of a user's friend.
- Add tests to help you understand the code
- Why is it hard to test this code?
- Refator to make the code easier to test - You cannot change the existing method signature
- Add tests
- Refactor to make the code cleaner
Katas are modified versions of
- Emily Bache's Gilded Rose kata
- Christian Hujer's Expense Report kata
- Sandro Mancuso's Trip Service kata