This week's book giveaway is in the OCMJEA forum. We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line! See this thread for details.
Part one sets the stage. It walks you through a hypothetical teams journey - no tests → tests → test driven! I liked the examples of bad code and bad test examples. And I really like the explanation of different types of test doubles. I also liked the example of jMock vs Mockito to do the same thing.
Part two shows you a series of test smells and how to fix them. One of my favorites is something really simple. How to make a bowling example more readable by using method names so you can embed "magic values" in the code. I also particularly liked the segment on how parameterized tests can be an anti-pattern along with how to avoid this problem.
Part three is "other things." It covers using other JVM languages to test and how to make your tests faster. Both via the tests and running them in the cloud. I really liked the part on how to profile in both Ant (which I knew) and Maven (which I haven't needed to yet.)
While there is an appendix to get you up to speed on JUnit, you should read a different book if you are trying to get up to speed on JUnit. I recommend "JUnit in Action" or "Test Driven" for that. Once you know any unit testing framework, it is time to come back to this book so you can write better tests.
It was a great book. My only problem was that having seen the session some was repetitive. But I highly recommend both the book and the talk.
Disclosure: I received a copy of this book from the publisher in exchange for writing this review on behalf of CodeRanch.