This book explains in detail how to implement unit tests using two very popular open source Java technologies: JUnit and Mockito. It presents a range of techniques necessary to write high quality unit tests - e.g. mocks, parametrized tests and matchers. It also discusses trade-offs related to the choices we have to make when dealing with some real-life code issues.
The book stresses the importance of writing readable and maintainable unit tests, and puts a lot of stress on code quality. It shows how to achieve testable code and to eliminate common mistakes by following the Test Driven Development approach. Every topic discussed in the book is illustrated with code examples, and each chapter is accompanied by some exercises.
This book offers many good tips on how to build high-quality code. More importantly, it hepls create a base framework of a MANUAL that a company could use to standardise the coding styles of its engineering force. One shouldn’t follow all the tips listed in the book, but the book surley gives nice directions.
I have tried several different books to read regarding unit-testing and specific testing in Java but this is a DIAMOND book. Exactly the one I looked for and needed. It goes into details, have exercises to master the material and is practical enough, so after reading I can jump into the code I am working with and will be already equipped with several techniques/tools that I didn't know/fully understand before.
I definitely recommend it for people with some experience in programming, not necessarily in Java and those who want to structure accumulated knowledge over years.
This is the best book I have read about Unit Testing in Java. It's very practical, so you are introduced to the concepts using concise escenarios. It uses examples of code closer of what you would find in enterprise OO applications.
I already had a decent bit of experience with Mockito and JUnit, but this book helped me gain a lot more perspective. A must read for unit testing in Java.
I am an experienced developer, and found this book to be quite useful. I intend to especially recommend it to all of the junior developers working for me.
It lays out how to do test driven development in a concise, but useful way, it gets into some of the benefits of JUnit, assertJ, and Mockito, among other frameworks.