Using Aspect-Oriented Programming for Querying Source Code

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 provi...

Full description

Bibliographic Details
Published in:Труды Института системного программирования РАН
Main Authors: E. M. Novikov, A. V. Khoroshilov
Format: Article
Language:English
Published: Russian Academy of Sciences, Ivannikov Institute for System Programming 2018-10-01
Subjects:
Online Access:https://ispranproceedings.elpub.ru/jour/article/view/990
Description
Summary: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.
ISSN:2079-8156
2220-6426