Chapter 4. Continuous Inspection

The practice of Continuous Inspection expands on the ideas of Continuous Integration by performing an automated code review each time the code is changed. This makes it possible to detect undesirable developments such as increasing code complexity as early as possible and to counter them before it becomes to expensive. As Paul Duvall says:

An inspection at every change keeps defects in range.

In this chapter we will extend our existing build.xml script for Ant as well as our Jenkins job to invoke tools that, among other things, generate API documentation, calculate software metrics, and look for coding standard violations and duplicate code.

Well-written object-oriented code basically documents itself. Tools such as PHPDocumentor extract this information and render it in a useful format such as HTML. Example 4-1 shows how to invoke PHPDocumentor from our Apache Ant build script.