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's post in the "Legacy Code to Testable Code" on refactoring legacy code for unit testing and unit tests.

Legacy Code to Testable Code #3: Adding Setter 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. Other posts include: Adding accessors… Continue Reading…

Gil Zilberfeld explains refactoring legacy code for writing unit tests, thist ime about method extraction. This pattern allows to unit test and mock methods

Legacy Code To Testable Code #2: Extract Method

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 included: As with… Continue Reading…

Gil Zilberfeld explains refactoring legacy code, starting with renaming variables, methods and classes, on the way to easier writing of unit tests.

Legacy Code To Testable Code #1: Renaming

This post is part of the “Legacy Code to Testable Code” series. In the series we’ll talk about making refactoring steps before writing tests for legacy code, and how they make our life easier. Other posts include: Renaming is easy… 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…

Testability != Good Design

It’s a funny thing, code testability. It’s not really defined, or rather, it is defined poorly. If “testable code” is “code we can test”, that means all code is like that. We can test it through unit tests. If it’s… Continue Reading…

Stairway to Heaven

Whenever we learn a new skill, and go deeper, it feels like we’re climbing a stairway to mastery. A few years ago, I described how people get into unit testing, and their journey along the path, as walking up a… Continue Reading…

The Economics of Unit Testing

Unit testing is a set of skills, that rarely appears on a resume. When I saw a resume with unit testing on it, it rose up to the top of the interview queue. I understood the person who put it… Continue Reading…

Gil Zilberfeld's Everyday Unit Testing book

New Version: Test Attributes

You’ve probably seen it coming. I started a series of posts about unit test attributes here, and then went into them in details. I now morphed the series of posts into a section into the Basic Guidelines chapter. If the… Continue Reading…

Copyright Gil Zilberfeld, 2025