Mastering Unit Testing Using Mockito and JUnit

Front Cover
Packt Publishing Ltd, Jul 15, 2014 - Computers - 314 pages
A practical and easy-to-follow, yet comprehensive, guide to learning advanced JUnit testing. Each topic is explained and placed in context, and for the more inquisitive, there are more details of the concepts used. This book is for you if you are a developer with some experience in Java application development as well as a basic knowledge of JUnit testing. But for those whose skill set is void of any prior experience with JUnit testing, the book also covers basic fundamentals to get you acquainted with the concepts before putting them into practise.

What people are saying - Write a review

User Review - Flag as inappropriate

This book has its pros (real life trips and tricks, best practices, describing tools and methods) and cons (not very well organized chapters, too broad range of topics).
Chapters about JUnit and
Mockito are very thorough, but I guess miss their audience. They are too fast for a beginner, but too slow for an experienced professional. I guess they can be useful if you treat them as a comprehensive kind of "reference guide". Sometimes I thought that the book relies too heavily on Mockito's argument captors - even though the author mentions that this is not a good practice, as they create fragile test cases.
Chapters on unit testing the web and data tier - even though it is a really nice idea to discuss these topics in a book like this, mixing in Spring is a bit too much.
Chapters 9 and 10 are the best part of the book, where the author offers practical, real life solutions to everyday problems of a maintenance guy (testing spaghetti code - logic and GUI components mixed together, final classes, global, static state). Those things are very well described and exemplified, they can come in real handy for the inexperienced. The book also offers a very good overview on all the different reasons why a piece of code becomes hard to test.

Selected pages

Other editions - View all

Common terms and phrases

About the author (2014)

Sujoy Acharya works as a software architect with Siemens Technology and Services Pvt Ltd. (STS). He grew up in a joint family and pursued his graduation in Computer Science and Engineering. His hobbies are watching movies and sitcoms, playing outdoor sports, and reading books. He likes to research upcoming technologies. His major contributions are in the fields of Java, J2EE, SOA, Ajax, GWT, and the Spring framework. He has authored Test-Driven Development with Mockito, Packt Publishing. He designs and develops healthcare software products. He has over 10 years of industrial experience and has architected and implemented large-scale enterprise solutions.

Bibliographic information