Buy New
-21%
$39.61$39.61
FREE delivery Thursday, June 25
Ships from: Amazon.com Sold by: Amazon.com
Used - Good
$19.59$19.59
$3.99 delivery June 29 - July 2
Ships from: Goodwill of Colorado Sold by: Goodwill of Colorado
Sorry, there was a problem.
There was an error retrieving your Wish Lists. Please try again.Sorry, there was a problem.
List unavailable.
Download the free Kindle app and start reading Kindle books instantly on your smartphone, tablet, or computer - no Kindle device required.
Read instantly on your browser with Kindle for Web.
Using your mobile phone camera - scan the code below and download the Kindle app.
Follow the author
OK
Unit Testing Principles, Practices, and Patterns: Effective testing styles, patterns, and reliable automation for unit testing, mocking, and integration testing with examples in C#
Purchase options and add-ons
Key Features
A practical and results-driven approach to unit testing
Refine your existing unit tests by implementing modern best practices
Learn the four pillars of a good unit test
Safely automate your testing process to save time and money
Spot which tests need refactoring, and which need to be deleted entirely
Purchase of the print book includes a free eBook in PDF, Kindle, and ePub formats from Manning Publications.
About The Book
Great testing practices maximize your project quality and delivery speed by identifying bad code early in the development process. Wrong tests will break your code, multiply bugs, and increase time and costs. You owe it to yourself—and your projects—to learn how to do excellent unit testing.
Unit Testing Principles, Patterns and Practices teaches you to design and write tests that target key areas of your code including the domain model. In this clearly written guide, you learn to develop professional-quality tests and test suites and integrate testing throughout the application life cycle. As you adopt a testing mindset, you’ll be amazed at how better tests cause you to write better code.
What You Will Learn
Universal guidelines to assess any unit test
Testing to identify and avoid anti-patterns
Refactoring tests along with the production code
Using integration tests to verify the whole system
This Book Is Written For
For readers who know the basics of unit testing. Examples are written in C# and can easily be applied to any language.
About the Author
Vladimir Khorikov is an author, blogger, and Microsoft MVP. He has mentored numerous teams on the ins and outs of unit testing.
Table of Contents:
PART 1 THE BIGGER PICTURE
1 ¦ The goal of unit testing
2 ¦ What is a unit test?
3 ¦ The anatomy of a unit test
PART 2 MAKING YOUR TESTS WORK FOR YOU
4 ¦ The four pillars of a good unit test
5 ¦ Mocks and test fragility
6 ¦ Styles of unit testing
7 ¦ Refactoring toward valuable unit tests
PART 3 INTEGRATION TESTING
8 ¦ Why integration testing?
9 ¦ Mocking best practices
10 ¦ Testing the database
PART 4 UNIT TESTING ANTI-PATTERNS
11 ¦ Unit testing anti-patterns
- ISBN-101617296279
- ISBN-13978-1617296277
- EditionFirst Edition
- PublisherManning
- Publication dateJanuary 14, 2020
- LanguageEnglish
- Dimensions7.38 x 0.7 x 9.25 inches
- Print length304 pages
![]() |
Frequently bought together

Customers who viewed this item also viewed
Refactoring: Improving the Design of Existing Code (2nd Edition) (Addison-Wesley Signature Series (Fowler))HardcoverFREE Shipping by AmazonGet it as soon as Thursday, Jun 25
Test Driven Development: By Example (Addison-Wesley Signature Series (Beck))PaperbackGet it as soon as Wednesday, Jul 1
A Philosophy of Software Design, 2nd EditionPaperbackFREE Shipping on orders over $35 shipped by AmazonGet it as soon as Thursday, Jun 25
Clean Architecture: A Craftsman's Guide to Software Structure and Design (Robert C. Martin Series)PaperbackFREE Shipping on orders over $35 shipped by AmazonGet it as soon as Thursday, Jun 25
The Art of Unit Testing, Third Edition: with examples in JavaScriptPaperbackFREE Shipping by AmazonGet it as soon as Thursday, Jun 25Only 5 left in stock (more on the way).
The Pragmatic Programmer: Your Journey To Mastery, 20th Anniversary Edition (2nd Edition)David ThomasHardcoverFREE Shipping by AmazonGet it as soon as Thursday, Jun 25
Customers also bought or read
- Domain-Driven Design: Tackling Complexity in the Heart of Software
Hardcover$52.53$52.53FREE delivery Thu, Jun 25 - Clean Architecture: A Craftsman's Guide to Software Structure and Design (Robert C. Martin Series)
Paperback$30.29$30.29Delivery Thu, Jun 25 - Working Effectively with Legacy Code (Robert C. Martin Series)
Paperback$42.94$42.94FREE delivery Thu, Jun 25 - Head First Design Patterns: Building Extensible and Maintainable Object-Oriented Software 2nd Edition
Paperback$43.99$43.99FREE delivery Thu, Jun 25 - The Pragmatic Programmer: Your Journey To Mastery, 20th Anniversary Edition (2nd Edition)#1 Best SellerSoftware Testing
Hardcover$45.97$45.97FREE delivery Thu, Jun 25 - Design Patterns: Elements of Reusable Object-Oriented Software
Hardcover$26.48$26.48Delivery Jun 30 - Jul 6 - The Art of Unit Testing, Third Edition: with examples in JavaScript
Paperback$40.99$40.99FREE delivery Thu, Jun 25 - Growing Object-Oriented Software, Guided by Tests (Addison-Wesley Signature Series (Beck))
Paperback$45.45$45.45FREE delivery Thu, Jun 25 - Observability Engineering: Achieving Production Excellence
Paperback$36.49$36.49FREE delivery Thu, Jun 25 - Software Engineering at Google: Lessons Learned from Programming Over Time
Paperback$34.95$34.95Delivery Thu, Jun 25 - Accelerate: The Science of Lean Software and DevOps: Building and Scaling High Performing Technology Organizations#1 Best SellerInformation Management
Paperback$11.17$11.17Delivery Thu, Jun 25 - Modern Software Engineering: Doing What Works to Build Better Software Faster
Paperback$34.64$34.64Delivery Thu, Jun 25 - Mythical Man-Month, The: Essays on Software Engineering, Anniversary Edition
Paperback$24.43$24.43Delivery Jun 30 - Jul 6 - Release It!: Design and Deploy Production-Ready Software
Paperback$40.36$40.36FREE delivery Thu, Jun 25 - The Algorithm Design Manual (Texts in Computer Science)
Hardcover$51.02$51.02FREE delivery Thu, Jun 25 - AI Engineering: Building Applications with Foundation Models#1 Best SellerEnterprise Applications
Paperback$52.40$52.40FREE delivery Thu, Jun 25 - Grokking Algorithms, Second Edition: An illustrated guide for programmers and other curious people#1 Best SellerComputer Algorithms
Paperback$43.99$43.99FREE delivery Thu, Jun 25 - Operating Systems: Three Easy Pieces#1 Best SellerComputer Operating Systems Theory
Paperback$28.27$28.27Delivery Thu, Jun 25 - Pro C# 10 with .NET 6: Foundational Principles and Practices in Programming
Paperback$33.57$33.57Delivery Thu, Jun 25 - Fluent Python: Clear, Concise, and Effective Programming
Paperback$43.99$43.99FREE delivery Thu, Jun 25 - Clean Code: A Handbook of Agile Software Craftsmanship (Robert C. Martin Series)
Paperback$59.99$59.99FREE delivery Thu, Jun 25 - Code That Fits in Your Head: Heuristics for Software Engineering (Robert C. Martin Series)
Paperback$34.07$34.07Delivery Thu, Jun 25
Editorial Reviews
Review
About the Author
Product details
- Publisher : Manning
- Publication date : January 14, 2020
- Edition : First Edition
- Language : English
- Print length : 304 pages
- ISBN-10 : 1617296279
- ISBN-13 : 978-1617296277
- Item Weight : 1.1 pounds
- Dimensions : 7.38 x 0.7 x 9.25 inches
- Best Sellers Rank: #412,865 in Books (See Top 100 in Books)
- #16 in C# Programming (Books)
- #42 in Software Testing
- #223 in Software Design & Engineering
- Customer Reviews:
About the author

Vladimir Khorikov is a software engineer and author of several popular Pluralsight courses. He has been professionally involved in software development for over 15 years, including mentoring teams on the ins and outs of unit testing.
He's also the founder of the Enterprise Craftsmanship blog, where he reaches 500 thousand software developers yearly. He started as an adviser on general programming topics, but lately shifted his focus to unit testing with a central message of teaching software developers how to make unit testing painless.
The biggest advantage of his teaching style, and the one students often praise, is his tendency to have a strong theoretic background, which he then applies to practical examples.
Customer reviews
- 5 star4 star3 star2 star1 star2 star78%16%6%0%0%0%
- 5 star4 star3 star2 star1 star1 star78%16%6%0%0%0%
Customer Reviews, including Product Star Ratings help customers to learn more about the product and decide whether it is the right product for them.
To calculate the overall star rating and percentage breakdown by star, we don’t use a simple average. Instead, our system considers things like how recent a review is and if the reviewer bought the item on Amazon. It also analyzed reviews to verify trustworthiness.
Learn more how customers reviews work on AmazonTop reviews from the United States
- 5 out of 5 stars
Awesome resource to get the actual gist of testing
Reviewed in the United States on January 22, 2025One of the most helpful resources I found when it comes to test effectively, beyond the "The more test the better" rule of thumb the main take away from this book is "You either create solid tests that brings value to your software or you wrote none" The approach of how to calculate the value of a tests is quite accurate. Test quality that can be measure is something really valuable.
Sending feedback...Sending feedback...HelpfulThank you for your feedback.Sorry, we failed to record your vote. Please try againThanks, we'll investigate in the next few days.Sorry, We failed to report this review. Please try again - 5 out of 5 stars
The best book on how to make software testable
Reviewed in the United States on March 16, 2022I have been doing unit and integration testing for about fifteen years, and I have read many books about testing using different languages. This book so far is the best. Most of the books gave simple examples like calculators or dependency injection. This book covered where and how to use each and design your code to be testable. That is very important since testable code requires a different structure or architecture. This book also covers dealing with mock, databases, external services. I think that there is so much information in this book that reading it once might not be enough, and I'm going to read it a second time and use it as a reference when I'm designing and writing my code to make writing unit tests better.
11 people found this helpfulSending feedback...Sending feedback...HelpfulThank you for your feedback.Sorry, we failed to record your vote. Please try againThanks, we'll investigate in the next few days.Sorry, We failed to report this review. Please try again - 4 out of 5 stars
Unit testing fundamentals just get it
Reviewed in the United States on April 25, 2025One of the fundamental books in unit testing. Get it!
Sending feedback...Sending feedback...HelpfulThank you for your feedback.Sorry, we failed to record your vote. Please try againThanks, we'll investigate in the next few days.Sorry, We failed to report this review. Please try again - 5 out of 5 stars
A good collection of best practices for writing unit/integration tests
Reviewed in the United States on February 3, 2020Bob is young and just started writing unit tests because he has heard it's such a great idea, he picked the "art of unit testing" book from bookshelf and he is ready to go, writes many tests, he is more than happy, finally, something checks his job, he is not afraid anymore to bug fix code because something is checking if he is not introducing any new bugs. Then, this day comes, Bob wants to rearrange his classes, methods and suddenly he is in a situation when he has to fix a million tests. Don't be like Bob, do a favor to yourself and buy this book.
21 people found this helpfulSending feedback...Sending feedback...HelpfulThank you for your feedback.Sorry, we failed to record your vote. Please try againThanks, we'll investigate in the next few days.Sorry, We failed to report this review. Please try again - 5 out of 5 stars
Highly recommended
Reviewed in the United States on October 28, 2021Unit tests are a necessary for complex software applications, but there are very few guidelines and resources on how and what exactly should be unit tested. This book takes unit testing at the next level. I completely agree with the author, we should unit test a unit of behavior and not a unit of code. I highly recommend this book for all software developers.
3 people found this helpfulSending feedback...Sending feedback...HelpfulThank you for your feedback.Sorry, we failed to record your vote. Please try againThanks, we'll investigate in the next few days.Sorry, We failed to report this review. Please try again - 5 out of 5 stars
Very clear and pragmatic!!!!
Reviewed in the United States on September 16, 2020This book is amazing! As usual Vladimir is super clear snd pragmatic. This is not only about unit testing, but architecture as well. I personally loved it!!!!
3 people found this helpfulSending feedback...Sending feedback...HelpfulThank you for your feedback.Sorry, we failed to record your vote. Please try againThanks, we'll investigate in the next few days.Sorry, We failed to report this review. Please try again - 5 out of 5 stars
Well written and of great detail
Reviewed in the United States on February 4, 2020This book contains many great advices and examples about different aspects of unit testing. Very helpful for me.
2 people found this helpfulSending feedback...Sending feedback...HelpfulThank you for your feedback.Sorry, we failed to record your vote. Please try againThanks, we'll investigate in the next few days.Sorry, We failed to report this review. Please try again - 5 out of 5 stars
Great book
Reviewed in the United States on December 6, 2024Great book, explains various theoratical concepts around unit tests. I'm keeping this as my reference, or source to make software training about unit testing.
Sending feedback...Sending feedback...HelpfulThank you for your feedback.Sorry, we failed to record your vote. Please try againThanks, we'll investigate in the next few days.Sorry, We failed to report this review. Please try again
Top reviews from other countries
Hüseyin ABANOZ5 out of 5 starsRecommended
Reviewed in Turkey on January 11, 2026Good content. Provides a good framework on unit testing, integration testing and refactoring. Also touches on system architecture a bit, in terms of testing. Examples are few but to the point. Recommend it to mid to senior developers that is seeking to form a formal basis on unit testing
Sending feedback...Thanks, we'll investigate in the next few days.Sorry, We failed to report this review. Please try again
TimoHeiten5 out of 5 starsLearn to write better tests. The Book delivers and is a Good read
Reviewed in Germany on September 27, 2020Excellent Book on Unit testing pcrinciples. But be aware that you Need already be comfortable with the technical Side of testing.
Other than that the Book very clearly explains how to Write Good Unit tests that will help you have a refactoring Safety net for your application.
This is done by elaborating on the 4 pillars of good tests and the difference between different unit test schools and styles.
To sum it up it is an excellent read and I learnt a lot, I have not been aware of before even though I practiced TDD and testing in general. So buy it if you want to write better tests is my advice.
Sending feedback...Thanks, we'll investigate in the next few days.Sorry, We failed to report this review. Please try again
Farnoosh5 out of 5 starsFabulous
Reviewed in Canada on October 8, 2023One of the best books I've ever read, excellent content
Sending feedback...Thanks, we'll investigate in the next few days.Sorry, We failed to report this review. Please try again
Enrique Pérez5 out of 5 starsTop 5
Reviewed in Mexico on December 5, 2025Después de leerlo, puedo decir que es de mis libros que de encuentran en mi top 5 en materia de desarrollo de software.
Sending feedback...Thanks, we'll investigate in the next few days.Sorry, We failed to report this review. Please try again
Anish S5 out of 5 starsGreat book explaining everything you need to know about unit tests
Reviewed in India on December 22, 2025Explains very well why unit tests are important and goes into detail about different ways of writing them, as well as good practices and things to avoid. Was able to apply to my work
Sending feedback...Thanks, we'll investigate in the next few days.Sorry, We failed to report this review. Please try again














