retro for Practice: Object Calisthenics + TDD + Advent of Code
Small retro (end of part 1) How did it feel?
- This was hard to answer in the moment, because I was feeling really lethargic, so everything felt that way
What went well & should do more of?
- Even though I was feeling lethargic, the flow was still there
- Using specific lombok annotations (@AllArgsConstructor and sometimes @EqualsAndHashCode), instead of catch-all (@Value)
- use smaller scope tests, so they fail for only 1 reason
Big retro (end of part 2) Were my expectations correct? 1) Object Calisthenics is sufficient for TDD’s Refactor step. No other refactors are needed.
2) The change-over from part 1 to part 2 will be seamless, not breaking the flow of coding. I did the quick rename of the tests with the new information from part 2. It took a few seconds at most.
The flow did stutter a bit. The easiest way to implement the change, red -> green, was not that easy. I wasn’t really able to apply Pattern: Fake it until you make it well here. It was a case where Pattern: Make the change easy. Then make the easy change. would have worked marvellously. Even when seeing the problem, I could see that it would be really easily solved with inheritance. But I forced myself to add an if instead to get to green asap. But even the if was quite a bit of work. Mainly because I needed to go deeper into the call stack, to make the needed change on an object there. It felt quite messy… Maybe that messiness is how TDD always would be if I just randomly picked a test. Instead, I select a test that
- adds new functionality
- would require only a small change
But this new functionality, didn’t do that. Maybe I chose a suboptimal first test case…
How did it feel?
- enlightening, I learned quite a few new things
What went well & should do more of?
- wrap booleans in enums
- make tests only fail for one reason
- Pattern: Fake it until you make it