A quick introduction to the world of modern unit-testing.
Should we still introduce Unit Tests twelve years after the publication of Pragmatic Unit Testing in Java with JUnit ?
While the practice of TDD or pair programming continues to be debated, unit tests are considered as an essential practice today.
Pragmatic Unit Testing in Java 8 with JUnit is a complete revision of the previous book but the aim of the book does not change : write and run easily maintained unit tests. Acronyms like FIRST, Right BICEP or CORRECT Boundary Condition (already present in the original edition) are mnemonics to help you to reach that goal.
The book is a short, speedy tour of the practices (Refactoring, TDD), concepts (Unit/Integration Testing, Mocks, …), and recommendations for unit testing. The authors only scratched the surface on most of the topics. After this book, you should be prepared to experiment on your own with JUnit, Hamcrest or Mockito. There is so much to say about each subject that you should be prepare to read additional books like Working Effectively with Legacy Code as soon as new difficulties arises.
Write a book on this subject of unit testing is not easy. The authors manage to show the dynamics of the approach. It’s like being at a session of live coding. The example are well chosen: easy to grasp, yet realistic enough to illustrate common real-world problems.
I would recommend this book to anyone willing to be refreshed on modern unit-testing best practices. If you haven’t gotten huge value from your testing yet, then this book will help you. No prior experienced with Java 8 or any testing framework is required.