Refactoring is a Habit, Not a Calendar Item

Refactoring is a continuous habit, not a calendar item. Don’t pile up a week’s worth of mess and then try to schedule a day to clean it all up. Instead, after getting the code working, immediately follow up with a quick tidy-up refactoring focus, so the mess never grows. This makes refactoring part of how we do software development, not an extra chore to deal with at some later time. ...

2025 June 20

Green then Refactor

Writing code that works and writing code that is clean are two different dimensions. Trying to perfect both at once is exhausting and slow. Instead, get it working first and the tests passing, by whatever means. Then clean and refactor the code. Discussions for your team what does “clean” mean for your codebase? Once we validate that the tests work, are we spending enough time and effort into refactoring? How much of time is spent getting the code to “work”, versus cleaning and refactoring? What guardrails are in place to make sure the cleaning/refactoring step isn’t skipped?

2025 June 19

Refactor with Tests

Refactoring is the practice of improving the code’s structure without changing its behavior. And the only way to do that safely is a robust test suite. When tests are present, small renames, splitting large functions, extracting classes, inverting dependencies, and moving modules around become low-risk activities. Tests let us reshape architecture while keeping behavior intact. That confidence is why refactoring pairs so well with test-first practices: tests become the specification you can rely on during change. ...

2025 June 18