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

Needing to Refactor the Code to Write Tests

It happens very frequently where the team is doing “test-after” development. And they’re trying to keep the test coverage high. There often comes a point where they’re blocked from writing some tests unless they refactor the code first. This is where the thinking gets confusing. On one hand they already wrote the code, and manually test it. So they know it works. But now to write the test, they need to re-arrange the code just so they can write an automated test case for it. ...

2025 June 17

Writing Tests is a Fun Challenge

Building an automated test (before the implementation code) is a challenge, and every passing test should feel like small win. “Test driven” feels like a chain of focused fun problems to solve, the opposite of “test-after” which can feel like chores to complete. Discussions for your team How often are we doing “test-after” instead of “test-first” development? How can we make writing test-first feel more fun?

2025 June 16

Tests as a Form of Documentation

Your tests are like a special type of documentation. Because they show exactly how things actually work. They can show every API call, and every way to construct an object, and every exception that can occur. And the tests are written in the language developers can read fluently: software code! They are unambiguous, executable, and never drift out of sync with the application. Good tests are small, independent units that describe behavior. Ideally they shouldn’t be tightly coupled and rely on each other. That independence turns them into a special type of living documentation. ...

2025 June 13

Minimize Your Time in the Debugger

Spend less time chasing bugs and more time shipping value. Imagine if as you work on developing the software, you’re always working in a state where everything was worked a minute ago. Nothing has been broken for an extended amount of time. Because the development loop is so small and rapid, and always giving you feedback that you’re hardly ever in a situation where you need to start up debugging tools. ...

2025 June 12