Uma linguagem específica de domínio para consulta em código orientado a aspectos - Faveri, Cristiano de (2013)
Ensuring code quality is crucial in software development. Not seldom, developers resort to static analysis tools to assist them in both understanding pieces of code and identifying defects or refactoring opportunities during development activities. A critical issue when defining such tools is their ability to obtain information about code. Static analysis tools depend, in general, of an intermediate program representation to identify locations that meet the conditions described in their algorithms. This perspective can be enlarged when techniques of crosscutting concerns modularization, such as aspect-oriented programming (AOP) is applied. In AOP applications, a piece of code can be systematically affected, using both static and dynamic combinations. The main goal of this dissertation is the specification and the implementation of AQL, a domain-specific language (DSL) designed to search aspect-oriented code bases. AQL is a declarative language, based on object query language (OQL), which enables the task of querying elements, relationships and program metrics to support the construction of static analysis and code searching tools for aspect oriented programs. The language was designed in two steps. First, we built a framework (AOPJungle), responsible to extract data from aspect-oriented programs. AOPJungle performs the computation of metrics, inferences and connections between the elements of the program. In the second step, we built an AQL compiler as a reference implementation. We adopted a source-to-source transformation for this step, in which an AQL query is transformed into HQL statements before being executed. In order to evaluate the reference implementation, we developed a static analysis tool for identifying refactoring opportunities in aspect-oriented programs. This tool receives a set of AQL queries to identify potential scenarios where refactoring could be applied.