“Next Generation Java Testing” on the way


Cedric mentioned today that the book he and Hani have been working on, Next Generation Java Testing, is now available for pre-order on Amazon.

I was a technical reviewer on this book way back in March and in general I would give it high marks. The book covers Test NG, patterns of unit testing, Java EE testing, performance testing, mocks, how to deal with external resources like databases and legacy systems, tools, etc. Generally, if you have questions on developer testing, I think you can probably find something in here about it. Having done a lot of developer testing myself, I have a lot of thoughts on the subject and I think the patterns section in particular should be essential reading for new developers just starting to write unit tests.

For readers of Hani’s Bile Blog, you will recognize the opinionated nature of some of the advice. Obviously, it’s toned way down but there were some sections (most notably those in the Digressions chapter) that seemed more like rants than advice and were only lightly backed by evidence. I still enjoyed reading those sections even when I didn’t agree. Hopefully some of those sections have been fleshed out a tad more in the final revision.

At the beginning, I thought the book suffered a bit from being both a “TestNG book” and a more generic “developer testing handbook” but by the end I could see that these subjects are inseparable for the authors as they are working to make TestNG solve the problems they’ve found while doing developer testing. As a long-time JUnit user (and a TestNG newbie), I must admit that I found TestNG compelling for many reasons as I read the book. Ultimately, the strongest parts of the book are those that describe general testing techniques and problems. To their credit, JUnit is covered extensively throughout the book and typical JUnit solutions to the problems they discuss are covered as well (along with usually better solutions in TestNG).

I think on the whole the advice given is good and well-reasoned and I would recommend the book to any developer. I think it would be most useful to younger developers still honing their testing skills, but I think there is something in this book for even the most seasoned developer. A thorough understanding of developer testing is a requirement for any working developer today and this book covers the space admirably.


8 Responses to ““Next Generation Java Testing” on the way”
  1. Alex Popescu says:

    You must admit that Hani’s style may trick you from time to time and finally get to your subconscious :-).
    IMO (but I may be biased a bit) the book is very well balanced and most of the advise are of high quality.



    .w( the_mindstorm )p.
    TestNG co-founder
    EclipseTestNG Creator

  2. Any coverage of more interesting testing techniques like Haskell’s QuickCheck (which has ports to other languages)?

  3. Alex says:

    I don’t think QuickCheck has been ported to Java and it’s definitely a Java-focused book (as the title says). I can’t recall any specific coverage of automated randomized testing, although the book certainly covers data-driven testing and various forms of system testing in general. I’ve certainly written random data generation stuff in the past to work with JUnit and that should be even easier with TestNG.

    Actually I spent some time at MetaMatrix writing a tool that generated random SQL statements from metadata and submitted them against a set of dbs (different vendors and our own virtual db) to compare results and timings. Fun stuff. Never got around to finishing it though.

  4. Cedric says:

    Ricky, Alex,

    I actually didn’t know about QuickCheck and unfortunately, the main site (chalmers.se) doesn’t seem to be up. Do you have any other link I could take a look at?

    Oh and thanks for the nice comments on the book!


  5. Alex says:

    I don’t know much about it but the pingback in my comments may be of interest – http://adams.id.au/blog/2007/09/next-generation-java-testing/.

    The chalmers site seems to be up for me.

  6. Steve says:

    I’ve found 2 quickcheck-like testing frameworks for java, both currently in development: http://wiki.java.net/bin/view/Projects/QuickCheck and http://qc4j.sf.net/


Check out what others are saying about this post...
  1. […] “Next Generation Java Testing” on the way- Those cats can write a slick book, baby. […]

  2. […] Via Alex via Andy, Hani and Cédric have announced that their book Next Generation Java Testing is available for pre-order. […]