More Thoughts on the Mikado Method

Even in a small refactoring, as in the previous example, it’s easy to get lost and to forget things. Building the Mikado graph helps you track where you’ve been and where you still need to go.

Working backward is an important part of the Mikado Method. The opposite, typical approach involves taking the code as it is and attempting to refactor toward a somewhat-vague end goal. You have a rough vision of what the solution should look like when you get there.

The forward approach can get you where you want to go, but its haphazard approach creates some problems. It’s easy to make a number of code changes that lead nowhere. You resist starting over, because that will require you to decipher all the steps you’ve ...

Get Modern C++ Programming with Test-Driven Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.