From c85ce91a08a602c93663b73e5dab450f0f0df5c4 Mon Sep 17 00:00:00 2001 From: Sarah Ashri Date: Wed, 13 Mar 2024 11:55:42 +1000 Subject: [PATCH] Add RefactoringDiary to document my refactoring journey --- csharpcore/GildedRose/RefactoringDiary.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 csharpcore/GildedRose/RefactoringDiary.md diff --git a/csharpcore/GildedRose/RefactoringDiary.md b/csharpcore/GildedRose/RefactoringDiary.md new file mode 100644 index 00000000..50585b6c --- /dev/null +++ b/csharpcore/GildedRose/RefactoringDiary.md @@ -0,0 +1,18 @@ +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: +1. 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. +2. 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 + + +