An Approach About Monitoring Generic Properties on C Programs Using Aspect-Oriented Programming with ACC (AspeCtC)
Volume 4, Issue 3, May 2016, Pages: 50-58
Received: Jun. 7, 2016;
Published: Jun. 8, 2016
Views 3722 Downloads 121
Pikeroen Olivier, College of Computer Science and Technology, Nanjing University of Aeronautics and Astronautics, Nanjing, China
For systems which deal with serious or dangerous things (for example nuclear power plant), programs are constrained by legislation to be safe in any case, which requires verification process during the execution, in other words “Runtime Verification” (RV). The field of runtime verification has many different names: runtime monitoring, runtime checking, runtime result checking, runtime reflection, monitoring oriented programming, design by contract, runtime analysis, dynamic analysis, trace analysis, fault protection, etc. Aspect-oriented programming (AOP) is a useful paradigm for monitoring programs, even if it was not created for this purpose. Indeed, AOP tries to deal with crosscutting concerns (tangled and scattered codes) by “capturing” them within a new entity called aspect, and runtime verification properties are conceptually transversal to the code they verify, unavoidably resulting in such crosscutting codes. AOP is always used as an extension of an existing language. Hence it is necessary to design an aspect language extending the target language, and to use what is called a weaver, to realize a binding operation between the target program and the aspects. Thus, one can find many aspect-programming extensions (including an aspect language and an aspect weaver) for most programming languages. The first one to be developed was AspectJ, designed for Java, and which has been the best-known reference among aspect-oriented tools until now. We use an AspectJ-like tool, straight inspired from AspectJ but designed for C, called ACC, which is itself an improved version of AspectC. The purpose of this paper is to explore the possibility of implementing and monitoring generic (also called parameterized) verification properties, i.e. which could be used on any target code, with ACC through a basic example. As ACC, contrary to AspectJ, does not provide abstraction for aspects, which would have made generic monitoring an easy task, we tried to simulate abstraction by making use of macros in the aspect code, which boils down to monitor every parameterized property within one macro function. We will see that despite losses of expressiveness without complexification of the monitoring code, the method still allows monitoring generically any property which is already monitorable directly in ACC.
An Approach About Monitoring Generic Properties on C Programs Using Aspect-Oriented Programming with ACC (AspeCtC), Software Engineering.
Vol. 4, No. 3,
2016, pp. 50-58.
Bram Adams, “Co-evolution of Source Code and the Build System: Impact on the Introduction of AOSD in Legacy Systems”, PhD thesis in Ghent University, Department of Information Technology, (March 2008).
Bram Adams and Tom Tourwe, “Aspect orientation for C: express yourself”, in 3rd Software-Engineering Properties of Languages and Aspect Technologies Workshop (SPLAT), AOSD (2005).
Remi Douence, Thomas Fritz, Nicolas Loriant, Jean-Marc Menaud, Marc Segura-Devillechaise, and Mario Sudholt, “An expressive aspect language for system applications with Arachne”, in Transactions on Aspect-Oriented Software Development I, Lecture Notes on Computer Science, vol. 3880, pp 174-213 (2006).
Ylies Falcone, Klaus Havelund, and Giles Reger, “A tutorial on runtime verification”, in Engineering Dependable Software Systems, vol. 34, pp 141-175 (2013).
Klaus Havelund, “Runtime verification of C programs”, in Proceedings of the 20th IFIP TC 6/WG 6.1 International Conference on Testing of Communicating Systems (TestCom 2008) and the 8th International Workshop on Formal Approaches to Testing of Software (FATES 2008), Lecture Notes in Computer Science, vol. 5047, pp 7-22 (2008).
Klaus Havelund and Eric Van Wyk, “Aspect-oriented monitoring of C programs”, in the 3rd Domain-Specific Aspect Languages Workshop (2008).
Gregor Kiczales, John Lamping, Anurag Mendhekar, Chris Maeda, Cristina Videira Lopes, Jean-Marc Loingtier, and John Irwin, “Aspect-oriented programming”, in Proceedings of the 11th European Conference on Object-Oriented Programming (ECOOP 1997), Lecture Notes in Computer Science, vol. 1241, pp 220-242 (1997).
Martin Leucker and Christian Schallhart, “A brief account of runtime verification”, in The Journal of Logic and Algebraic Programming, vol. 78, pp 293-303 (2009).
Daniel Lohmann, Georg Blaschke, and Olaf Spinczyk, “Generic advice: On the combination of AOP with generative programming in AspectC++”, in Proceedings of the Third International Conference on Generative Programming and Component Engineering (GPCE 2004), Lecture Notes in Computer Science, vol. 3286, pp 55-74 (2004).
E. M. Novikov, “An approach to implementation of aspect-oriented programming for C”, in Programming and Computer Software, vol. 39, pp 194-206 (2013).
Justin Seyster, Ketan Dixit, Xiaowan Huang, Radu Grosu, Klaus Havelund, Scott A. Smolka, Scott D. Stoller, and Erez Zadok, “Inter Aspect: Aspect-oriented instrumentation with GCC”, in Formal Methods in System Design, vol. 41, pp 295-320 (December 2012).
Olaf Spinczyk and Daniel Lohmann, “The design and implementation of AspectC++”, in Knowledge-Based Systems, vol. 20, pp 636-651 (2007).
Charles Zhang and Hans-Arno Jacobsen, “TinyC2: Towards building a dynamic weaving aspect language for C”, in Proceedings of the 2nd AOSD Workshop on Foundations of Aspect-Oriented Languages (March 2003).
Zhe Chen, Zhemin Wang, Yunlong Zhu, Hongwei Xi, and Zhibin Yang, “Parametric runtime verification of C programs”, in Proceedings of the 22nd International Conference on Tools and Algorithms for the Construction and Analysis of Systems (TACAS 2016), Lecture Notess in Computer Science, vol. 9636, pp 299-315 (2016).