|
Plenty of books give an introduction to Test Driven Development, but don't get a lot further than explaining JUnit and giving a few examples. While this is helpful, they offer little more than what can be gleaned by scouring the internet. On the other hand, you may be wondering if you can manage a book devoted entirely to TDD, which can easily devolve into walk throughs of frameworks for applications irrelevant to your needs, which is mainly: given that you're persuaded TDD is a good idea, how do you go about doing it for more than trivial examples? This book comes up with the goods. As expected, there's an introduction to agile techniques, and an overview of JUnit, but this goes further, and gives an overview of several JUnit extensions, which is very helpful for those seeking ways to extend their testing. The other two important introductory chapters are on Mock objects and testing GUIs. The section on mock objects is useful (and rarely touched upon in more introductory texts), although I would say that the treatment by Johannes Link in Unit Testing In Java (which has a similar scope) is better. The really great part of this book, however, is the 200 page step-by-step tutorial in TDD with JUnit, building a simple GUI application for storing films, and their reviews and rating. The conversational tone of the writing is very effective in illustrating the decisions in how to decide what to test next, and how to do it. If you don't 'get' TDD, this section is a must-read and the most valuable part of the book. Jeff Langr's Agile Java very successfully covers a lot of the ground in this book, but also attempts to teach Java 5.0 at the same time, so this book is more focussed. It's probably not essential reading if you've read Langr's book, but this book does cover more. If you've also read Unit Testing in Java (or have read that book and are wondering if you should pick this one up too), then you probably don't need to read both. Either one should suit your needs admirably. There is perhaps not enough difference between them to justify getting both, but if money is no object, then they complement each other well - Link's book covers more applications (e.g. databases, networks, web servers), and is better for its treatment of mock objects, while this book has more depth on testing GUIs and JUnit extensions and unit testing frameworks in other languages. The tutorial is the meat of the book, however, and is worth the price.
|