Static Analysis of Java Code

A few weeks ago, I was reading Java Magazine and in the current issue, it was reviewing the results of a Java Developer survey. One of the questions in the survey was “Which static quality tools do you use?”. I guess I’m part of the 36% of the people (results of the survey) who don’t use one.

I decided to try out FindBugs and see what it can do. I figured it would be pointless because I write perfect code (yeah right!).

I decided to try it out against MQ Visual Edit first. FindBugs is pretty easy to use as everything is on by default and holy cow does it produce a lot of information. I liked how besides the main JAR file and auxiliary JAR files, that the source code can be included. Even better, it supports multiple locations for the source code which is great because I have various components of MQ Visual Edit in different Eclipse projects. By clicking on the listed bug and viewing the source code, FindBugs makes it really easy to decide if it has found a bug or is being overly sensitive to the code. I like some of the category names it uses: “Dodgy Code”, “Dubious method used”, etc..

The best part of using it, it actually found a couple of bugs and it found a couple of potential bugs. So all in all, it was worth my time using it. I have created FindBugs projects for all of my Java projects (commercial and open source) and I have gone through all of the projects and fixed all of the bugs it found.

Regards,
Roger Lacroix
Capitalware Inc.

This entry was posted in IBM i (OS/400), Java, JMS, Linux, macOS (Mac OS X), Programming, Unix, Windows, z/OS.

Comments are closed.