---
title: "[Article] Issues in breaking dependencies for unit testing"
url: "https://osherove.com/blog/2005/8/23/article-issues-in-breaking-dependencies-for-unit-testing.md"
canonical: "https://osherove.com/blog/2005/8/23/article-issues-in-breaking-dependencies-for-unit-testing.html"
published: "2005-08-23T22:36:00"
updated: "2005-08-23T22:36:00"
tags: ["Agile Related", "Testing Guidelines"]
author: "Roy Osherove"
description: "One of the most important issues I've come to realize is the various ways of dealing with legacy code, mainly - how to deal with breaking multiple dependencies on an existing class or method that needs to be tested.…"
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/"
---

# \[Article\] Issues in breaking dependencies for unit testing

By Roy Osherove August 23, 2005 In [Agile Related](https://osherove.com/blog/category/agile-related), [Testing Guidelines](https://osherove.com/blog/category/testing-guidelines)

**Historical article** · Originally published August 23, 2005; technical details may be outdated.

One of the most important issues I've come to realize is the various ways of dealing with legacy code, mainly - how to deal with breaking multiple dependencies on an existing class or method that needs to be tested.

There are two basic ways to break dependencies, with various "dialects"  for each one. They both have their pros and cons and I won't explain in detail how to do them, but mainly, which of them you should choose and when.

Go read [Issues in breaking dependencies for unit testing](https://osherove.com/rosherove/articles/DependencyIssues.aspx) 

## More in Agile Related

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

- Aug 31, 2005

    ### [Agile conference coming to Israel - Your input is required.](https://osherove.com/blog/2005/8/31/agile-conference-coming-to-israel-your-input-is-required.html)

- Aug 30, 2005

    ### [Interesting Agile related blog - Cory Foy](https://osherove.com/blog/2005/8/30/interesting-agile-related-blog-cory-foy.html)

- Aug 21, 2005

    ### [Rally Software are doing it right](https://osherove.com/blog/2005/8/21/rally-software-are-doing-it-right.html)

- Aug 10, 2005

    ### [Video of my "Intro to Agile Development" talk at INDA is online](https://osherove.com/blog/2005/8/10/video-of-my-quotintro-to-agile-developmentquot-talk-at-inda.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/
