Skip to main content
Log in

A declarative approach for Java code instrumentation

  • Published:
Software Quality Journal Aims and scope Submit manuscript

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.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Fig. 1
Fig. 2
Fig. 3
Fig. 4
Fig. 5
Fig. 6
Fig. 7
Fig. 8
Fig. 9
Fig. 10
Fig. 11
Fig. 12
Fig. 13
Fig. 14
Fig. 15

Similar content being viewed by others

Notes

  1. http://jakarta.apache.org/bcel/

  2. http://eclipse.org/aspectj/

  3. http://www.w3.org/

  4. http://www.w3.org/TR/xslt20/

References

  • AspectJ project website http://eclipse.org/aspectj/.

  • Alves, T. L., Hage, J., & Peter (2011) Rademaker: A comparative study of code query technologies. In: Proceedings of the 2011 IEEE 11th International Working Conference on Source Code Analysis and Manipulation(SCAM’11), (pp. 145–154), IEEE Computer Society, 2011.

  • BCEL (Byte-Code Engineering Library) website, http://jakarta.apache.org/bcel/.

  • Beyer, D. (2006). Relational programming with CrocoPat, In Proceedings of the 28th international conference on Software engineering (ICSE ’06), (pp. 807–810).

  • Chixiang, Z.,& Phyllis, F. (2011). JDAMA: Java database application mutation analyser. Software Testing, Verification and Reliability, 21(3), 241263, Wiley, 2011.

  • Cordy, J. R. (2006). The TXL source transformation language. Science of Computer Programming, 61(3), 190–210.

    Article  MATH  MathSciNet  Google Scholar 

  • Du Bois, B., Van Rompaey, B., Meijfroidt, K., & Suijs, E. (2007). Supporting reengineering scenarios with FETCH: an experience report. In Proc. of the 3rd International ERCIM Workshop on Software Evolution, ICSM, p.69C82, Paris, France, October 2007.

  • Holt R. C. (2008). Grokking software architecture. In: Proceedings of the 15th Working Conference on Reverse Engineering (WCRE’08), pp 5–14. IEEE, 2008. Most influential paper.

  • Javier, T. Cabal, M. J. S., & de la Riva, C. (2007). Mutating Database Queries. Information and Software Technology, 49(4), 398–417.

    Article  Google Scholar 

  • Kiczales, G., Lamping, J., Mendhekar, A., Maeda, C., Lopes, C., et al. (1997). Aspect-oriented programming, In Proceedings of the European Conference on Object-Oriented Programming(ECOOP), Springer LNCS 1241. June 1997.

  • Luk, C.-K., Cohn, R., Muth, R., Patil, H., Klauser, A., Lowney, G., et al. (2005). Building customized program analysis tools with dynamic instrumentation. In Proceedings of the 2007 ACM SIGPLAN conference on Programming language design and implementation(PLDI2005), (pp. 190–200).

  • Mingsong, Chen, Xiaokang, Qiu, & Xuandong, Li (2006). Automatic Test Case Generation for UML Activity Diagrams, In Proceedings of the 2006 international workshop on Automation of software test, 23 May 2006, (pp. 2–8). New York: ACM Press.

  • Miiller, H. A., & Klashinsky, K. (1988). Rigi-A system for programming-in-the-large, In Proceedings of the 10th international conference on Software engineering(ICSE’88), Raffles City, Singapore Aprid 11–15, (pp. 80–86), April 1988.

  • Nethecote, N. & Seward, U. (2007). Valgrind: reducing maintenance effort through software operational knowledge: An eclectic empirical evaluation. In: Proceedings of the 2007 ACM SIGPLAN conference on Programming language design and implementation(PLDI2007), (pp. 89–100).

  • Seesing, A., & Orso, A., (2005). InsECTJ: A generic instrumentation framework for collecting dynamic information within Eclipse[C]. In Proceedings of the 2005 OOPSLA workshop on Eclipse technology eXchange(eclipse2005), pp. 45–49.

  • Tang, E., Wang, L., Zhao, J., Li, X., Wang, L. Zhao, J., et al. (2012) : Time-leverage point detection for time sensitive software maintenance, In Proceedings of the 28th IEEE International Conference on Software Maintenance, (pp. 567–570), IEEE Computer Society.

  • Tuya, J., Cabal, M. J. S. & de la Riva, C. (2006) SQLMutation: A tool to generate mutants of SQL database queries. In Second Workshop on Mutation Analysis (Mutation 2006 - ISSRE Workshops 2006).

  • van der Schuur, H., Jansen, S., & Brinkkemper, S. (2007). Reducing maintenance effort through software operation knowledge: An Eclectic Empirical Evaluation. In: Proceedings of the 15th European Conference on software maintenance and reengineering(CSMR2011), IEEE Computer Society, (pp. 201–210), 2007.

  • Verbaere, M., Godfrey, M. W., & Girba, T. (2008). Query technologies and applications for program comprehension[C]. In 16th IEEE International Conference on Program Comprehension(ICPC), pp. 285–288.

  • Valle-Rai, R., Co, P., Gagnon, E., Hendren L., Lam, P., Sundaresan, V. Soot: a Java bytecode optimization framework. In: In CASCON First Decade High Impact Papers(CASCON ’10), pp. 214–224, IBM Corp., NJ, USA.

  • Wilhelm, R., Engblom, J., Ermedahl, A., Holsti, N., Thesing, S., Whalley, D. et al. (2008). The worst-case execution-time problemoverview of methods and survey of tools, ACM Trans. Embedd. Comput. Syst., 7(3) (pp. 1–53). New York: ACM.

    Google Scholar 

  • World Wide Web Consortium (W3C) homepage. http://www.w3.org/.

  • W3C XML Query (XQuery). http://www.w3.org/XML/Query/.

  • XSL Transformations (XSLT).

Download references

Acknowledgments

This work is supported by the National Natural Science Foundation of China (No. 61003025, No. 61021062) and the National 863 High-Tech Programme of China (No. 2011AA010103, No. 2012AA011205).

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Tian Zhang.

Rights and permissions

Reprints and permissions

About this article

Cite this article

Zhang, T., Zheng, X., Zhang, Y. et al. A declarative approach for Java code instrumentation. Software Qual J 23, 143–170 (2015). https://doi.org/10.1007/s11219-013-9220-4

Download citation

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s11219-013-9220-4

Keywords

Navigation