---
title: "Unit Testing Pros And Cons"
url: "https://osherove.com/blog/2006/8/27/unit-testing-pros-and-cons.md"
canonical: "https://osherove.com/blog/2006/8/27/unit-testing-pros-and-cons.html"
published: "2006-08-27T16:21:47"
updated: "2006-08-27T16:21:47"
tags: ["Agile", "Agile Related", "Art Of Unit Testing", "Unit Testing"]
author: "Roy Osherove"
description: "\" Unit Testing is teh suck \" - this post, and some of the comments to it, represent just about every conceivable FUD (fear, Uncertainty, Doubt) about Unit Testing and Test Driven development I've heard, so I'd urge you…"
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/"
---

# Unit Testing Pros And Cons

By Roy Osherove August 27, 2006 In [Agile](https://osherove.com/blog/category/agile), [Agile Related](https://osherove.com/blog/category/agile-related), [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 August 27, 2006; technical details may be outdated.

"[Unit Testing is teh suck](http://wilshipley.com/blog/2005/09/unit-testing-is-teh-suck-urr.html)" - this post, and some of the comments to it, represent just about every conceivable [FUD](http://en.wikipedia.org/wiki/FUD) (fear, Uncertainty, Doubt) about Unit Testing and Test Driven development I've heard, so I'd urge you to go and read that post and especially its comments.

Why?

If you're not sure about Unit Testing, you'll certainly be familiar with some of the fears and doubts mentioned there, which will make you feel better about yourself, but still when you read the comments you'll get a sense that things are not as black and white as they appear to be - Unit Tests **could** be good for you, or at least they seem to be working just fine on \*some\* projects out there.

If you're pro Unit Testing, have tried it and have failed, you might find yourself agreeing with some of the stuff mentioned there as some of the core reasons why you failed to do Unit Testing with your Project, but **it does not have to be this way**.

My [Upcoming book](http://feeds.feedburner.com/ArtOfUnitTesting) deals **a lot** with ways and techniques to make sure that whatever practical problems you face when writing unit tests (Maintaining Unit Tests is very time consuming, Some part of the code are not testable, Not trusting your Unit Tests etc..) are solved to a degree that your Unit Tests "do much more good and much less harm" -- they're worth writing.

Many projects I've seen tried to do unit tests and failed for many reasons:

1. Tests were written poorly and so would fail or pass intermittently
2. Changing Tests after changing the API took way too much time so people simply gave up on them
3. Writing the tests was too hard for the API
4. Tests took too long to run or required massive amounts of setup to run, so no one ran them and all the bugs were found at once, or bugs could not be detected correctly  - it was "debugging night" all over again.
5. Management did not approve of taking lots of time to write tests in a Test Driven Manner (political decision, always)
6. many other reasons.

Most of the problems mentioned here can be solved by implementing some technique to Unit Testing, some of which I've described in [this MSDN article](http://msdn.microsoft.com/msdnmag/issues/06/01/UnitTesting), and you can find many others [in this series of blog posts](http://weblogs.asp.net/rosherove/archive/tags/Testing+Guidelines/default.aspx) in my blog "Testing Guidelines" Category.

"The Art Of Unit Testing" will deal with many of these techniques head on and in deep fasion and not only explain what can be done, but **why** it's important.

## More in Agile

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

- Sep 1, 2006

    ### [Video: Designing For Testability](https://osherove.com/blog/2006/9/1/video-designing-for-testability.html)

- Aug 31, 2006

    ### [Need help spreading a technical video via Bittorrnet](https://osherove.com/blog/2006/8/31/need-help-spreading-a-technical-video-via-bittorrnet.html)

- Aug 27, 2006

    ### [Simple designs through Test Driven Development](https://osherove.com/blog/2006/8/27/simple-designs-through-test-driven-development.html)

- Aug 24, 2006

    ### [The Art Of Unit Testing - Starting out My First Book](https://osherove.com/blog/2006/8/24/the-art-of-unit-testing-starting-out-my-first-book.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/
