---
title: "TDD Anti Patterns"
url: "https://osherove.com/blog/2008/1/20/tdd-anti-patterns.md"
canonical: "https://osherove.com/blog/2008/1/20/tdd-anti-patterns.html"
published: "2008-01-20T05:54:25"
updated: "2008-01-20T05:54:25"
tags: ["Agile", "Art Of Unit Testing", "Unit Testing"]
author: "Roy Osherove"
description: "James Carr lists a nice bunch of TDD anti patterns . via Jeremy . Here's one example I run into often: \"The Liar An entire unit test that passes all of the test cases it has and appears valid, but upon closer inspection…"
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/"
---

# TDD Anti Patterns

By Roy Osherove January 20, 2008 In [Agile](https://osherove.com/blog/category/agile), [Art Of Unit Testing](https://osherove.com/blog/category/art-of-unit-testing), [Unit Testing](https://osherove.com/blog/category/unit-testing)

**Historical article** · Originally published January 20, 2008; technical details may be outdated.

James Carr lists a nice bunch of [TDD anti patterns](http://blog.james-carr.org/?p=44). via [Jeremy](http://codebetter.com/blogs/jeremy.miller/archive/2008/01/18/typemock-isn-t-too-powerful-and-quot-designing-for-testability-quot-is-much-more-than-merely-mocking-anyway.aspx) .

Here's one example I run into often:

**"The Liar**

An entire unit test that passes all of the test cases it has and appears valid, but upon closer inspection it is discovered that it doesn’t really test the intended target at all."

## More in Agile

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

- Jan 21, 2008

    ### [Video: Typemock Basics - Lesson 1 (Dependency breaking 101)](https://osherove.com/blog/2008/1/21/video-typemock-basics-lesson-1-dependency-breaking-101.html)

- Jan 20, 2008

    ### [The Case For Typemock](https://osherove.com/blog/2008/1/20/the-case-for-typemock.html)

- Jan 18, 2008

    ### [Trying out Team City - Looks Promising!](https://osherove.com/blog/2008/1/18/trying-out-team-city-looks-promising.html)

- Jan 17, 2008

    ### [Is Typemock too powerful? Will it kill design for testability?](https://osherove.com/blog/2008/1/17/is-typemock-too-powerful-will-it-kill-design-for-testability.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/
