Partial Program Analysis for Java
Partial Program Analysis for Java (PPA) is a static analysis framework that transforms the source code of an incomplete Java program into a typed Abstract Syntax Tree and, optionally, into a typed three-address representation called Jimple. The advantages of using PPA over standard parsers such as the Eclipse AST parser are:
- PPA attaches type information to all nodes in the AST, even if the declared type is inaccessible.
- PPA infers missing type information when possible.
- PPA resolves ambiguous syntax constructs.
- A universal unknown type (UNKNOWNP.UNKOWN) is used as a placeholder for all unknown type declarations.
Because disambiguating a partial Java program is an undecidable problem, the intermediate representation produced by PPA might contain some errors. PPA is still useful for software engineering research that tolerates a low level of errors and imprecision. Indeed, in an empirical study on four large open source systems, we recovered on average 91.2% correct types and produced only 2.7% erroneous types when analyzing a single class without its dependencies.
PPA for Eclipse and for Soot/Polyglot.
There are two flavors of PPA: PPA for Eclipse and PPA for Soot/Polyglot.
PPA for Eclipse uses the Eclipse JDT compiler as the frontend and is compatible with the Eclipse JDT Binding API. This version supports Java 5 constructs and analysis of code snippets. This is the actively maintained version of PPA.
PPA for Soot/Polyglot uses Polyglot as the frontend and can produce Jimple code to enable static analysis with Soot. It only supports Java 1.4 and well-formed Java files. This version was used to evaluate our approach, but only bug fixes are released now.
Download
To download PPA for Eclipse, use the following update site:
http://www.sable.mcgill.ca/ppa/site_1.2.x
PPA for Eclipse is available under the GNU Lesser General Public License and Eclipse is available under the Eclipse Public License.
Download information for PPA for Soot/Polyglot is available here.
Resources
- The OOPSLA 2008 paper describing the implementation and evaluation of PPA.
- Examples and specific resources on how to use PPA for Eclipse.
- Examples and specific resources on how to use PPA for Soot/Polyglot.