Abstract
A trace monitor observes the sequence of events in a system, and takes appropriate action when a given pattern occurs in that sequence. Aspect-oriented programming provides a convenient framework for writing such trace monitors.
We provide a brief introduction to aspect-oriented programming in AspectJ. AspectJ only provides support for triggering extra code with single events, and we present a new language feature (named tracematches) that allows one to directly express patterns that range over the whole current trace. Implementing this feature efficiently is challenging, and we report on our work towards that goal.
Another drawback of AspectJ is the highly syntactic nature of the event patterns, often requiring the programmer to list all methods that have a certain property, rather than specifying that property itself. We argue that Datalog provides an appropriate notation for describing such properties. Furthermore, all of the existing patterns in AspectJ can be reduced to Datalog via simple rewrite rules.
This research is carried out with abc, an extensible optimising compiler for AspectJ, which is freely available for download.
Preview
Unable to display preview. Download preview PDF.
Similar content being viewed by others
References
abc. The AspectBench Compiler. Home page with downloads, FAQ, documentation, support mailing lists, and bug database, http://aspectbench.org
abc team. Trace monitoring benchmarks (2006), http://abc.comlab.ox.ac.uk/packages/tmbenches.tar.gz
Adams, B.: Aspicere (2004), http://users.ugent.be/~badams/aspicere/
Aldrich, J.: Open Modules: modular reasoning about advice. In: Black, A.P. (ed.) ECOOP 2005. LNCS, vol. 3586, pp. 144–168. Springer, Heidelberg (2005)
Allan, C., Avgustinov, P., Christensen, A.S., Hendren, L., Kuzins, S., Lhoták, O., de Moor, O., Sereni, D., Sittampalam, G., Tibble, J.: Adding Trace Matching with Free Variables to AspectJ. In: Object-Oriented Programming, Systems, Languages and Applications, pp. 345–364. ACM Press, New York (2005)
AOSD.NET. Tools for developers (2006), http://www.aosd.net/wiki/index.php?title=Tools_for_Developers
Aracic, I., Gasiunas, V., Mezini, M., Ostermann, K.: An overview of AspectJ. In: Rashid, A., Aksit, M. (eds.) Transactions on Aspect-Oriented Software Development I. LNCS, vol. 3880, pp. 135–173. Springer, Heidelberg (2006)
Avgustinov, P., Christensen, A.S., Hendren, L., Kuzins, S., Lhoták, J., Lhoták, O., de Moor, O., Sereni, D., Sittampalam, G., Tibble, J.: abc: An extensible AspectJ compiler. In: Aspect-Oriented Software Development (AOSD), pp. 87–98. ACM Press, New York (2005)
Avgustinov, P., Christensen, A.S., Hendren, L., Kuzins, S., Lhoták, J., Lhoták, O., de Moor, O., Sereni, D., Sittampalam, G., Tibble, J.: Optimising aspectj. In: PLDI 2005: Proceedings of the 2005 ACM SIGPLAN conference on Programming language design and implementation, pp. 117–128. ACM Press, New York (2005)
Avgustinov, P., Christensen, A.S., Hendren, L., Kuzins, S., Lhoták, J., Lhoták, O., de Moor, O., Sereni, D., Sittampalam, G., Tibble, J.: abc: An extensible AspectJ compiler. In: Rashid, A., Aksit, M. (eds.) Transactions on Aspect-Oriented Software Development I. LNCS, vol. 3880, pp. 293–334. Springer, Heidelberg (2006)
Avgustinov, P., Tibble, J., Bodden, E., Hendren, L., Lhoták, O., de Moor, O., Ongkingco, N., Sittampalam, G.: Efficient Trace Monitoring. Technical Report abc-2006-1, AspectBench Compiler Project (2006), http://abc.comlab.ox.ac.uk/techreports#abc-2006-1
Barringer, H., Goldberg, A., Havelund, K., Sen, K.: Rule-based runtime verification. In: Steffen, B., Levi, G. (eds.) VMCAI 2004. LNCS, vol. 2937, pp. 44–57. Springer, Heidelberg (2004)
Barzilay, O., Feldman, Y.A., Tyszberowicz, S., Yehudai, A.: Call and execution semantics in AspectJ. In: Foundations Of Aspect Languages (FOAL), pp. 19–24, Technical report TR #04-04, Department of Computer Science, Iowa State University (2004)
Bobrow, D.G., Kahn, K., Kiczales, G., Masinter, L., Stefik, M., Zdybel, F.: Commonloops: merging common lisp and object-oriented programming. In: Meyrowitz, N.K. (ed.) ACM Conference on Object-Oriented Programming Systems, Languages and Applications (OOPSLA), vol. 791, pp. 152–184. ACM Press, New York (1986)
Bockisch, C.: Alpha (2005), http://www.st.informatik.tu-darmstadt.de/static/pages/projects/alpha/in%dex.html
Bockisch, C., Mezini, M., Ostermann, K.: Quantifying over dynamic properties of program execution. In: 2nd Dynamic Aspects Workshop DAW 2005, Technical Report 05.01. Research Institute for Advanced Computer Science, pp. 71–75 (2005)
Bodden, E.: J-LO - A tool for runtime-checking temporal assertions. Master’s thesis, RWTH Aachen University (2005)
Bodkin, R.: Pointcuts need a long form (2006), http://dev.eclipse.org/mhonarc/lists/aspectj-users/msg05971.html
Böhm, O.: Aspectorientierte Programmierung mit AspectJ 5. Dpunkt.verlag (2006)
Brichau, J., Mens, K., de Volder, K.: SOUL/aop (2002), http://prog.vub.ac.be/research/aop/soulaop.html
Bruns, G., Jagadeesan, R., Jeffrey, A., Riely, J.: μABC: a minimal aspect calculus. In: Gardner, P., Yoshida, N. (eds.) CONCUR 2004. LNCS, vol. 3170, pp. 209–224. Springer, Heidelberg (2004)
Burke, B.: Has and hasfield pointcut expressions (2004), http://aosd.net/pipermail/discuss_aosd.net/2004-May/000958.html
Burstall, R.M., Popplestone, R.J.: POP-2 reference manual. In: Meltzer, B., Michie, D. (eds.) Machine Intellingence, vol. 5, pp. 207–246. Edinburgh University Press (1968)
Chen, Y., Nishimoto, M., Ramamoorthy, C.V.: The C information abstraction system. IEEE Transactions on Software Engineering 16(3), 325–334 (1990)
Cibrán, M.A., Verheecke, B.: Dynamic business rules for web service composition. In: 2nd Dynamic Aspects Workshop (DAW 2005), pp. 13–18 (2005)
Clifton, C., Leavens, G.T., Chambers, C., Millstein, T.: Multijava: modular open classes and symmetric multiple dispatch for java. In: OOPSLA 2000: Proceedings of the 15th ACM SIGPLAN conference on Object-oriented programming, systems, languages, and applications, pp. 130–145. ACM Press, New York (2000)
Colyer, A., Clement, A., Harley, G., Webster, M.: Eclipse AspectJ: Aspect-Oriented Programming with AspectJ and the Eclipse AspectJ development tools. Addison-Wesley, Reading (2004)
d’Amorim, M., Havelund, K.: Event-based runtime verification of java programs. In: WODA 2005: Proceedings of the third international workshop on Dynamic analysis, pp. 1–7. ACM Press, New York (2005)
Dawson, S., Ramakrishnan, C.R., Warren, D.S.: Practical program analysis using general purpose logic programming systems. In: ACM Symposium on Programming Language Design and Implementation, pp. 117–126. ACM Press, New York (1996)
de Volder, K.: Aspect-oriented logic meta-programming. In: Cointe, P. (ed.) Reflection 1999. LNCS, vol. 1616, pp. 250–272. Springer, Heidelberg (1999)
Douence, R., Fradet, P., Südholt, M.: A framework for the detection and resolution of aspect interactions. In: GPCE 2002. LNCS, vol. 2487, pp. 173–188 (2002)
Douence, R., Fradet, P., Südholt, M.: Composition, reuse and interaction analysis of stateful aspects. In: Lieberherr, K. (ed.) 3rd International Conference on Aspect-oriented Software Development, pp. 141–150 (2004)
Douence, R., Fradet, P., Südholt, M.: Trace-based aspects. In: Aspect-oriented Software Development, pp. 141–150. Addison-Wesley, Reading (2004)
Douence, R., Fritz, T., Loriant, N., Menaud, J.-M., Ségura, M., Südholt, M.: An expressive aspect language for system applications with arachne. In: Aspect-Oriented Software Development, pp. 27–38 (2005)
Douence, R., Motelet, O., Südholt, M.: A formal definition of crosscuts. In: Yonezawa, A., Matsuoka, S. (eds.) Reflection 2001. LNCS, vol. 2192, pp. 170–186. Springer, Heidelberg (2001)
Dufour, B., Goard, C., Hendren, L., de Moor, O., Sittampalam, G., Verbrugge, C.: Measuring the dynamic behaviour of aspectj programs. In: OOPSLA 2004: Proceedings of the 19th annual ACM SIGPLAN conference on Object-oriented programming, systems, languages, and applications, pp. 150–169. ACM Press, New York (2004)
Ernst, E., Ostermann, K., Cook, W.R.: A virtual class calculus. In: POPL 2006: Conference record of the 33rd ACM SIGPLAN-SIGACT symposium on Principles of programming languages, pp. 270–282. ACM Press, New York (2006)
Fritz, T., Ségura, M., Südholt, M., Wuchner, E., Menaud, J.M.: An application of dynamic AOP to medical image generation. In: 2nd Dynamic Aspects Workshop (DAW 2005), Technical Report 05.01. Research Institute for Advanced Computer Science, pp. 5–12 (2005)
Gallaire, H., Minker, J.: Logic and Databases. Plenum Press, New York (1978)
Goldsmith, S., O’Callahan, R., Aiken, A.: Relational queries over program traces. In: Proceedings of the 20th Annual ACM SIGPLAN Conference on Object-Oriented Programming, Systems, Languages and Applications, pp. 385–402 (2005)
Gradecki, J.D., Lesiecki, N.: Mastering AspectJ: Aspect-Oriented Programming in Java. Wiley, Chichester (2003)
Trese group. Compose* (2005), http://janus.cs.utwente.nl:8000/twiki/bin/view/Composer/
Kniesel, S.H.G., Rho, T.: Evolvable pattern implementations need generic aspects. In: ECOOP 2004, pp. 116–126 (June 2004)
Gybels, K.: Carma (2004), http://prog.vub.ac.be/~kgybels/Research/AOP.html
Gybels, K., Brichau, J.: Arranging language features for more robust pattern-based crosscuts. In: 2nd International Conference on Aspect-oriented Software Development, pp. 60–69. ACM Press, New York (2003)
Hajiyev, E., Verbaere, M., de Moor, O.: Codequest: scalable source code queries with Datalog. In: Thomas, D. (ed.) ECOOP 2006. LNCS, vol. 4067, pp. 2–27. Springer, Heidelberg (2006)
Hanenberg, S., Unland, R.: Sally (2003), http://dawis.icb.uni-due.de/?id=200
Harrison, W., Ossher, H.: Subject-oriented programming (a critique of pure objects). In: Paepcke, A. (ed.) ACM Conference on Object-Oriented Programming Systems, Languages and Applications (OOPSLA), pp. 411–428. ACM Press, New York (1993)
Hugunin, J.: Support for modifiers in typepatterns (2003), http://dev.eclipse.org/mhonarc/lists/aspectj-users/msg01578.html
Hui, P., Riely, J.: Temporal aspects as security automata. In: Foundations of Aspect-Oriented Languages (FOAL 2006), Workshop at AOSD 2006, Technical Report #06-01, pp. 19–28. Iowa State University (2006)
Janzen, D., de Volder, K.: Navigating and querying code without getting lost. In: 2nd International Conference on Aspect-Oriented Software Development, pp. 178–187 (2003)
Jarzabek, S.: Design of flexible static program analyzers with PQL. IEEE Transactions on Software Engineering 24(3), 197–215 (1998)
Javey, S., Mitsui, K., Nakamura, H., Ohira, T., Yasuda, K., Kuse, K., Kamimura, T., Helm, R.: Architecture of the XL C++ browser. In: CASCON 1992: Proceedings of the 1992 conference of the Centre for Advanced Studies on Collaborative research, pp. 369–379. IBM Press (1992)
Kiczales, G., des Rivieres, J.: The Art of the Metaobject Protocol. MIT Press, Cambridge (1991)
Kiczales, G., Lamping, J., Menhdekar, A., Maeda, C., Lopes, C., Loingtier, J.-M., Irwin, J.: Aspect-oriented programming. In: Aksit, M., Matsuoka, S. (eds.) ECOOP 1997. LNCS, vol. 1241, pp. 220–242. Springer, Heidelberg (1997)
Kiselev, I.: Aspect-oriented programming with AspectJ. SAMS (2002)
Laddad, R.: AspectJ in Action. Manning (2003)
Lam, M.S., Whaley, J., Livshits, V.B., Martin, M.C., Avots, D., Carbin, M., Unkel, C.: Context-sensitive program analysis as database queries. In: PODS 2005: Proceedings of the twenty-fourth ACM SIGMOD-SIGACT-SIGART symposium on Principles of database systems, pp. 1–12. ACM Press, New York (2005)
Lämmel, R., De Schutter, K.: What does aspect-oriented programming mean to Cobol? In: AOSD 2005: Proceedings of the 4th international conference on Aspect-oriented software development, pp. 99–110. ACM Press, New York (2005)
Linton, M.A.: Implementing relational views of programs. In: Henderson, P.B. (ed.) Software Development Environments (SDE), pp. 132–140 (1984)
Martin, M., Livshits, B., Lam, M.S.: Finding application errors using PQL: a program query language. In: Proceedings of the 20th Annual ACM SIGPLAN Conference on Object-Oriented Programming, Systems, Languages and Applications, pp. 365–383 (2005)
McCormick, E., De Volder, K.: JQuery: finding your way through tangled code. In: OOPSLA 2004: Companion to the 19th annual ACM SIGPLAN conference on Object-oriented programming systems, languages, and applications, pp. 9–10. ACM Press, New York (2004)
Miles, R.: AspectJ cookbook. O’Reilly, Sebastopol (2004)
Nystrom, N., Chong, S., Myers, A.C.: Scalable extensibility via nested inheritance. In: OOPSLA 2004: Proceedings of the 19th annual ACM SIGPLAN conference on Object-oriented programming, systems, languages, and applications, pp. 99–115. ACM Press, New York (2004)
Odersky, M., Zenger, M.: Scalable component abstractions. In: OOPSLA 2005: Proceedings of the 20th annual ACM SIGPLAN conference on Object oriented programming, systems, languages, and applications, pp. 41–57. ACM Press, New York (2005)
Ongkingco, N., Avgustinov, P., Tibble, J., Hendren, L., de Moor, O., Sittampalam, G.: Adding open modules to AspectJ. In: AOSD 2006: Proceedings of the 5th international conference on Aspect-oriented software development, pp. 39–50. ACM Press, New York (2006)
Paul, S., Prakash, A.: Querying source code using an algebraic query language. IEEE Transactions on Software Engineering 22(3), 202–217 (1996)
Reps, T.W.: Demand interprocedural program analysis using logic databases. In: Workshop on Programming with Logic Databases, ILPS, pp. 163–196 (1993)
Rho, T., Kniesel, G., Appeltauer, M., Linder, A.: LogicAJ (2006), http://roots.iai.uni-bonn.de/research/logicaj/people
Sereni, D., de Moor, O.: Static analysis of aspects. In: Proceedings of the 2nd International Conference on Aspect-Oriented Software Development (AOSD), pp. 30–39 (2003)
Stolz, V., Bodden, E.: Temporal Assertions using AspectJ. In: RV 2005 - Fifth Workshop on Runtime Verification. Electronical Notes in Theoretical Computer Science, vol. 144(4), pp. 109–124. Elsevier Science Publishers, Amsterdam (2005)
Vanderperren, W., Suvée, D., Cibrán, M.A., De Fraine, B.: Stateful Aspects in JAsCo. In: Gschwind, T., Aßmann, U., Nierstrasz, O. (eds.) SC 2005. LNCS, vol. 3628, pp. 167–181. Springer, Heidelberg (2005)
Visser, E.: Meta-programming with Concrete Object Syntax. In: Batory, D., Consel, C., Taha, W. (eds.) GPCE 2002. LNCS, vol. 2487, pp. 299–315. Springer, Heidelberg (2002)
Walker, D., Zdancewic, S., Ligatti, J.: A theory of aspects. In: ICFP 2003: Proceedings of the eighth ACM SIGPLAN international conference on Functional programming, pp. 127–139. ACM Press, New York (2003)
Walker, R., Viggers, K.: Implementing protocols via declarative event patterns. In: ACM Sigsoft International Symposium on Foundations of Software Engineering (FSE-12), pp. 159–169 (2004)
Wand, M., Kiczales, G., Dutchyn, C.: A semantics for advice and dynamic join points in aspect-oriented programming. ACM Trans. Program. Lang. Syst. 26(5), 890–910 (2004)
Whaley, J., Avots, D., Carbin, M., Lam, M.S.: Using Datalog with Binary Decision Diagrams for Program Analysis. In: Yi, K. (ed.) APLAS 2005. LNCS, vol. 3780, pp. 97–118. Springer, Heidelberg (2005)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2006 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Avgustinov, P. et al. (2006). Aspects for Trace Monitoring. In: Havelund, K., Núñez, M., Roşu, G., Wolff, B. (eds) Formal Approaches to Software Testing and Runtime Verification. FATES RV 2006 2006. Lecture Notes in Computer Science, vol 4262. Springer, Berlin, Heidelberg. https://doi.org/10.1007/11940197_2
Download citation
DOI: https://doi.org/10.1007/11940197_2
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-49699-1
Online ISBN: 978-3-540-49703-5
eBook Packages: Computer ScienceComputer Science (R0)