---
title: "[Book of the month] Working effectively with legacy code"
url: "https://osherove.com/blog/2005/4/15/book-of-the-month-working-effectively-with-legacy-code.md"
canonical: "https://osherove.com/blog/2005/4/15/book-of-the-month-working-effectively-with-legacy-code.html"
published: "2005-04-15T22:51:00"
updated: "2005-04-15T22:51:00"
tags: ["Agile Related", "Recommended books"]
author: "Roy Osherove"
description: "[Note: You can find more books I found very helpful or interesting here ] It's been a while, but I have a new favorite book - Working effectively with legacy code If your company or team is trying or going to try to…"
usage: "Licensed under CC BY 4.0 — reuse, quote and adapt with attribution (Roy Osherove, link to the original page)."
license: "https://creativecommons.org/licenses/by/4.0/"
---

# \[Book of the month\] Working effectively with legacy code

By Roy Osherove April 15, 2005 In [Agile Related](https://osherove.com/blog/category/agile-related), [Recommended books](https://osherove.com/blog/category/recommended-books)

**Historical article** · Originally published April 15, 2005; technical details may be outdated.

[](https://www.amazon.com/exec/obidos/ASIN/0131177052/iserializable-20)

_\[Note:_ [_You can find more books I found very helpful or interesting here_](http://weblogs.asp.net/rosherove/articles/6802.aspx)_\]_

It's been a while, but I have a new favorite book -

[![](https://osherove.com/img/wb/e8207239_images.amazon.com_images_P_0131177052.01.TZZZZZZZ.jpg)](https://www.amazon.com/exec/obidos/ASIN/0131177052/iserializable-20)

[Working effectively with legacy code](https://www.amazon.com/exec/obidos/ASIN/0131177052/iserializable-20)

If your company or team is trying or going to try to start writing unit tests or work in a test driven manner, no matter what language you use, this is one of the best books you can get to help you get through the always-hard "rough patch" that team go through as they learn new tricks. Especially if you have a bunch of untested code you're going to have to deal with as you progress into a new, more agile future. It's not the only book you need to get, but it ranks right up there with [TDD with .NET](https://www.amazon.com/exec/obidos/ASIN/0735619484/iserializable-20) if you're starting out with little testing experience.

One of the biggest hurdles in becoming agile is writing unit tests for new code that has to work with old code, or testing old code when it needs changing. This books details in great length practically every trick you could think of to make this testing possible, with great examples in Java and C++.

When I first got to read it I realized that, just like when reading [the classic design patterns book](https://www.amazon.com/exec/obidos/ASIN/0201633612/iserializable-20), I've been implementing and recommending some of this stuff (not all) for a while, but always thinking that there has to be some formal "pattern" at work here that is shared among developers.

This book is the closest it gets to being a "legacy test patterns" book that I've seen, with real world advice and problem solving skills that are handed to you on a platter. You can definitely see that this guy had worked long and hard to achieve this kind of knowledge and as far as I'm concerned this book is worth more than its weight in gold. Much more.

## Lessons on this topic

- [Using Extract & Override](https://courses.osherove.com/courses/the-art-of-unit-testing-and-tdd-master-class-in-net/using-extract-and-override/) · The Art of Unit Testing & TDD Master Class in .NET
- [Refactoring Hardcore Skills](https://courses.osherove.com/courses/legacy-code-hero/refactoring-hardcore-skills/) · Legacy Code Hero
- [Legacy Refactoring intro](https://courses.osherove.com/courses/tdd-in-net-in-hebrew/legacy-refactoring-intro/) · TDD in .NET in Hebrew

## More in Agile Related

[All posts in Agile Related](https://osherove.com/blog/category/agile-related)

- Apr 25, 2005

    ### [2 exciting announcements from yours truly](https://osherove.com/blog/2005/4/25/2-exciting-announcements-from-yours-truly.html)

- Apr 16, 2005

    ### [\[CoolTool\] SWExplorerAutomation: Automate web GUI unit testing for IE](https://osherove.com/blog/2005/4/16/cooltool-swexplorerautomation-automate-web-gui-unit-testing.html)

- Apr 15, 2005

    ### [What does an Agile work environment look like? Here's one variation](https://osherove.com/blog/2005/4/15/what-does-an-agile-work-environment-look-like-heres-one-vari.html)

- Apr 14, 2005

    ### [Try to avoid multiple asserts in a single unit test](https://osherove.com/blog/2005/4/14/try-to-avoid-multiple-asserts-in-a-single-unit-test.html)


---

## About the author

**Roy Osherove**: Senior Solutions Architect at AWS working on AI for production and AI-driven development; author of The Art of Unit Testing and Elastic Leadership, with about 20 years of consulting and training on unit testing, TDD, team leadership and continuous delivery.

### Sites

- [RobotPaper](https://robotpaper.ai/): This blog: AI patterns and anti-patterns, AI and coding agents, and engineering leadership.
- [osherove.com](https://osherove.com): Roy's personal site. Author of The Art of Unit Testing and Elastic Leadership; consulting and training on unit testing, TDD, team leadership and continuous delivery, plus about 20 years of blog posts.
- [The Art of Unit Testing](https://www.artofunittesting.com): The Art of Unit Testing, 3rd Edition (Manning): readable, maintainable, trustworthy unit tests, plus TDD workshops in C#, JavaScript, Java and Kotlin.
- [5whys.com](https://www.5whys.com): Roy's writing on software team leadership: self-organizing teams, surviving chaos, learning mode and the Elastic Leadership model.
- [Pipeline Driven](https://pipelinedriven.org): Continuous delivery and DevOps practices: build patterns, pipeline-friendly testing, DevOps metrics and enterprise DevOps.
- [Elastic Leadership](https://www.elasticleadership.com): Elastic Leadership, Roy's framework for software team leaders (survival, learning and self-organizing modes).

### Social

- X: https://x.com/royosherove
- LinkedIn: https://www.linkedin.com/in/osherove/

### Contact

- Contact form: https://forms.gle/jQSx5KoXvrVA1JCK7

### License

Licensed under CC BY 4.0 — reuse, quote and adapt with attribution (Roy Osherove, link to the original page). License: https://creativecommons.org/licenses/by/4.0/
