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

Three Rules of Test-Driven-Development

The Three Rules of TDD are simple: Write no production code until you have a failing test. Write only enough tests to fail. Write only enough production code to pass. When builders follow this discipline, their work is verifiable every minute. Small, frequent checks catch errors early and keep risk manageable. TDD is the balance sheet that helps us avoid catastrophes. Discussions for your team Which high-risk parts of our software would benefit from requiring strict TDD? In which areas of our software are we resisting writing tests first, and why? What tooling would make TDD easier?

2025 June 11