Super
Previous Next

Wasp Analysis

In the Wasp analysis, a java program is presented by the top file. A top java file should include public static void main(String []) method. Wasp also can analyse servlets; see section Checking Servlets.

When applied to a java program, Wasp produces a message listing which includes error and warning messages (see Wasp messages). It also produces a method call graph (see Method call graph) to facilitate user's analysis of Wasp messages.


Super
Previous Next

Analysed configuration

Analysed configuration includes methods that may be accessed during execution from the public static void main(String []) method in the top file.

Upon startup, the analyser Wasp builds the analysed configuration of the program. For each imported class or interface, Wasp looks for an appropriate file of the source code. If such file is not accessible, the respective class-file (file with the extension ".class") must present. For a method included by Wasp from the class-file, the method body is not accessible for Wasp and so considered unknown. Such methods are called external methods. Note that native methods are also external.

Analysed configuration should have the least possible number of the external methods, because Wasp analysis of the external methods is very imprecise.

The Sun JDK library is accessible for Wasp by the packages of class-files. So, the method called from the JDK class is external. In order the Wasp analysis to be faster and more precise, two different approaches are applied in Wasp to the critical part of JDK library.

First, information about some JDK methods is collected in the system file side_eff.wasp. This information helps to simplify Wasp processing of external methods. Second, a model package mJDK for some JDK classes is supplied in the directory where you have installed Wasp.


Super
Previous Next

Analysis phases

The analyser Wasp processes a Java program in several passes:

  • Compilation of java program by the Excelsior Java front-end
  • Data flow analysis
  • Error analysis

Wasp analysis is terminated if errors are detected during compilation.

In turn, data flow analysis in Wasp consists of the following phases:

CI context-insensitive analysis
CS context-sensitive analysis
VC value calculation

Each phase consists of a sequence of stages. A stage is a minimal independent step of analysis. Stages are sequentially numbered through all phases.

Additionally, the finalization analysis phases were introduced for analysis cutoff; see chapter Wasp strategy for big programs.

The Error analysis part of Wasp consists of the following phases:

EP preliminary analysis
EU analysis of variable usage
EM message listing and method call graph output


Copyright 2000, 2001, 2002, 2003 AcademSoft. All rights reserved.