PMD Applied
Simon P. Chappell writes "It's a fundamentally agreed fact within our industry that code reviews are good. Really good. Sliced bread good. But have you actually tried organizing one? If you can get everyone together that needs to be there at the same time in the same meeting room, then you still have the challenge of trying to keep a roomful of geeks from getting trapped in minutiae and squabbling over details like formatting conventions. Well, what if I told you that you could get your code reviews done in less than five minutes and that there would be no arguing? Enter PMD, an open-source Java static analyzer. Think of it as a code review in a box. As if that weren't wonderful enough, there's even a book, PMD Applied, written by Tom Copeland, the author of PMD." Read on for the rest of Simon's review.
PMD Applied
author
Tom Copeland
pages
221
publisher
Centennial Books
rating
9
reviewer
Simon P. Chappell
ISBN
0976221411
summary
A good book if you use or are considering using PMD for static analysis of Java code
I hope that it's not too much of stretch to suggest that this book is primarily written for users of PMD. That said, I actually purchased it (yup, this one wasn't a freebie) because I was considering a recommendation to use PMD as part of the build process at a previous employer. This is not a slam on the documentation on the PMD website, but Mr. Copeland was offering signed editions of the book if you pre-ordered and I wanted to add to my growing collection of books signed by the author. (No contest; geeky as charged.)
PMD Applied has ten chapters. The first chapter is the mandatory introduction and the second covers installation. Nothing unusual there. Chapter three covers using PMD from within Ant or Maven. I'm glad to see both build systems covered here. Both have a pretty good sized user base and both deserve to be represented. Chapter four covers using PMD within an IDE. The range of IDEs covered is excellent and includes all of the ones that I would have covered and a couple of others that I hadn't heard of.
Chapter five begins the serious job of using PMD for static analysis by examining the ability of PMD to detect duplicate code using the wonderfully named Copy and Paste Detector (CPD). Chapter six is titled Best Practices. It's a wonderful collection of advice from Mr. Copeland, on how to begin applying PMD to your Java development process. As a Team Leader, I understand many of the points he makes. Teams generally don't enjoy having impartial tools dumped on them in the middle of a project that do nothing but nitpick their code and programming style; such things are a fast-track to being unpopular. Mr. Copeland's guidelines will increase the chance of your team accepting PMD, as you start with a subset of helpful rules with low chances of false positives.
For all of its cleverness, PMD is nothing without well written rules and chapter seven has this covered. PMD ships with a good sized rule set of its own, even though not all of these will be suitable for every site. Creating custom rule sets is an important first step in customizing PMD for your team. Once the team is used to PMD, they're likely to want to start adding new custom rules to the mix and the book has you covered there as well, with instructions on writing rules with both Java and XPath expressions.
Chapter eight addresses the matter of customizing PMD. Naturally, making changes to the code and recompiling is the first customization covered, but then it looks at custom report formats, adding new languages for the CPD and advice on making contributions of code to the PMD project. Chapter nine is a look at the internals of PMD. Now, perhaps this won't be of much interest to some of the readers of this book, but I found it fascinating. There's nothing quite like having the internal workings of a useful tool explained clearly by the person who wrote it. If you don't like it, it's only twenty pages, so skip over it and check out chapter ten where the playing field of similar open-source tools is examined. The book wraps up with a large appendix with a very useful explanation of all of the rules that ship in the standard PMD deliverable.
I'm going to let a good part of my personal biases show here, but I absolutely love slim and detailed technical books. PMD Applied is 221 pages, which is about the size of the pre-ANSI version of Kernighan and Ritchie's The C Programming Language; the greatest technical book in the known universe. This is the perfect size for a technical book, allowing the author to introduce their subject, explain everything that needs saying, wrap up and be done before the reader's eyes roll back into their head and information overload descends upon them. This book is perfectly sized.
The level of technical discussion matches the size of the book and is just right. While the first few chapters deal with what is PMD and how do you install and run it, the rest of the book deals with good solid code analysis using PMD. This is why we bought the book. We're geeks ... show us the code! Mr. Copeland doesn't disappoint us and there are many excellent code examples throughout the book.
The appendix is a snapshot of the rules that shipped with PMD at the time of the book's publishing. While new rules have been added since this time, the list of every rule and a portion of example code that would trigger that rule are useful. Even if you don't use PMD, buy the book so you can use the appendix as a comprehensive list of examples of how not to write Java code!
After having been out for a year, the exact level of the software described in the book has been passed by. This may bother you, but I feel that the basic principles of PMD have remained true and so I wouldn't let the version numbers dissuade you from purchasing.
The book is only available from the publishers, Centennial Books. They're a smaller publisher, but I had no problem with purchasing through their website.
If you use or are considering using PMD for static analysis of Java code, then this book should be by your side."
Slashdot welcomes readers' book reviews -- to see your own review here, read the book review guidelines, then visit the submission page.
I hope that it's not too much of stretch to suggest that this book is primarily written for users of PMD. That said, I actually purchased it (yup, this one wasn't a freebie) because I was considering a recommendation to use PMD as part of the build process at a previous employer. This is not a slam on the documentation on the PMD website, but Mr. Copeland was offering signed editions of the book if you pre-ordered and I wanted to add to my growing collection of books signed by the author. (No contest; geeky as charged.)
PMD Applied has ten chapters. The first chapter is the mandatory introduction and the second covers installation. Nothing unusual there. Chapter three covers using PMD from within Ant or Maven. I'm glad to see both build systems covered here. Both have a pretty good sized user base and both deserve to be represented. Chapter four covers using PMD within an IDE. The range of IDEs covered is excellent and includes all of the ones that I would have covered and a couple of others that I hadn't heard of.
Chapter five begins the serious job of using PMD for static analysis by examining the ability of PMD to detect duplicate code using the wonderfully named Copy and Paste Detector (CPD). Chapter six is titled Best Practices. It's a wonderful collection of advice from Mr. Copeland, on how to begin applying PMD to your Java development process. As a Team Leader, I understand many of the points he makes. Teams generally don't enjoy having impartial tools dumped on them in the middle of a project that do nothing but nitpick their code and programming style; such things are a fast-track to being unpopular. Mr. Copeland's guidelines will increase the chance of your team accepting PMD, as you start with a subset of helpful rules with low chances of false positives.
For all of its cleverness, PMD is nothing without well written rules and chapter seven has this covered. PMD ships with a good sized rule set of its own, even though not all of these will be suitable for every site. Creating custom rule sets is an important first step in customizing PMD for your team. Once the team is used to PMD, they're likely to want to start adding new custom rules to the mix and the book has you covered there as well, with instructions on writing rules with both Java and XPath expressions.
Chapter eight addresses the matter of customizing PMD. Naturally, making changes to the code and recompiling is the first customization covered, but then it looks at custom report formats, adding new languages for the CPD and advice on making contributions of code to the PMD project. Chapter nine is a look at the internals of PMD. Now, perhaps this won't be of much interest to some of the readers of this book, but I found it fascinating. There's nothing quite like having the internal workings of a useful tool explained clearly by the person who wrote it. If you don't like it, it's only twenty pages, so skip over it and check out chapter ten where the playing field of similar open-source tools is examined. The book wraps up with a large appendix with a very useful explanation of all of the rules that ship in the standard PMD deliverable.
I'm going to let a good part of my personal biases show here, but I absolutely love slim and detailed technical books. PMD Applied is 221 pages, which is about the size of the pre-ANSI version of Kernighan and Ritchie's The C Programming Language; the greatest technical book in the known universe. This is the perfect size for a technical book, allowing the author to introduce their subject, explain everything that needs saying, wrap up and be done before the reader's eyes roll back into their head and information overload descends upon them. This book is perfectly sized.
The level of technical discussion matches the size of the book and is just right. While the first few chapters deal with what is PMD and how do you install and run it, the rest of the book deals with good solid code analysis using PMD. This is why we bought the book. We're geeks ... show us the code! Mr. Copeland doesn't disappoint us and there are many excellent code examples throughout the book.
The appendix is a snapshot of the rules that shipped with PMD at the time of the book's publishing. While new rules have been added since this time, the list of every rule and a portion of example code that would trigger that rule are useful. Even if you don't use PMD, buy the book so you can use the appendix as a comprehensive list of examples of how not to write Java code!
After having been out for a year, the exact level of the software described in the book has been passed by. This may bother you, but I feel that the basic principles of PMD have remained true and so I wouldn't let the version numbers dissuade you from purchasing.
The book is only available from the publishers, Centennial Books. They're a smaller publisher, but I had no problem with purchasing through their website.
If you use or are considering using PMD for static analysis of Java code, then this book should be by your side."
Slashdot welcomes readers' book reviews -- to see your own review here, read the book review guidelines, then visit the submission page.
PWND
(posted before the second post)
Sliced bread good.
Sliced bread good! FIRE BAD!
Wizard Needs Food, Badly
What I offer here is an involved yet detached look at Joe Lieberman's harangues. Perhaps time, further study, and more reflection will either modify or enrich the analysis offered here, but Lieberman's mandarin prose has always appealed to ethically bankrupt menaces. For practical reasons, I have to confine my discussion to areas that have received insufficient public attention or in which I have something new to say. Lieberman writes a lot of long statements that mean practically nothing. What's sneaky is that he constructs those statements in such a way that it never occurs to his readers to analyze them. Analysis would almost certainly indicate that I've known some bottom-feeders who were impressively frowzy. However, Lieberman is disorderly, and that trumps frowzy every time.
Lieberman's propaganda machine once said that Lieberman would never needle and wheedle misguided moochers into his band. So much for credibility! It's irrelevant that my allegations are 100% true. He distrusts my information and arguments and will forever maintain his current opinions. If we take his artifices to their logical conclusion, we see that eventually, he will concoct a version of reality that fully contradicts real life. I receive a great deal of correspondence from people all over the world. And one of the things that impresses me about it is the massive number of people who realize that it's Lieberman's belief that my letters demonstrate a desire to mete out harsh and arbitrary punishment against his adversaries until they're intimidated into a benumbed, neutralized, impotent, and non-functioning mass. I can't understand how anyone could go from anything I ever wrote to such a pretentious idea. In fact, my letters generally make the diametrically opposite claim, that Lieberman wants to condone universal oppression. Who does he think he is? I mean, if he can overawe and befuddle a sufficient number of prominent individuals, then it will become virtually impossible for anyone to bring fresh leadership and even-handed tolerance to the present controversy. I once managed to get Lieberman to agree that like most people that have an obtrusive agenda to advocate, he wants to deny citizens the ability to draw their own conclusions about the potential for violence that he may be generating. Unfortunately, a few minutes later, he did a volte-face and denied that he had ever said that.
I know that I'm emotional now, but Lieberman's causeries manifest themselves in two phases. Phase one: cause one-sided ebullitions to be entered into historical fact. Phase two: impale us on the pike of imperialism. Lieberman argues that he can walk on water. I wish I could suggest some incontrovertible chain of apodictic reasoning that would overcome this argument, but the best I can do is the following: If he continues to cause pain and injury to those who don't deserve it, crime will escalate as schools deteriorate, corruption increases, and quality of life plummets. I believe I have found my calling. My calling is to weed out people like Lieberman who have deceived, betrayed, and exploited us. And just let him try and stop me. Those of us who are too lazy or disinterested to contribute to the intellectual and spiritual health of the body politic have no right to complain when he and his compeers use paid informants and provocateurs to leave a generation of people planted in the mud of a larcenous, homicidal world, to begin a new life in the shadows of sexism. It may seem obvious, but what I find frightening is that some academics actually believe Lieberman's line that two wrongs make a right. In this case, "academics" refers to a stratum of the residual intelligentsia surviving the recession of its demotic base, not to those seekers of truth who understand that Lieberman is the embodiment of everything petty in our lives. Every grievance, every envy, every muzzy-headed ideology finds expression in Joe Lieberman.
Most of you reading this letter have your hearts in the right place. Now follow your hearts with actions. It's not necessarily
I believe just about every book would cover that.
But: does your foreskin...
run Linux?
Take off every 'sig' !!
In other news, Linux is still for fags.
o
========0
;
= 36440 FreeBSD It. Do not share irc.secsup.org or You 4re a screaming
a full-7ime GNAA