Preview

Proceedings of the Institute for System Programming of the RAS (Proceedings of ISP RAS)

Advanced search

Using Aspect-Oriented Programming for Querying Source Code

https://doi.org/10.15514/ISPRAS-2012-23-21

Abstract

Querying source code helps developers to discover code fragments of interest and to determine their interrelations with each other. Different approaches exist to execute source code queries automatically. Some of them are based on a rather simple text pattern matching. More advanced approaches provide abilities to use natural languages for queries and perform matching on the basis of a formal program representation. We suggest using aspect-oriented programming for querying source code and consider advantages and disadvantages of this approach. The paper introduces main conceptions of aspect-oriented programming and briefly presents C Instrumentation Framework – an aspect-oriented programming implementation for the C programming language. We slightly extended C Instrumentation Framework so that it could execute source code queries written in form of aspects. The paper gives several examples of utilization of the suggested approach in particular for collecting information required for generating environment models for device drivers in the Linux Driver Verification project. The suggested approach is inferior to special querying tools in making queries by control and data flows. But it is simple in implementation and allows one to use traditional means of aspect-oriented programming for developing and executing source code queries.

About the Authors

E. M. Novikov
ISP RAS, Moscow
Russian Federation


A. V. Khoroshilov
ISP RAS, Moscow
Russian Federation


References

1. Paul S., Prakash A. Querying Source Code using an Algebraic Query Language. In Proc. International Conference on Software Maintenance (ICSM), pp. 127-136, 1994. doi: 10.1109/ICSM.1994.336782

2. Mutilin V.S., Novikov E.M., Strakh А.V., Khoroshilov А.V., Shved P.E. Аrkhitektura Linux Driver Verification [Linux Driver Verification Architecture]. Trudy ISP RАN [The Proceedings of ISP RAS], vol. 20, pp. 163-187, 2011 (in Russian).

3. Khoroshilov A., Mutilin V., Novikov E., Shved P., Strakh A. Towards an Open Framework for C Verification Tools Benchmarking. In Proc. Perspectives of Systems Informatics (PSI), LNCS, vol 7162, pp. 82-91, 2012. doi: 10.1007/978-3-642-29709-0_17.

4. Linux Driver Verification Project. http://forge.ispras.ru/projects/ldv.

5. Novikov E. One Approach to Aspect-Oriented Programming Implementation for the C programming language. In Proc. 5th Spring/Summer Young Researchers' Colloquium on Software Engineering (SYRCoSE), pp. 74-81, 2011.

6. C Instrumentation Framework: aspect-oriented programming implementation for the C programming language. http://forge.ispras.ru/projects/cif.

7. AspectJ: aspect-oriented programming implementation for the Java programming language. http://www.eclipse.org/aspectj.

8. GNU Compiler Collection. http://gcc.gnu.org.

9. Paul S., Prakash A. A framework for source code search using program patterns. IEEE Transactions on Software Engineering, pp. 463–475, 1994. doi: 10.1109/32.295894

10. Griswold W.G., Atkinson D.C., McCurdy C. Fast, flexible syntactic pattern matching and processing. In Proc. 4th International Workshop on Program Comprehension (WPC), pp. 144-153, 1996. doi: 10.1109/WPC.1996.501129

11. Ebert J., Kullbach B., Winter A. Querying as an Enabling Technology in Software Reengineering. In Proc. 3rd European Conference on Software Maintenance and Reengineering (CSMR), pp. 42-50, 1999. doi: 10.1109/CSMR.1999.756681

12. Hajiyev E., Verbaere M., de Moor O. CodeQuest: scalable source code queries with datalog. In Proc. ECOOP 2006 – Object-Oriented Programming, LNCS, vol. 4067, pp. 2-27, 2006. doi: 10.1007/11785477_2

13. Robillard M.P., Murphy G.C. Concern graphs: finding and describing concerns using structural program dependencies. In Proc. 24th International Conference on Software Engineering (ICSE), pp. 406-416, 2002. doi: 10.1145/581339.581390

14. Janzen D., Volder K.D. Navigating and querying code without getting lost. In Proc. 2nd international conference on Aspect-Oriented Software Development (AOSD), pp. 178-187, 2003. doi: 10.1145/643603.643622

15. Eclipse IDE. http://www.eclipse.org.

16. Stuart H. Hunting bugs with Coccinelle. University of Copenhagen, Masters Thesis, 2008.

17. Kimmig M., Monperrus M., Mezini M. Querying source code with natural language. In Proc. 26th IEEE/ACM International Conference on Automated Software Engineering (ASE), pp. 376-379, 2011. doi: 10.1109/ASE.2011.6100076


Review

For citations:


Novikov E.M., Khoroshilov A.V. Using Aspect-Oriented Programming for Querying Source Code. Proceedings of the Institute for System Programming of the RAS (Proceedings of ISP RAS). 2012;23. (In Russ.) https://doi.org/10.15514/ISPRAS-2012-23-21



Creative Commons License
This work is licensed under a Creative Commons Attribution 4.0 License.


ISSN 2079-8156 (Print)
ISSN 2220-6426 (Online)