Other Sellers on Amazon
+ $3.99 shipping
The Art of Unit Testing: with examples in C# 2nd Edition
Enter your mobile number or email address below and we'll send you a link to download the free Kindle App. Then you can start reading Kindle books on your smartphone, tablet, or computer - no Kindle device required.
To get the free app, enter your mobile phone number.
Frequently bought together
Customers who viewed this item also viewed
About the Author
- Item Weight : 1.34 pounds
- Paperback : 296 pages
- ISBN-10 : 1617290890
- ISBN-13 : 978-1617290893
- Dimensions : 7.38 x 0.7 x 9.25 inches
- Publisher : Manning Publications; 2nd edition (December 7, 2013)
- Language: : English
- Best Sellers Rank: #105,249 in Books (See Top 100 in Books)
- Customer Reviews:
Top reviews from the United States
There was a problem filtering reviews right now. Please try again later.
The author (whom I imagine to be a highly competent developer) seems to be still in the process of making up his mind about what unit testing is really about. He has changed his mind signficantly since the first edition of the book, and says, on page 76: "It's possible that in the next edition of this book I'll have turned 180 degrees on this subject". There is some context to that quote, but I felt like it probably applied to the entire book. Some people have an intuitive grasp of what needs to be done in particular situations, but cannot articulate their ideas effectively and cannot generalize to guiding principles for an entire field of professionals.
The subject matter of the book, published in 2013, does not feel at all dated. The author uses C# and NUnit to demonstrate what he's talking about. However, he is constantly telling you what the book is not about. It is not a design book, not a TDD book, not a patterns book. The author constantly refers the reader to other books. Eventually, it has the effect of making the reader feel that they are reading the wrong book.
* The code examples, which could have significantly redeemed the book, are a disaster. They are full of mistakes that the reader must mentally correct. If you make the mistake of downloading the source code from the author's GitHub page, you will find that Chapter 3 is entirely omitted. There is a lot of picky stuff I could say about the source code you get from the text or the Manning site. For instance, what is the point of inheritance when you have only a single child class? Does the author understand what the internal keyword means?
* The writing style is overly juvenile. The word "sucks" is employed more than once.
* I don't think that the author's use of the vocabulary of unit testing aligns with the currently accepted meanings of terms like stub and mock. For him, the term fake is a collective term for both stubs and mocks. He says on page 77: "A mock object is a fake object in the system that decides whether the unit test has passed or failed. It does so by verifying whether the object under test called the fake object as expected." My first question is, What is this fake that the mock is calling? And my second is, How does that distinguish a mock from a stub? I suppose it could be argued that the answers are implicit in the text, but they are not conspicuous to me. (He says in Chapter 3 that you assert against mocks, but not against stubs. But it seems to me that the examples in Chapter 3 assert against stubs. I don't know!) To be fair, the book is six years old at this point. However, I don't think the author achieves an internal consistency within the book of the terms he is using.
Maybe the book is a masterpiece after Chapter 4. Like I said, I am not going further.
We need better unit testing books for C#. Manning, generally an excellent tech publisher, has a new one coming out in 2020, and I hope it's a better book. One star is harsh, but I feel that it is necessary to counter the many 5-star reviews. This book deserves to be forgotten and replaced by more lucid texts.
The book is called "The ART of Unit Testing" for a reason. Roy Osherove is just as concerned (if not more concerned) with explaining how to write quality tests as he is with how to write a functioning test and for good reason - there's no point in writing tests that no one will want to run or understand later!
Don't look to this book for a comprehensive API on testing or mocking frameworks, but this book WILL give you the tools you need to understand what a unit test is, what an integration test is, what mocks and stubs are and the differences between them and it will give you enough high level information about many of the most popular testing and mocking frameworks for you to be up and writing tests very quickly.
Top reviews from other countries
Anyway as I said it doesn't really detract from the book in a meaningful way, if you want to learn unit testing then I'd still recommend it, it's just an annoyance I wanted to air.