-
Book Review: Next Generation Java Testing (21 messages)
- Posted by: Joseph Ottinger
- Posted on: October 31 2007 13:38 EDT
"Next Generation Java Testing," written by Cedric Beust and Hani Suleiman, focuses on two primary subject areas: TestNG and the application of testing patterns. Programmers who can't use TestNG will still find the book useful because many of TestNG's capabilities are being adopted by other testing frameworks, and because the patterns explained in the book are applicable to making any codebase more testable. The book is written very well. Both Cedric and Hani are prolific writers, and they write with a style that is very information-rich and readable. They manage to communicate to readers of all levels: experienced programmers looking for "meat" and less-experienced programmers trying to understand how to leverage testing frameworks. The book opens with a discussion of Junit 3, the testing framework most commonly encountered in Java. It covers not only Junit's capabilities, but its flaws as well, which laid the groundwork for TestNG. The first chapter explains some of the mindsets used when writing code for testability, and also introduces TestNG. Believe it or not, after the first chapter, readers will be able to use TestNG to some degree, at least matching the normal uses one finds for Junit 3. This kind of content-rich delivery is what makes the book so useful. The second chapter, "Testing Design Patterns," walks through testing for failures (a concept that Junit tends to invert), data-driven testing, asynchronous and multithreaded testing, test groups, code coverage, and the use of mocks and stubs for code that isn't meant to be tested (or ready to be tested.) The first and second chapters together make up an impressive book in and of themselves. The third and fourth chapters ("Enterprise Testing" and "Java EE Testing," respectively) introduce the concept of testing in-container and out-of-container for enterprise Java applications. Most testing at this level focuses on integration – integration of simpler, unit-tested code into larger frameworks, or integration of legacy code into newer codebases (or vice versa.) Enterprise testing can be both easier and harder than unit testing. Chapter three introduces a methodology, participants, and a sample application flow used as the basis for tests – and also describes a way of testing the application flow, including many refactorings. The fourth chapter discusses how to test Java EE components in-container. It includes code to find TestNG tests in a web application, and walks through almost the entire Java EE specification – JMS, JTA, servlets, EJBs, JAX-WS, JDBC, and JNDI, for example, although even this list isn't complete. The fifth chapter, "Integration," covers extensions for Junit 3 and their use in TestNG. Examples include Spring, DbUnit, and HtmlUnit. Chapter six is about extending TestNG. The seventh chapter, "Digressions," looks at some of the other issues around testing: exception handling, stateful tests, test-driven pitfalls, private methods, encapsulation, debuggers, and logging. All in all, this book is extremely well-written, and is very useful as a reference not only for TestNG but for designing code that's easy to test. The authors speak from experience, both being advanced and senior developers, and they do so in such a way that the prose is very accessible to all readers. Highly recommended.Threaded Messages (21)
- Re: Book Review: Next Generation Java Testing by Adrian Mitev on October 31 2007 20:54 EDT
- Re: Book Review: Next Generation Java Testing by Joseph Ottinger on November 01 2007 04:45 EDT
- Yes there is if you attended oopsla2007 by Baha As on November 02 2007 10:30 EDT
- whither the netbeans plugin by Chuck Adams on November 01 2007 18:24 EDT
- Re: whither the netbeans plugin by Ilya Sterin on November 01 2007 06:44 EDT
- Re: whither the netbeans plugin by Hani Suleiman on November 01 2007 07:46 EDT
- you can use Testng with Netbeans by carol mcdonald on November 07 2007 06:05 EST
- Re: Book Review: Next Generation Java Testing by Joseph Ottinger on November 01 2007 04:45 EDT
- Re: Book Review: Next Generation Java Testing by jelmer kuperus on November 01 2007 15:22 EDT
- Re: Book Review: Next Generation Java Testing by Tim Drury on November 02 2007 10:21 EDT
- Re: Book Review: Next Generation Java Testing by Race Condition on November 01 2007 15:48 EDT
- Re: Book Review: Next Generation Java Testing by array bai on November 01 2007 20:30 EDT
- What about Parallel Distributed Unit Testing? by Dmitriy Setrakyan on November 03 2007 03:31 EDT
- Re: What about Parallel Distributed Unit Testing? by Ilya Sterin on November 03 2007 12:12 EDT
-
Re: What about Parallel Distributed Unit Testing? by Nikita Ivanov on November 03 2007 03:05 EDT
-
Re: What about Parallel Distributed Unit Testing? by Martin Gilday on November 05 2007 09:36 EST
-
Re: What about Parallel Distributed Unit Testing? by Dmitriy Setrakyan on November 05 2007 11:03 EST
-
Re: What about Parallel Distributed Unit Testing? by Cedric Beust on November 05 2007 04:01 EST
- Re: What about Parallel Distributed Unit Testing? by Nikita Ivanov on November 06 2007 04:19 EST
- Re: What about Parallel Distributed Unit Testing? by Nguyen Anh Tuan on November 15 2007 11:44 EST
-
Re: What about Parallel Distributed Unit Testing? by Cedric Beust on November 05 2007 04:01 EST
-
Re: What about Parallel Distributed Unit Testing? by Dmitriy Setrakyan on November 05 2007 11:03 EST
-
Re: What about Parallel Distributed Unit Testing? by Martin Gilday on November 05 2007 09:36 EST
-
Re: What about Parallel Distributed Unit Testing? by Nikita Ivanov on November 03 2007 03:05 EDT
- Re: What about Parallel Distributed Unit Testing? by Ilya Sterin on November 03 2007 12:12 EDT
- Re: Book Review: Next Generation Java Testing by Hans Schwaebli on November 05 2007 10:28 EST
- electronic (pdf) version by Mahesh Lavannis on May 11 2009 21:01 EDT
-
Re: Book Review: Next Generation Java Testing[ Go to top ]
- Posted by: Adrian Mitev
- Posted on: October 31 2007 20:54 EDT
- in response to Joseph Ottinger
Are there any free chapters? -
Re: Book Review: Next Generation Java Testing[ Go to top ]
- Posted by: Joseph Ottinger
- Posted on: November 01 2007 04:45 EDT
- in response to Adrian Mitev
Not yet. -
Yes there is if you attended oopsla2007[ Go to top ]
- Posted by: Baha As
- Posted on: November 02 2007 10:30 EDT
- in response to Joseph Ottinger
If you attended oopsla2007, they provide a book with sample chapters from many already published and coming soon books. In it, they offer chapter 3 of that book which I happen to be reading this morning. All I can tell you it's a very intersting and well written book. -
whither the netbeans plugin[ Go to top ]
- Posted by: Chuck Adams
- Posted on: November 01 2007 18:24 EDT
- in response to Adrian Mitev
I seriously love TestNG, but the only decent IDE support I've seen for it is the eclipse plugin. All I know about is an outstandingly crappy, long-abandoned plugin for Netbeans 5.x, and a completely empty google code project. Is there any plan to improve the IDE support? For me, a test framework without IDE support is like an IDE without a compiler. -
Re: whither the netbeans plugin[ Go to top ]
- Posted by: Ilya Sterin
- Posted on: November 01 2007 18:44 EDT
- in response to Chuck Adams
I seriously love TestNG, but the only decent IDE support I've seen for it is the eclipse plugin. All I know about is an outstandingly crappy, long-abandoned plugin for Netbeans 5.x, and a completely empty google code project. Is there any plan to improve the IDE support? For me, a test framework without IDE support is like an IDE without a compiler.
There is very good IntelliJ support for TestNG. For me, IDE without IntelliJ == IDE without a compiler:-) -
Re: whither the netbeans plugin[ Go to top ]
- Posted by: Hani Suleiman
- Posted on: November 01 2007 19:46 EDT
- in response to Chuck Adams
Hi Chuck, Yeah, I wish someone would step up and help out with a netbeans plugin! FYI IDEA 7 has TestNG support included out of the box, so its not even an external plugin anymore, but part of the product. -
you can use Testng with Netbeans[ Go to top ]
- Posted by: carol mcdonald
- Posted on: November 07 2007 18:05 EST
- in response to Chuck Adams
you can use Testng with Netbeans http://blogs.sun.com/glassfishqa/entry/testng_with_netbeans -
Re: Book Review: Next Generation Java Testing[ Go to top ]
- Posted by: jelmer kuperus
- Posted on: November 01 2007 15:22 EDT
- in response to Joseph Ottinger
I am sure your fellow #java op appreciated you posting this review to the Serverside epesh -
Re: Book Review: Next Generation Java Testing[ Go to top ]
- Posted by: Tim Drury
- Posted on: November 02 2007 10:21 EDT
- in response to jelmer kuperus
Instead of making a knee-jerk assumption that the review is biased, you could read the book yourself and then refute Joe's review. -
Re: Book Review: Next Generation Java Testing[ Go to top ]
- Posted by: Race Condition
- Posted on: November 01 2007 15:48 EDT
- in response to Joseph Ottinger
Testing is for suckers. -
Re: Book Review: Next Generation Java Testing[ Go to top ]
- Posted by: array bai
- Posted on: November 01 2007 20:30 EDT
- in response to Joseph Ottinger
Many project provide test method based on junit. Why not TestNG merge into Junit 4? -
What about Parallel Distributed Unit Testing?[ Go to top ]
- Posted by: Dmitriy Setrakyan
- Posted on: November 03 2007 03:31 EDT
- in response to Joseph Ottinger
I wonder if this book mentions anything about continuous integration or distributing long running tests across a topology of nodes. I know TestNG has some level of support for it, albeit primitive. With emergence of continuous integration, a vast majority of projects nowadays run rich suites of regression tests which take hours to complete. Ouch! Why wait hours when you can wait minutes? GridGain, with its 1.6.0 release, added full support for parallelizing and distributing JUnit3 or JUnit4 tests across the grid. By simply attaching @Gridify annotation to your regular JUnit TestSuite you will be able to break your TestSuites into sub-suites and run them in parallel on remote nodes - no extra ant scripts or deployment steps required (GridGain takes care of all deployment and class-loading automatically). Check out the documentation and coding examples here. Best, Dmitriy Setrakyan GridGain - Grid Computing Made Simple -
Re: What about Parallel Distributed Unit Testing?[ Go to top ]
- Posted by: Ilya Sterin
- Posted on: November 03 2007 12:12 EDT
- in response to Dmitriy Setrakyan
I wonder if this book mentions anything about continuous integration or distributing long running tests across a topology of nodes. I know TestNG has some level of support for it, albeit primitive.
Let the marketing begin.
With emergence of continuous integration, a vast majority of projects nowadays run rich suites of regression tests which take hours to complete.
Ouch! Why wait hours when you can wait minutes? -
Re: What about Parallel Distributed Unit Testing?[ Go to top ]
- Posted by: Nikita Ivanov
- Posted on: November 03 2007 15:05 EDT
- in response to Ilya Sterin
Agree. A bit of marketing. Despite being obviously biased on this subject I think distributed unit test execution on the grid is the next big thing in the testing. We are seeing almost daily how 1 hour test runs basically destroy the whole notion of continues integration making it mostly useless. Grid enabling of the build and unit testing specifically is the only possible solution to this problem, literally bar none. Nikita Ivanov. GridGain - Grid Computing Made Simple -
Re: What about Parallel Distributed Unit Testing?[ Go to top ]
- Posted by: Martin Gilday
- Posted on: November 05 2007 09:36 EST
- in response to Nikita Ivanov
Is it possible to run distributed tests that use externalised test data? We have a number of data driven tests which first source test data using JDBC into a database before performing assertions on the state of the database afterwards. If you installed mysql etc on each node can you distribute this type of test? -
Re: What about Parallel Distributed Unit Testing?[ Go to top ]
- Posted by: Dmitriy Setrakyan
- Posted on: November 05 2007 11:03 EST
- in response to Martin Gilday
Is it possible to run distributed tests that use externalised test data? We have a number of data driven tests which first source test data using JDBC into a database before performing assertions on the state of the database afterwards. If you installed mysql etc on each node can you distribute this type of test?
Absolutely! GridGain makes not restrictions about your tests at all. Just think of them as your local tests. GridGain also gives you advanced support for test sequencing, so you can sequence your tests as you like, even on remote nodes, by simply properly grouping them into regular JUnit TestSuites. You can watch the online demo here Best, Dmitriy Setrakyan GridGain - Grid Computing Made Simple -
Re: What about Parallel Distributed Unit Testing?[ Go to top ]
- Posted by: Cedric Beust
- Posted on: November 05 2007 16:01 EST
- in response to Dmitriy Setrakyan
So, Nikita and Dmitriy, how did you like our book? -- Cedric -
Re: What about Parallel Distributed Unit Testing?[ Go to top ]
- Posted by: Nikita Ivanov
- Posted on: November 06 2007 04:19 EST
- in response to Cedric Beust
So, Nikita and Dmitriy, how did you like our book?
Hi Cedric, Book is on its way :-) So, can't comment on it yet. As far as TestNG – I wish we could all switch to it. TestNG grid-enabling is high on our to-do list and I know you guys looked at it already. Best, Nikita Ivanov. GridGain – Grid Computing Made Simple
--
Cedric -
Re: What about Parallel Distributed Unit Testing?[ Go to top ]
- Posted by: Nguyen Anh Tuan
- Posted on: November 15 2007 11:44 EST
- in response to Cedric Beust
Cedric, I've just received the book 2 days ago and now I'm reading chapter 1. My first feeling is the book is written well, short but concise :-) But I cannot find where to download the source code for the book. Can you help me to kkow where can I get it? Thanks. --- t800t8 -
Re: Book Review: Next Generation Java Testing[ Go to top ]
- Posted by: Hans Schwaebli
- Posted on: November 05 2007 10:28 EST
- in response to Joseph Ottinger
"Next Generation Java Testing"? I am in the JUnit generation. -
electronic (pdf) version[ Go to top ]
- Posted by: Mahesh Lavannis
- Posted on: May 11 2009 21:01 EDT
- in response to Joseph Ottinger
IS there any place I can buy a pdf version of this book? (It is so much easier to work with a pdf than a hard copy) Please let me know. Thanks.