How to implement a typestate analysis

Clara offers researchers extensive support to implement customized typestate analysis with a minimal amount of “glue code”. Simply download clara-emptyext.zip from the downloads page to get started. Unzip the file. In the src directory you will find three files. The file AbcExtension.java registers your custom analysis as an extension to abc. The file MyNewAnalysis.java implements a dummy analysis that is heavily annotated with comments. Reading through this file should get you started quickly. To compile and run your extended version of Clara, just use the provided ant build script (build.xml).

The general concept is easy:

  1. Schedule your analysis in AbcExtension.
  2. Use the DAInfo data structure to access important information about all registered Dependency State Machines and shadows.
  3. Examine the program, to disable which shadows are irrelevant and can be disabled. To disable a shadow, simply call shadow.disable().

That’s it! Clara and abc take care of all the rest for you.