DeepRead
Cover of Unit Testing

Unit Testing

Vladimir Khorikov · 2020

Programming and computer science › Testing and legacy code

#7,466 most recommended

About the book

A practical guide to unit testing in object-oriented and functional code, with examples mostly in C#. It covers what a unit test is, how to judge test quality, the use of mocks and other test doubles, and how integration tests fit alongside unit tests. Good tests are judged by four attributes: protection against regressions, resistance to refactoring, fast feedback, and maintainability, and these pull against each other so that tests must be chosen with trade-offs in mind. The most valuable tests check observable behavior, usually of business logic with few collaborators, through the public API rather than implementation details. Mocks belong only to unmanaged dependencies, such as external systems that other applications also depend on, and the author argues for the classical (Detroit) school over the London school. Code can be restructured, for example by separating logic from side effects, so that the valuable parts become easy to test.

Written by Claude from what it knows of this book.

What Hacker News says 75% recommend · 0% critical

02420212022202320242024 peak · 3
This bookAverage book in Testing and legacy code

In the commenters’ own words

What Open Library readers say

No Open Library reader has rated it yet.

  • 1 want to read
  • 1 reading
  • 1 have read

Open Library’s page for the book

What critics say, via Wikipedia

No Wikipedia article about this book yet, so no critics to quote.

Reddit communities — coming later

The threads it came up in

Details

First published
2020
ISBN
9781617296277
Editions known
4 at Open Library
Open Library
OL22137664W

Engineering

Explore in the mosaic

Read next: its neighbours on the mosaic