Unit Testing:Principles, Practices and Patterns: Effective Testing Styles, Patterns, and Reliable Automation for Unit Testing, Mocking, and Integration Testing with Examples in C#
B**Z
Seminal, pragmatic work
Finally a book about testing that's written by someone who's taken a step back to actually think about it!Previously I had embraced the "abstract and mock everything" approach but found many of the test suites I wrote to be horrible to understand and maintain. They were easily broken by refactoring. This book explains why that approach is bad, by taking an abstract and theoretical view upon testing.This book is particularly useful in terms of:* determining which tests are useful and which are pointless* when to use mocking and stubs, and when not to* separating the "model" (aka business logic) from interactions with other (sub)systems by using a collaborator ("controller"), to simplify testability* making as much of the "model" functional as possible, to further simplify testabilityThe examples are written in C# but it's easy to apply the principles to most other languages.
J**7
Excellent resource and enjoyable read
I bought this book after finding the authors online courses excellent and have been writing unit tests of varying merit for several years.I found the book extremely easy to read, especially for essentially a text book. I was actually gripped and read the whole book in 48 hours.The concepts in the book come with very good, clear examples and was easy to follow. The structure makes sense and each section comes with a useful summary for referring back to when done.If you want to understand more about effective unit testing or like me just feel like your unit tests are a bit dubious at times this is an essential resource.
P**E
Do you want a great test suite? Then read this.
This book is a must read for anyone serious about unit testing. If you're not serious about unit testing then consider another job!So many times, in my career, I’ve encountered tests suits that are hard to maintain, grapple with, turn red and go back to green for no explicit reason. I’ve seen developers comment out large bunch of tests because they can’t fix them but are eager to build and release. These test suites gradually degrade and has the look and feel of a vandalized area.Personally, I’m always bothered about creating a poor test suite and agonizing over difference approaches. This book instills a mindset and provides what approach to take and when. Vladimir is lawyer-esque in taking a problem, breaking it down to it parts, analyzing them and putting it all back together with clear conclusions. The beauty of what Vladimir does it to take a difficult topic and make it explainable to any level of developer. Following the practices in this book will not only improve your tests but will also improve the way you think about coding a solution or refactor it.
M**Y
Useful introduction and great reference
I found this to be the best overview of the subject of unit testing full of great insights and advice.Useful as an introduction to the topic and as a reference.
O**N
This it now my go-to book for unit testing
Explains the trade-offs and variations clearly, completely, and concisely. It's the first book I recommend to others when asked about unit testing.
Trustpilot
3 weeks ago
1 day ago