Meera has posted 70 posts at DZone. You can read more from them at their website. View Full User Profile

Book Review: Java Power Tools

05.27.2008
| 26348 views |
  • submit to reddit
Published by: O'Reilly
ISBN: 0596527934

Reviewer Ratings

Relevance:
5

Readability:
5

Overall:
5

Buy it now

One Minute Bottom Line

From the day I interviewed John Smart on this book for Javalobby, I was very eager to read and review this book. I was just amazed by the number of tools John had covered. After having finished reading the book, I should say I was just blown away seeing how thoroughly John covered each and every tool; and to top it off, all the tools the author has covered in this book are open source.

The book is enjoyable, extremely well organized and covers a wide range of open source tools needed for any successful software development life cycle. I would recommend Java Power Tools to anyone writing Java. However my one complaint would be the 910 pages, while the book may be more than 5 pounds, it made up for its huge size with its thorough content and good examples.

Review

This book is organized into sections, and each section covers a particular aspect of software development life cycle. Within each section, John covers a number of open source tools.

Build Tools

John starts off this section by describing the most fundamental and if I could say the most primitive build tools and later introduces us to the two most popular ones in Java; Ant and Maven. Chapter 1, Setting up a project using Ant, starts of by showing how to install Ant on various operating systems, followed by compiling, running unit tests, generating Javadoc, packaging, deploying and bootstrapping your application. Next the author covers using Ant in IDE’s like Eclipse and NetBeans and concluding with a section on manipulating XML with XML task. John has included many best practices that should and will make the build scripts clean and readable.

Maven comes next, in chapter 2. This chapter has almost 100 pages, and covers everything the reader needs to understand about Maven. All the details covered in Chapter 1 with Ant are described in detail about Maven here.

Version Control Tools

This section goes in detail into two most popular version control tools; CVS and Subversion. I have used Subversion, but had never used CVS. So, this chapter gave a good overview of CVS. It covers most things needed to do with any source control repository, like setting up, creating a new project, checking out a project, committing source files, creating branches, merging and so on.

Continuous Integration

Four of the most popular open source CI tools are covered in this section; Continuum, CruiseControl, LuntBuild, and Hudson. In each of these CI tools, John goes into detail about installing, managing, configuring and scheduling builds, managing users and tasks which are specific to each tool as well.

An additional bonus chapter in this section is about setting up an instant messaging platform with Openfire. Following the installation and setting up of OpenFire, the chapter proceeds with using Openfire with CI tools such as Continuum, CruiseControl, Luntbuild. The chapter concludes with discussions of sending Jabber messages from a Java application using Smack API, detecting presence and receiving messages using the Smack API.

Unit Testing

The section starts with a discourse on good testing and advantages of unit tests, and how it drastically increases the quality and reliability of your code. Next John talks about the best practices regarding unit tests, the section proceeds with two most popular tools used for unit testing; JUnit and TestNG.

In each of these tools, you will learn how to create simple tests, parameterize tests, using each of these tools with build tools like Ant and Maven. The chapter also discusses using both JUnit and TestNG within Eclipse. Within the JUnit chapter, John mentions about a tool called Hamcrest. If you want your tests to be more readable, more expressive of what they are asserting, and above all more BDD like, you can easily achieve all these with the Hamcrest library. Here is a sample code from the book of how JUnit asserts make a difference when used with Hamcrest:

    @Test
public void hamcrestAssertHasItems(){
List<String> colors = new ArrayList<String>();
colors.add("red");
colors.add("green");
colors.add("blue");
assertThat(colors, hasItems("red","blue"));
assertThat("red", isIn(colors));
}

@Test
public void hamcrestAssertHasItemInArray(){
String[] colors = new String[] {"red","green","blue"};
assertThat(colors, hasItemInArray("blue"));
}

@Test
public void hamcrestAssertIsIn(){
String[] colors = new String[] {"red","green","blue"};
assertThat("red", isIn(colors));
}


@Test
public void hamcrestAssertIsRedOrBlue(){
String color = "red";
assertThat(color, anyOf(is("red"),(is("blue"))));
assertThat(color,is(String.class));
}

@Test
public void hamcrestIsClass(){
List myList = new ArrayList();
assertThat(myList,is(Collection.class));
}

This section concludes with a chapter on maximizing test coverage with Cobertura. The chapter begins with an introduction to Cobertura. Following the introduction, the chapter proceeds with running Cobertura with Ant, checking the coverage, generating reports, integrating the coverage tests with a Maven build process, and concludes by showing how to use code coverage with Eclipse. If you haven’t been using any coverage tool with your build process, this is the chapter which will give you every detail you need to integrate one.

Integration, Load, and Performance Testing

In this section John gives an overview of why unit tests are not sufficient by themselves, and what role integration testing, performance testing, and load testing have and how they can benefit when they are integrated within our SDLC.

If you are using Struts in your application, there is a complete chapter dedicated to testing a struts application with StrutsTestCase. If your application uses a Database, the next chapter discusses the main purpose of DbUnit, gives some examples of how to use it, and concludes by showing some different aspects of DbUnit and database testing like:

1. Injecting the Test Fixture
2. Testing a Stored Procedure
3. Testing a View
4. Exporting and Importing a Dataset with Ant

Chapter 15 and 16 are dedicated to Performance testing. In these two chapters John covers JUnitPref and JMeter.

The next chapter covers one of my favorite tools for testing web services; SoapUI. The chapter introduces SoapUI, and how to install it. Next the author covers functional and load testing with SoapUI and concludes with various sections on running these tests from the command line, Ant, Maven and finally integrating with your CI.

If you want to profile and monitor your Java applications, the next two chapters discuss ways to use jConsole to monitor and analyze Java application performance on local as well as remote machines. On the other hand, if you want to profile Java applications within an IDE, John shows how to do this as well by using the Eclipse Test & Performance Tools Platform or TPTP.

This section on testing concludes with a chapter on testing user interfaces. In this chapter, Selenium and Fixtures for Easy Software Testing called FEST are discussed in detail. Selenium uses a web browser to run tests against your web application. FEST is used to integrate Swing testing as part of your JUnit and TestNG tests.

Quality Metrics Tools

There are various benefits to executing a series of common code metrics across code bases. Fortunately, in the Java world there are a few high quality, open source code metric tools that integrate with Ant and Maven as well quite nicely. The first 3 chapters of this section looks at CheckStyle, PMD, FindBugs and Jupiter. These are the most popular automated tools that measure different aspects of code quality. In each of these tools, John shows how to use the tool within Eclipse, configuring, generating a report and using them with Ant and Maven.

Next in this section is a chapter on Jupiter, in which John walks you through a Jupiter install and the stages of a Jupiter code review process.

If you want to use integrated task management and see all the tasks you are working on, John has this covered as well. This chapter walks you through Mylyn, and how to use it within the Eclipse IDE.

Previous chapters of this section showed how to use many of the metric tools such as PMD, Checkstyle, FindBugs, and also generate detailed reports from each one fo them. However, if you wish to see how these statistics are evolving over the lifetime of a project, this chapter has it covered as well. QALab collects data from tools such as static analysis and coverage and reports on the evolution of these statistics over time. This chapter covers using QALab with Ant and Maven. There is also a section in this chapter which discusses source code management metrics with StatSCM, this covers both CVS and SVN.

Issue Management Tools

This section has two chapters; Bugzilla and Trac- Lightweight Project Management. I was not familiar with either one of these two tools.

Technical Documentation Tools

This last section covers several tools that can help automatically generate up to date documentation about your project. The first chapter covers Maven 2 project web site. The next one covers three tools that can be used to generate high-quality graphical representations of your project design and architecture. The three tools covered in this chapter are

1. SchemaSpy for database models.
2. Doxygen and
3. UmlGraph for UML-based source code documentation.

 

Published at DZone with permission of its author, Meera Subbarao.

(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)

Comments

Michael Hüttermann replied on Tue, 2008/05/27 - 12:08pm

I like the book .. actually it is a bit similar to my German book I've written (Agile Java-Entwicklung in der Praxis, O'Reilly). I also did introduce a couple of tools and how to use them in an agile way .. but only one tool for a given problem. I understand the decision to limit the tool choice to open source tools .. but this is ambivalent .. you explained four CI tools .. are they all power tools? I would have added TeamCity too to this set .. it is possibly the best one .. and freely available in the professional edition. Limiting on open source tools is also ambivalent in the IDE section .. Eclipse and Netbeans .. if you discuss all major mainstream IDEs then I also miss IntelliJ IDEA here .. 

Cheers!

Michael 

Meera Subbarao replied on Tue, 2008/05/27 - 6:37pm

Hi Michael,

The book has a section called "What This Book Doesn't Cover" in the preface. John does mention about IntelliJ and TeamCity in the last paragaph and says that "At the time of this writing, both of these companies offered free licensing arrangements for open source products".

Hope this answers your question.

Michael Hüttermann replied on Wed, 2008/05/28 - 3:33am

Hi Meera,

thanks for your reply. Actually my post was not a question, it was just a comment. ;-) I know that the book focuses on open source tools .. and it does a great job. It is just ambivalent for me to discuss e.g. a hand full of CI servers and do miss possibly the best one .. especially it is even available for free (in the professional edition) as you and the author also point out. Similar in the IDE part where two major players are discussed and the third one missed out. 

It is always hard to build up some kind of decision tables because every project is different .. so in my book I did not mention a couple of competitors in one area .. I just explain one product for solving a problem and that in detail also mentioning other products though. This helps to introduce a complete infrastructure in the necessary details also explaining how to use those tools in an agile way. 

Have a nice day! :-)

Michael

Meera Subbarao replied on Wed, 2008/05/28 - 6:04am

Hi Michael,

I am really curious about your book. I don't remember getting any updates about your book from any of our publisher contacts here at Javalobby. If you have an English version, let me know. I will review it. :)

Michael Hüttermann replied on Thu, 2008/05/29 - 1:48pm in response to: Meera Subbarao

perhaps you may point those publisher contacts to the book ... actually it is a must to translate it .. perhaps in a customized form .. there is still no comparable book on the English language market similar to my book .. and most of all .. it would be a big honour to be reviewed by you. :-) 

Michael 

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.