What is side-effect analysis?
In object-oriented programs, execution of a method m on an object o
may also change the state of another object p. If this is the case,
then m is said to have side--effects. For some tasks it is important
to know wether or not a method can have side--effects. This question is answered
by a so-called side--effect analysis (also referred to as purity analysis),
which guarantees that all methods classified as side--effect free (or
pure) never have side--effects. You can find additional details in the
technical report available here.
What is dynamic side-effect analysis?
Existing purity analyses are usually static, i.e. they only rely on a (typically very
difficult) analysis of a program's source code. The results are usually conservative,
meaning that no method classified as pure can have side--effects.
This project aims at providing a dynamic purity analysis. Unlike
static analysis, we observe an actual execution of a program and trace modification
and creation of objects. Our analysis yields a list of methods that showed no
side-effects during that run. In other words, our results are relative to a program
run.
What is the benefit of dynamic analysis?
Previous static purity analyses have various practical issues: They usually
don't scale very well or have problems analyzing programs that use modern
features of the API. Dynamic analysis has been successfully tested for large
programs with several 1000 classes. Our next goal is analyzing programs
as large as Eclipse (a very large integrated development environment).
What is parameter mutability analysis?
Parameter mutability analysis identifies which parameters passed to a method were
modified during the execution of that method. This information is useful for solving problems
in many different areas, such as compiler construction and refactoring. Our tool
records for each complex parameter p of a method invocation wether
or not p (or any object transitively reachable from p was changed.
How can I use it for my program?
Our analysis tool is freely available. To use it, follow the instructions
here.