mirror of
https://github.com/emilybache/GildedRose-Refactoring-Kata.git
synced 2026-02-14 22:21:20 +00:00
1.2 KiB
1.2 KiB
This file documents my refactoring and design journey while working through in this kata.
NOTES:
- At this stage, I assume that when we're not supposed to change Item or Items, we shouldn't just ignore them and create a parallel object types to use (that include the different DailyUpdate behaviours).
- This code and requirements were simple enough that I could have created the final version, or at least a massive refactoring immediately. However, I wanted to experience and demonstrate the refactoring process by small steps that can be just as easily applied to more complex code.
My refactoring steps:
- Added full test coverage drawing from the requirements and the existing 30 days texttest test.
Some of the tests failed due to bugs I discovered in the code/existing tests (e.g. relying on exact name instead of the mentioned "code word"). I decorated these tests with[Ignore]until I get to a stage in the refactoring where I can easily fix the issues and re-introduce the tests. - small refactorings of the UpdateQuality() method to make it more readable and separate the different (unrelated) handling of the different types.
This is the state of the code now