Glided Rose Refactoring by Tom Truyen
- Write Unit Tests for existing code to make sure nothing breaks
- Looking at code, noticing multiple types of items all with different logic
- Extract logic to an Item specific class
- Abstract the code by making an interface/base class to define what an "ItemUpdater" should look like
- Create a list (enum) of possible item types
- Create a Factory to create an instance of the correct Item specific class based on the input
- Write tests for new code
- Implement new code
- Run
TextTestFixture.kt
For e.g. 10 days:
./gradlew run --args 10