Browse the Knowledge Hub211 resources
Unit Testing Principles, Practices, and Patterns: is it worth reading?
The clearest modern account of what makes a unit test valuable, and why most suites are full of tests that are not.
We earn nothing from any link on this page. No affiliate links anywhere in this library.
- published
- 2020
- key ideas
- 3
- reading path
- 1

Unit Testing Principles, Practices, and Patterns
by Vladimir Khorikov
- Publisher
- Manning
- Year
- 2020
- ISBN
- 9781617296277
Useful when you are: Practising tester, Senior / lead
Verdict
Should you read it?
Read it if
You write or review unit tests, or you have a suite with high coverage that nobody trusts. It explains that specific pathology better than anything else available.
Skip it if
You do not write code. The examples are C sharp and the arguments are code-level throughout.
If you only read one thing
The chapter on the four pillars. It gives you a rubric you can apply to any existing test in about thirty seconds.
The argument
What it argues
Khorikov argues that the goal of unit testing is sustainable project growth, and that a test only contributes to that if it has four properties: protection against regressions, resistance to refactoring, fast feedback, and maintainability. The four trade off against each other, and resistance to refactoring is the one almost everyone sacrifices without realising.
The central practical argument is against testing implementation detail. A test that verifies how a class does something rather than what it produces will break on a correct refactoring, which teaches the team that failing tests are noise. That is how a suite loses its value while coverage stays high.
He is also direct about the London versus Chicago schools of TDD, and argues that heavy mocking couples tests to structure and is the main cause of refactoring-resistant suites.
Key ideas
Ideas worth taking from it
- 01
The four pillars of a good test
Regression protection, resistance to refactoring, fast feedback, maintainability. The framework for deciding whether a test is worth keeping.
- 02
Resistance to refactoring
The property nobody optimises for and the one that determines whether a suite survives. Tests coupled to implementation break on correct changes and are eventually ignored.
- 03
Observable behaviour against implementation detail
Test what a unit produces for a caller, not how it produces it. The practical rule that follows from the above and the one most suites violate.
Criticism
What has dated, and what it gets wrong
Opinionated in places where the profession genuinely disagrees, particularly on mocking and on the classical school. Readers committed to the London school will find the treatment unfair. The examples are all C sharp, which is a barrier for some, though the arguments transfer cleanly.
Reading paths
On our reading paths
Becoming an automation engineer
Book 2 of 5 · Automation and SDET
The best modern account of what makes a test valuable and when mocks help or hurt. Read it before your suite is large enough to make those mistakes expensive.
Keep reading
What to read next
Reads well with
Related on QAble
JUnit interview questions
Reading about quality is cheaper than learning it in production.
QAble runs QA for products in BFSI, gaming, healthcare and SaaS, with engineers who have read these and argued about them. Start with a free QA audit.




