Cover of The art of unit testing

The art of unit testing

by Roy Osherove · first published 2009

18mentions
12recommended by
17HN commenters
2012–2026first – last mentioned

71% recommend29% neutral

Why HN recommends it

A practical, pragmatic guide to writing unit tests and a natural next step after TDD basics. It offers hands-on advice for working developers, with some C#-specific material.

Summarised by Claude from recommending comments

Affiliate links. As an Amazon Associate I earn from qualifying purchases.

Mentions per year

30 2007: 0 mentions2008: 0 mentions2009: 0 mentions2010: 0 mentions2011: 0 mentions2012: 1 mention2013: 2 mentions2014: 0 mentions2015: 1 mention2016: 3 mentions2017: 3 mentions2018: 1 mention2019: 0 mentions2020: 1 mention2021: 1 mention2022: 2 mentions2023: 1 mention2024: 0 mentions2025: 0 mentions2026: 1 mention200720172026

What Hacker News says

  • ramgp · Dec 28, 2013 · Recommends

    …the process of changing the software later on. The Art of Readable Code by Dustin Boswell & Trevor Foucher Don't Make Me Think 2ed by Steve Krug Remote: Office not Required by Jason Fried & DHH The Art of Unit Testing by Roy Osherove Code Complete 2 by Steve McConnell Refactoring: Improving the Design of Existing Code by Martin Fowler The Practice of Programming by Brian Kernighan & Rob Pike JavaScript: The Good…

    on “Ask HN: What book changed your life in 2013?” ↗
  • superqwert · Aug 6, 2018 · Recommends

    Technical concepts for writing code: -------------------------------------- Clean Code (Robert Cecil Martin) The Art of Unit Testing (Roy Osherove) Head First Design Patterns (Elisabeth Freeman, Kathy Sierra) Martin Fowler's blog: https://martinfowler.com/ . How to gather requirements and write business-readable code: --------------------------------------…

    on “Ask HN: What are your go-to blogs and books on building business applications?” ↗
  • loevborg · Sep 30, 2022 · Recommends

    …you use, though of course examples are written in a language. ## Monographs Test Driven Development By Example (Kent Beck) Unit Testing: Principles, Practices, and Patterns (Vladimir Khorikov) The Art of Unit Testing 2nd ed (Roy Osherove) Working Effectively with Legacy Code (Michael Feathers) ## Various resources [Unit Testing Best Pratices](https://www.youtube.com/watch?v=k_ItB5btREU&t=2931s&ab_chann...) (Vladimir…

    on “Ask HN: Any good software testing resources?” ↗
  • kojoru · Dec 28, 2013 · Recommends

    The Art of Unit Testing by Roy Osherove is indeed amazing. Thanks to it I now write much better unit tests, and as a result of removed frustration I do it much more often.

    on “Ask HN: What book changed your life in 2013?” ↗
  • RossBencina · Jun 5, 2017 · Recommends

    I see you read Kent Beck's TDD book. A good follow-up might be Roy Osherove's "The Art of Unit Testing." I found it to have a lot of pragmatic, practical advice. It's not the final word, but it is a good next step after Kent Beck's book. It has some C#-specific material, but that stuff is interesting to…

    on “Ask HN: What language-agnostic programming books should I read?” ↗
  • codethief · Aug 26, 2020 · Recommends

    I recommend reading The Art of Unit Testing -> https://www.manning.com/books/the-art-of-unit-testing . At least this is the book I learned TDD from more than 10 years ago and the knowledge I gained from the book has proven to be timeless.

    on “Is TDD Dead? (2014)” ↗
  • spyrefused · Jan 29, 2021 · Recommends

    I found quite useful an example I read in the book "The Art of Unit Testing" by Roy Osherove, it was something like this (I don't have it at hand, I repeat it from memory): Suppose you have to test the irrigation system of a tree in your garden, you want to test how many times…

    on “Mocks Aren't Stubs (2007)” ↗
  • JoeMayoBot · Mar 12, 2023 · Recommends

    Looking at my bookshelf, there are three books that I've re-opened as references for a while that have a significant impact on my current work: 1. Refactoring/Fowler 2. Design Patterns/Gang of Four 3. The Art of Unit Testing/Osherove Although, the last book (Unit Testing) is C# specific, what I appreciated was the open discussion of using techniques and tools, rather than ideology.

    on “Ask HN: What reads made you a better engineer?” ↗
  • dvcc · Jun 9, 2016 · Recommends

    Oh god mocks/fakes/doubles. The best answer to that probably comes from The Art of Unit Testing as explained on SO: http://stackoverflow.com/a/33333064/2136440. In short yea, you're right.

    on “.NET mocking frameworks, a comparison” ↗
  • douche · Nov 16, 2016 · Recommends

    …time. Not particularly for a specific technology, especially in fast-moving domains like web dev, but for more broad practice and theory, the concepts are more timeless. Think Code Complete, or The Art of Unit Testing, or Working Effectively with Legacy Code, or Peopleware. I'm also a fan of the Syncfusion Succinctly series[1]. They are short, quick overviews of a particular tech, that you can pretty easily go through…

    on “Ask HN: Do you still buy/read technical books?” ↗
  • mindcrash · Sep 13, 2022 · Recommends

    The book mentioned below is basically the defacto book on TDD; but if you are in the .NET ecosystem (or know how to read C# pretty well) and want to read a nice practical one I can really recommend The Art Of Unit Testing published by Manning: https://www.manning.com/books/the-art-of-unit-testing-second... Also note that these days all popular commercial IDEs (Visual Studio, IDEA, Rider) have great builtin support for…

    on “Ask HN: Practical Guide to TDD?” ↗
  • W0lf · Jun 5, 2017 · Recommends

    …Software Runaways, Glass http://amzn.to/2qT2mHn Sorting and Searching, Knuth http://amzn.to/2qQ4NWQ Structure and Interpretation of Computer Programs, Abelson and Sussman http://amzn.to/2qTflsk The Art of Unit Testing, Manning http://amzn.to/2rsERDu The Art of Unix Programming, ESR http://amzn.to/2sIAXUZ The Design of Design: Essays from a Computer Scientist, Brooks http://amzn.to/2rsPjev The Effective Engineer,…

    on “Ask HN: What language-agnostic programming books should I read?” ↗
  • yebyen · Oct 22, 2012 · Mentions

    Really? Click on the issue link (article), then once you've read it, click on the Downloads link. There is Manning 2009 Art of Unit Testing, and some random thai/viet filenames that go along with the rest of the project, which seems to contain nothing original -- but I can't say for sure, I don't talk thai.

    on “Issue report: You are illegally sharing my fucking book ” ↗
  • Evgeny · Oct 16, 2015 · Mentions

    Well, that's too amazing to be true - as part of my preparation I started reading "The Art of Unit Testing" just a couple days ago (not that I did not write tests before, but got a suggestion that the book will help me better understand dependency injection, inversion of control etc.)

    on “Ask HN: How to Be a Good Technical Lead?” ↗
  • lovich · Jul 4, 2016 · Mentions

    Do you have any suggestions on where to learn more about testing? I've gone through numerous tutorials and read through The Art of Unit Testing but I still feel like I'm writing tests just to write tests. It's not really clicking for me

    on “Software has diseconomies of scale, not economies of scale” ↗

Keyboard shortcuts

/
Focus search
j / k
Next / previous book
Enter
Open focused book
Esc
Close / go back
g h
Go to Home
g t
Go to Top all-time
g m
Go to Most recommended
g r
Go to Rising
g f
Go to For You
?
Show this help