Skip to content
HomeVideosBooks
AllTopicsTrends
BlogsPodcasts
HistoryListsWatch laterLiked videosFollowing

The videos, books, blogs and podcasts Hacker News keeps recommending, all in one place.

VideosBooksBlogsPodcastsAboutPrivacySettings

Data from Hacker News, HackerTube, HackerBooks, HackerBlogs and Open Library. Credits · Not affiliated with Y Combinator.

HomeVideosBooksBlogsPodcasts
Ctrl K
    Cover of The art of unit testing

    The art of unit testing

    Roy Osherove · 2009

    Summary The Art of Unit Testing, Second Edition guides you step by step from writing your first simple tests to developing robust test sets that are maintainable, readable, and trustworthy. You'll master the foundational ideas and quickly move to high-value subjects like mocks, stubs, and isolation, including frameworks such as Moq, FakeItEasy, and Typemock Isolator. You'll explore test patterns and organization, working with legacy code, and even "untestable" code. Along the way, you'll learn about integration testing and techniques and tools for testing databases and other technologies. About this Book You know you should be unit testing, so why aren't you doing it? If you're new to unit testing, if you find unit testing tedious, or if you're just not getting enough payoff for the effort you put into it, keep reading. The Art of Unit Testing, Second Edition guides you step by step from writing your first simple unit tests to building complete test sets that are maintainable, readable, and trustworthy. You'll move quickly to more complicated subjects like mocks and stubs, while learning to use isolation (mocking) frameworks like Moq, FakeItEasy, and Typemock Isolator. You'll explore test patterns and organization, refactor code applications, and learn how to test "untestable" code. Along the way, you'll learn about integration testing and techniques for testing with databases.

    ProgrammingSoftware Engineering
    Open LibraryAmazon
    Stats for nerds
    12recommend
    18mentions
    17people
    2012–2026years
    67% recommend33% neutral

    Mentions per year

    20122014201620182020202220242026

    What Hacker News says

    1. JoeMayoBotMar 2023
      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.

      thread
    2. mindcrashSep 2022
      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 TDD (for example: automatically running tests after code changes) so manually doing things and thus slow development are a thing of the past...

      thread
    3. loevborgSep 2022
      I put together a reading list of the best writing on automated testing I know. Most of this is agnostic wrt the language 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 Khorikov)

      [Testing Without Mocks: A Pattern Language](https://www.jamesshore.com/v2/blog/2018/testing-without-mock...) (James Shore)

      [TDD Lunch & Learn](https://www.jamesshore.com/v2/projects/lunch-and-learn) (James Shore)

      [Test Driven Development - What? Why? And How?](https://www.youtube.com/watch?v=llaUBH5oayw&ab_channel=Conti...) (Dave Farley)

      [The 3 Types of Unit Test in TDD](https://www.youtube.com/watch?v=W40mpZP9xQQ&t=22s&ab_channel...) (Dave Farley)

      [TDD and the Lump of Coding Fallacy](https://www.geepawhill.org/2018/04/14/tdd-the-lump-of-coding...) (Geepaw Hill)

      ## Against Unit Tests

      [Why Most Unit Testing is Waste](https://rbcs-us.com/documents/Why-Most-Unit-Testing-is-Waste...) (James O Coplien)

      [On unit testing and TDD](https://www.youtube.com/watch?v=21JlBOxgGwY&ab_channel=JeruS...) (Jonathan Blow)

      thread
    4. spyrefusedJan 2021
      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 and how much water is used, you have two ways to do it:

      1) State-based: run the system for a few hours, during which it should water the tree several times. At the end of that time, you check the state of the watered tree: Is the soil moist enough, is the tree well, are the leaves green, etc. (Obviously this is just an example as this test would be complex in real life, but it is to get the idea across).

      2) Interaction: We place a flow meter, a device that registers how much water is flowing through the device and at what times. At the end of the day, check that the device has been called the correct number of times, with the correct amount of water each time, and we don't worry about checking the status of the tree.

      thread
    5. codethiefAug 2020
      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.
      thread
    6. superqwertAug 2018
      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:

      --------------------------------------

      Domain-driven design (Eric J. Evans)

      Implementing Domain-Driven Design (Vaughn Vernon)

      Patterns, Principles, and Practices of Domain-Driven Design (Scott Millett)

      .

      Remaining agile and managing your work according to your clients' needs:

      --------------------------------------

      The art of doing twice the work in half the time (Jeff Sutherland)

      The Mythical Man Month (Fred Brooks)

      thread

    Related

    Cover of Code Simplicity
    2013–2021

    Code Simplicity

    Max Kanat-Alexander
    3 recommend · 3
    Cover of Component software
    2013–2026

    Component software

    Clemens Szyperski
    3 recommend · 30
    Unit TestingVladimir Khorikov
    2021–2024

    Unit Testing

    Vladimir Khorikov
    3 recommend · 8
    Cover of The art of software testing
    2008–2026

    The art of software testing

    Glenford J. Myers
    6 recommend · 14
    Working Effectively with Unit TestsJay Fields
    2017–2020

    Working Effectively with Unit Tests

    Jay Fields
    3 recommend · 3
    Cover of Test-driven development
    2007–2026

    Test-driven development

    Kent Beck
    30 recommend · 62
    Cover of The Art of Readable Code
    2011–2026

    The Art of Readable Code

    Dustin Boswell
    11 recommend · 17
    Cover of The art of multiprocessor programming
    2009–2026

    The art of multiprocessor programming

    Maurice Herlihy
    27 recommend · 64