Cover image for Checking Java Programs

Book description

This Short Cut tells you about tools that will improve the quality of your Java code, using checking above and beyond what the standard tools do, including:

  • Using javac options, JUnit and assertions

  • Making your IDE work harder

  • Checking your source code with PMD

  • Checking your compiled code (.class files) with FindBugs

  • Checking your program's run-time behavior with Java PathFinder

Table of Contents

  1. Checking Java Programs
    1. What It's Not About
    2. It Usually Begins with javac
      1. Aside: "Keep the Bar Green"
      2. Another Aside: Java's assert Keyword
    3. Making Your IDE Work Harder
      1. Friends Don't Let Friends Ship with Warnings
      2. Enabling Useful Warnings, Disabling Useless Ones, and Promoting Warnings to Errors
    4. Source Code Checking with PMD
      1. Incomplete Programs
      2. Using PMD with Ant
      3. Using PMD in an IDE
      4. PMD Rules and Warnings
      5. PMD's Secret Weapon: CPD
      6. Extending PMD
    5. Static (Class File) Checking with FindBugs™
      1. Command-Line Usage
      2. FindBugs GUI
      3. FindBugs with Ant
      4. FindBugs with Eclipse
      5. FindBugs Warnings
      6. Data Mining
      7. Extending FindBugs
    6. Dynamic Checking with NASA's Java PathFinder
      1. Building and Running Java PathFinder
      2. Configuring and Extending PathFinder
        1. Writing some code
        2. Under the hood
    7. What's Next?
    8. About the Author