About the Reviewer
Meera Subbarao has a Bachelors degree in Electronics and Communication Engineering and seventeen years of software programming experience around the globe, from Bangalore,India to Dubai,United Arab Emirates, to the United States. She has spent the past six years at DataSource, Inc. in Maryland and has been working on J2EE technologies exclusively for the last five years.  She is a Sun Certified Java Programmer as well as a Sun Certified Web Component Developer. Meera is also the Team Leader for the Javalobby/dzone book review team.
Spotlight Features

The Rich Engineering Heritage Behind Dependency Injection

Andrew McVeigh takes us on a tour of the rich heritage behind dependency injection, what it represents, and tells us why its here to stay.

NetBeans 6: Matisse Updates

NetBeans 6 delivers great updates to the Matisse GUI builder. Spend a few minutes with Roman Strobl and get an expert briefing on what's new and what has changed.

Introduction to Groovy Part 3

In this, the third and final installation of Andres' Introduction to Groovy series, you learn about how Groovy handles variable numbers of arguments, named parameters, currying, and more about Groovy operators. Including, some new operators.

Easier Custom Components with Swing Fuse

Swing Fuse (actually just Fuse), is a framework designed to make it easier to create your own custom desktop components. In this article, Daniel Spiewak shows you how to get started and provides sample source code you can download.

Benchmark Analysis: Guice vs Spring

Willam Louth shows how he uses JXInsight Probes to investigate probable performance issues with code bases that he is not familiar with. He also highlights possible pitfalls in creating a benchmark, as well as in the analysis of results.

PMD Applied

Author(s): Tom Copeland
Publisher: Centennial Books
PubDate: 2005
Reviewer: Meera Subbarao






One Minute Review

Pros

  • Gives a wide-ranging coverage on PMD in just 200 pages.
  • Simple and straightforward presentation.
  • Lots of examples.

Cons

  • Not applicable for non-Java developers.

Purpose & Audience

When I was first asked to review this book, I looked up on the internet to find the meaning of PMD and found some interesting backronyms as it's called by Tom; a few to name which made me giggle were: Project Mess Detector and Programs of Mass Destruction; more can be found at this location: http://pmd.sourceforge.net/meaning.html

PMD is a Java Static code analysis utility written by Tom Copeland along with his team members called David Dixonpeugh and David Craine.  PMD can be used to find potential problems in Java source code like empty try/catch finally statements, unused variables, duplicated code and much more. This book with around 200 pages covers everything a programmer needs to use PMD. PMD is integrated with various IDE's and the ones I tried were plug-ins for Eclipse, JDeveloper and NetBeans and it was very easy to configure these IDE's to run PMD. The Author has lots of helpful notes on writing rules in PMD using XPath as well as Java.

This book is primarily intended for Java developers, except for the Copy Paste Detector, it's just not applicable for other developers.

Relevance of material

PMD Applied was everything I was hoping for - it is the authoritative reference on how to use PMD.  The reader can get a complete working knowledge of PMD and can easily integrate with any IDE or Ant/Maven.

How does this book help?

This book should help Java developers to write better code. PMD can highlight sections of code where some special attention needs to be given.

Chapter highlights

Chapter 1 discusses about what PMD is, a short history of how PMD's life began, how the book is organized and acknowledgements.

Chapter 2 will help the reader to download and install PMD and run the same from the command line. It shouldn't take more than 15 minutes to get started once you are done with this chapter to get PMD installed and running.

Chapter 3 If you have been using Ant as your build tool, this chapter demonstrates how to run PMD from Ant; it also discusses many options available as part of the Ant task. The author wraps up this chapter with a brief look at Maven.

Chapter 4 the author discusses how you can configure various IDEs to run PMD. As I mentioned in my Introduction I tried plug-ins for some popular IDEs and it was just a matter of minutes to download and run them.

Chapter 5 focuses on PMD's duplicate code detector called Copy/Paste Detector (CPD); you will learn how to use CPD from the command line, from a GUI as well as from an Ant build file.

Chapter 6 The author in less than 4 pages explains best practices to consider while using PMD. If you are considering using PMD for your development team, you need to read this chapter.

Chapter 7 will appeal to all readers who wish to write custom rules based on their project needs and integrate it very easily with PMD. The user will be effectively able to build custom rule sets, write their own rules; using two general mechanisms XPath and creating a Java class.  At the end of this chapter the author explains how to use the symbol table to deal with complex problems. This indeed is a very interesting chapter if you are seriously going to use PMD; so don't skip this.

Chapter 8 PMD being open source, you will be able to customize PMD based on your needs. In this chapter the author demonstrates how to download, compile the PMD source and also discusses creating a new report. Later in the chapter you get to use CPD to check for duplicate code in a new language.

Chapter 9 gives more technical details about PMD like the compiler concepts, building the symbol table, data flow analysis and XPath generation.

Chapter 10 reviews some of the other open source tools which are available and also discusses their activities, feature set, licenses and so forth.

Appendix. The appendix being almost 70-75 pages reviews all the built-in PMD rulesets and rules. I recommend reading this without fail.

Comparison

No other similar book available for comparison.

Rating

This is a book for Java Developers, even though the author demonstrates how to use CPD with other languages. I would give it a rating of 9/10. As mentioned earlier even though being a small book it has all the necessary details a programmer would need if they decide to use Code Analysis Tool like PMD.

Last but not the least I would say "PMD is a very simple but powerful tool which can be integrated with all major IDEs in a couple of minutes. So give it a try. You will be surprised to see the results". A must have book in all Java development teams.

Relevance
Readability
Overall  

Resources / Links

  1. Free download is available at : http://pmd.sourceforge.net
  2. PMD Applied web site: http://pmdapplied.com