Aspect impact analysis
Dehua Zhang · eScholarship@McGill (McGill) · 2009
One of the major challenges in aspect-oriented programming is that aspects may have unintended impacts on a base program. Thus, it is important to develop techniques and tools that can both summarize the impacts and provide information about the causes of the impacts. This thesis presents impact analyses for AspectJ. Our approach detects different ways advice and inter-type declarations interact and interfere with the base program and focuses on four kinds of impacts, \emph{state impacts} which cause changes of state in the base program, \emph{computation impacts} which cause changes in functionality by adding, removing or replacing computations of the base program, \emph{shadowing impacts} which cause changes of field reference in the base program, and \emph{lookup impacts} which cause changes of method lookup in the base program. We provide a classification scheme for these kinds of impacts and then develop a set of static analyses to estimate these impacts. A key feature of our approach is the use of points-to analysis to provide more accurate estimates. Further, our analysis results allow us to trace back to find the causes of the impacts. We have implemented our techniques in the AspectBench compiler. By implementing them in an AspectJ compiler, all kinds of pointcuts, advice and inter-type declarations can be analyzed. We also have integrated these analyses into an AspectJ IDE and provided a two-way navigation between impacts and program source code. In addition, we have carried out experiments on example programs and benchmarks to investigate the results of our analyses.