Duke Logo

Checking Java Programs...

It's been almost twenty years since Tim O'Reilly published my little book Checking C Programs with Lint. So much has changed! In those days short books went out on paper as Nutshell Books; now they go out as Short Cuts. In those days C was the leading programming language; today Java is one of the leaders, with others nipping at its heels. But one thing hasn't changed, and it hasn't changed since the days of Grace Murray Hopper: programs still have bugs. Programmers still write code with bugs. Users still find bugs in software.

While Java does a lot to prevent bugs from forming (Java's garbage collection gets rid of the majority of memory allocation and deallocation bugs), it certainly does not do everything. There is still room for additional tools to help you find bugs in your software, and for a book that tells you about some of these tools.

So. This site is about my O'Reilly e-book in this area, Checking Java Programs with Open Source Tools.

The book covers a number of topics but the major ones are:

  1. Static Source Code Checking with PMD
  2. Static Byte Code Checking with FindBugs
  3. Dynamic Execution Checking with NASA Java Pathfinder

I do not cover Program Testing with JUnit as there is enough coverage in that area already. There is a short section on it in my Java Cookbook., and more comprehensive, nay, encyclopedic, coverage in J. B. Rainsberger's excellent JUnit Recipes (Manning, 2004)).

There wasn't time or room to include VerifyDesign, a tool that verifies that you aren't depending on any API that you aren't supposed to (e.g., enforces Design To Interface). VerifyDesign has its own VerifyDesign Ant Task.

FindBugs += NetBeans: Bill Pugh, the prime mover of FindBugs, was kind enough to inform me that there is a NetBeans support add-on for FindBugs, though it's not from his project but rather from a third party. To get the NetBeans support for FindBugs, start at http://blogs.sun.com/charliebrown/entry/how_to_find_install_findbugs.