A declarative approach for Java code instrumentation

Tian Zhang,Xiaomei Zheng,Yan Zhang,Jianhua Zhao,Xuandong Li
DOI: https://doi.org/10.1007/s11219-013-9220-4
2013-01-01
Software Quality Journal
Abstract:Source instrumentation plays an important role in dynamic program analysis. However, current instrumentation implementations require programmers to write ad hoc rules that are often too complex to use and maintain. To address this complexity, we divide the task of source instrumentation into two steps: first, the source points are queried, into which code fragments should be planted; secondly, the code fragments including contextual information are generated and planted into source code through the queried points. According to this idea, we present a new method based on declarative code queries, which makes it easier to specify instrumentations using contextual information collected from expressive code queries. The JIns language provided by our method is constructed following an SQL-like style, which is well known and widely used by programmers. We evaluate the method in terms of the reduced complexity of instrumentation specifications for several common instrumentation tasks.
What problem does this paper attempt to address?