Legacy Code to Testable Code #8: Convert If-Else’s to Guard Blocks

I know, you want to check out the rest of the series. Here are the links: Code simplification is one of the best things we can do for ourselves. If we understand the code, not only will we write simpler… Continue Reading…

Legacy Code To Testable Code #7: Introduce Parameter

You didn’t think we’ve covered everything, did you? Here’s a short reminder of what we got through: Today we’re going to talk about the Introduce Parameter refactoring pattern. This is one of the more useful patterns to clear code from dependencies. Here’s… Continue Reading…

Gil Zilberfeld's Everyday Unit Testing book

New Release: V0.05 With Pre-Test Refactorings

I know it’s been a while, but the Everyday unit testing book is not going away! I’ll try to pick up speed, while you can give me feedback on v.05 of the “Everyday Unit Testing” book. Here’s what’s new in… Continue Reading…

Gil Zilberfeld points to one of the refactoring patterns in unit testing and unit tests that makes legacy code more testable.

Legacy Code to Testable Code #6: Add Overload

This post is part of the “Legacy Code to Testable Code” series. In the series we’ll talk about making refactoring steps before writing unit tests for legacy code, and how they make our life easier. Other posts include:   In… Continue Reading…

Gil Zilberfeld points to one of the refactoring patterns in unit testing and unit tests that makes legacy code more testable.

Legacy Code to Testable Code #5: Extract Class

This post is part of the “Legacy Code to Testable Code” series. In the series we’ll talk about making refactoring steps before writing unit tests for legacy code, and how they make our life easier. Other posts include: A few… Continue Reading…

Gil Zilberfeld points to one of the refactoring patterns in unit testing and unit tests that makes legacy code more testable.

Legacy Code to Testable Code #4: More Accessors!

This post is part of the “Legacy Code to Testable Code” series. In the series we’ll talk about making refactoring steps before writing unit tests for legacy code, and how they make our life easier. It continues the last post… Continue Reading…

Gil Zilberfeld introduces a series of posts on refactoring patterns to be used in legacy code, to make it easier for writing unit tests.

Legacy Code To Testable Code: Introduction

The word “legacy” has a lot of connotations. Mostly bad ones. We seem to forget that our beautiful code gets to “legacy code“ status three days after writing it. Michael Feathers, in his wonderful book “Working Effectively With Legacy Code”… Continue Reading…

Copyright Gil Zilberfeld, 2025