skip to main content
research-article

AspectJ code analysis and verification with GASR

Published: 01 July 2016 Publication History

Abstract

We argue for a general-purpose source code analysis tool that is aware of aspects.We present the logic program querying tool GASR, the first such tool.We discuss its implementation along with its library of logical predicates.We show how it can automatically verify previously published aspectual assumptions. Aspect-oriented programming languages extend existing languages with new features for supporting modularization of crosscutting concerns. These features however make existing source code analysis tools unable to reason over this code. Consequently, all code analysis efforts of aspect-oriented code that we are aware of have either built limited analysis tools or were performed manually. Given the significant complexity of building them or manual analysis, a lot of duplication of effort could have been avoided by using a general-purpose tool. To address this, in this paper we present Gasr: a source code analysis tool that reasons over AspectJ source code, which may contain metadata in the form of annotations. GASR provides multiple kinds of analyses that are general enough such that they are reusable, tailorable and can reason over annotations. We demonstrate the use of GASR in two ways: we first automate the recognition of previously identified aspectual source code assumptions. Second, we turn implicit assumptions into explicit assumptions through annotations and automate their verification. In both uses GASR performs detection and verification of aspect assumptions on two well-known case studies that were manually investigated in earlier work. GASR finds already known aspect assumptions and adds instances that had been previously overlooked.

References

[1]
C.N. Angela Lozano, V. Jonckers, Managing traceability links with matraca, 2016.
[2]
M. Aref, B. ten Cate, T.J. Green, B. Kimelfeld, D. Olteanu, E. Pasalic, T.L. Veldhuizen, G. Washburn, Design and implementation of the logicblox system, 2015.
[3]
P. Avgustinov, A.I. Baars, A.S. Henriksen, R.G. Lavender, G. Menzel, O. de Moor, M. Schäfer, J. Tibble, Tracking static analysis violations over time to capture developer characteristics, 2015.
[4]
M. Bravenboer, Y. Smaragdakis, Strictly declarative specification of sophisticated points-to analyses, 44 (2009) 243-262.
[5]
J. Brichau, A. Kellens, S. Castro, T. D'Hondt, Enforcing structural regularities in software using IntensiVE, Sci. Comput. Program., 75 (2010) 232-246.
[6]
W.E. Byrd, Indiana University, 2009.
[7]
R. Chitchyan, J. Fabry, S. Katz, A. Rensink, Editorial for special section on dependencies and interactions with aspects, Trans. Aspect-Oriented Softw. Dev., LNCS 5490 (2009) 133-134.
[8]
L. Christophe, R. Stevens, C. De Roover, W. De Meuter, Prevalence and maintenance of automated functional tests for web applications, 2014.
[9]
C. Clifton, G.T. Leavens, C. Chambers, T. Millstein, MultiJava: modular open classes and symmetric multiple dispatch for Java, ACM, New York, NY, USA, 2000.
[10]
A. Colyer, A. Clement, G. Harley, M. Webster, Eclipse AspectJ: Aspect-oriented programming with AspectJ and the Eclipse AspectJ development tools, Addison-Wesley Professional, Boston, 2004.
[11]
O. de Moor, D. Lacey, E.V. Wyk, Universal regular path queries, Higher-order Symbol. Comput., 16 (2003) 15-35.
[12]
C. De Roover, K. Inoue, The Ekeko/X program transformation tool, 2014.
[13]
C. De Roover, C. Noguera, A. Kellens, V. Jonckers, The SOUL tool suite for querying programs in symbiosis with Eclipse, 2011.
[14]
C. De Roover, R. Stevens, Building development tools interactively using the Ekeko meta-programming library, 2014.
[15]
J. Fabry, C. De Roover, V. Jonckers, Aspectual source code analysis with GASR, 2013.
[16]
J. Fabry, A. Kellens, S. Denier, S. Ducasse, AspectMaps: Extending Moose to visualize AOP software, Sci. Comput. Program., 79 (2014) 6-22.
[17]
J. Fabry, A. Kellens, S. Ducasse, AspectMaps: a scalable visualization of join point shadows, IEEE, 2011.
[18]
J. Fabry, T. Mens, Language-independent detection of object-oriented design patterns, Sci. Comput. Program., 30 (2004) 21-33.
[19]
J. Fabry, A. Zambrano, S. Gordillo, Expressing aspectual interactions in design: Experiences in the slot machine domain, in: Lecture Notes in Computer Science, 6981, Springer Berlin / Heidelberg, 2011, pp. 93-107.
[20]
E. Figueiredo, I. Galvao, S. Khan, A. Garcia, C. Sant'Anna, A. Pimentel, A. Medeiros, L. Fernandes, T. Batista, R. Ribeiro, P. van den Broek, M. Aksit, S. Zschaler, A. Moreira, Detecting architecture instabilities with concern traces: An exploratory study, 2009.
[21]
T. Fritz, G.C. Murphy, Using information fragments to answer the questions developers ask, 2010.
[22]
M. Goldman, E. Katz, S. Katz, MAVEN: Modular aspect verification and interference analysis, Formal Methods Syst. Des., 37 (2010) 61-92.
[23]
E. Hajiyev, M. Verbaere, O. de Moor, CodeQuest: Scalable source code queries with Datalog, 2006.
[24]
S. Hanenberg, A. Schmidmeier, Idioms for building software frameworks in AspectJ, 2003.
[25]
M. Hills, P. Klint, PHP air: Analyzing PHP systems with rascal, 2014.
[26]
M. Hills, P. Klint, J.J. Vinju, An empirical study of PHP feature usage: a static analysis perspective, 2013.
[27]
E. Katz, S. Katz, User queries for specification refinement treating shared aspect join points, in: Proc. 8th IEEE Int'l Conf. Software Engineering and Formal Methods (SEFM'10), 2010, pp. 73-82.
[28]
A. Kellens, K. Mens, J. Brichau, K. Gybels, Managing the evolution of aspect-oriented software with model-based pointcuts, 2006.
[29]
A. Kellens, C. Noguera, K. De Schutter, C. De Roover, T. D'Hondt, Co-evolving annotations and source code through smart annotations, IEEE Computer Society Press, 2010.
[30]
R. Khatchadourian, P. Greenwood, A. Rashid, G. Xu, Pointcut rejuvenation: Recovering pointcut expressions in evolving aspect-oriented software, 2009.
[31]
R. Khatchadourian, A. Rashid, H. Masuhara, T. Watanabe, Detecting broken pointcuts using structural commonality and degree of interest, IEEE press, Lincoln, Nebraska, USA, 2015.
[32]
G. Kiczales, E. Hilsdale, J. Hugunin, M. Kersten, J. Palm, W. Griswold, An overview of AspectJ, in: Proceedings of the 15th European Conference on Object-Oriented Programming (ECOOP 2001), Springer-Verlag, Budapest, Hungary, 2001, pp. 327-353.
[33]
P. Klint, T.v.d. Storm, J. Vinju, Rascal: A domain specific language for source code analysis and manipulation, 2009.
[34]
C. Koppen, M. Stoerzer, PCDiff: Attacking the fragile pointcut problem, 2004.
[35]
R. Laddad, Manning Publications, Greenwich, 2009.
[36]
P. Lam, E. Bodden, O. Lhoták, L. Hendren, The Soot framework for Java program analysis: a retrospective, 2011.
[37]
T.D. LaToza, B.A. Myers, Hard-to-answer questions about code, 2010.
[38]
Y.A. Liu, T. Rothamel, F. Yu, S.D. Stoller, N. Hu, Parametric regular path queries., 2004.
[39]
S. Markstrum, D. Marino, M. Esquivel, T. Millstein, C. Andreae, J. Noble, JavaCOP: Declarative pluggable types for Java, ACM Trans. Program. Lang. Syst., 32 (2010) 1-37.
[40]
M. Martin, B. Livshits, M. Lam, Finding application errors and security flaws using PQL: a program query language, 2005.
[41]
T. Molderez, Universiteit Antwerpen, Antwerp, 2014.
[42]
T. Molderez, C. De Roover, Automated generalization and refinement of code templates with ekeko/x, 2016.
[43]
O. de Moor, M. Verbaere, E. Hajiyev, P. Avgustinov, T. Ekman, N. Ongkingco, D. Sereni, J. Tibble, Keynote address: .ql for source code analysis, 2007.
[44]
C. Noguera, A. Kellens, C. De Roover, V. Jonckers, Refactoring in the presence of annotations, 2012.
[45]
M. Papi, M. Ali, T. Luis Correa, J. Perkins, M. Ernst, Practical pluggable types for Java, 2008.
[46]
Pickering, D., Bodkin, R., 2015. Glassbox project page. Published on-line: http://sourceforge.net/projects/glassbox/, Accessed April 09.
[47]
E. Poll, P. Chalin, D. Cok, J. Kiniry, G.T. Leavens, Beyond assertions: Advanced specification and verification with JML and ESC/Java2, Springer, 2006.
[48]
H. Shen, S. Zhang, J. Zhao, J. Fang, S. Yao, XFindBugs: eXtended FindBugs for AspectJ, 2008.
[49]
J. Sillito, G.C. Murphy, K. De Volder, Questions programmers ask during software evolution tasks, 2006.
[50]
S. Soares, P. Borba, E. Laureano, Distribution and persistence as aspects, Softw. Pract. Exp., 36 (2006) 711-759.
[51]
M. Sridharan, R. Bodík, Refinement-based context-sensitive points-to analysis for Java, 2006.
[52]
R. Stevens, C. De Roover, C. Noguera, V. Jonckers, A history querying tool and its application to detect multi-version refactorings, 2013.
[53]
Z. Ujhelyi, Á. Horváth, D. Varró, N.I. Csiszár, G. Sz¿ke, L. Vidács, R. Ferenc, Anti-pattern detection with model queries: a comparison of approaches, 2014.
[54]
R.-G. Urma, A. Mycroft, Programming language evolution via source code query languages, 2012.
[55]
J. Wloka, R. Hirschfeld, J. Hänsel, Tool-supported refactoring of aspect-oriented programs, ACM, New York, NY, USA, 2008.
[56]
G. Xu, A. Rountev, AJANA: a general framework for source-code-level interprocedural dataflow analysis of AspectJ software, 2008.
[57]
J. Xu, H. Rajan, K. Sullivan, Understanding aspects via implicit invocation, 2004.
[58]
L. Ye, K. De Volder, Tool support for understanding and diagnosing pointcut expressions, ACM, New York, NY, USA, 2008.
[59]
D. Zhang, E. Duala-Ekoko, L. Hendren, Impact analysis and visualization toolkit for static crosscutting in AspectJ, 2009.
[60]
J. Zhao, Change impact analysis for aspect-oriented software evolution, ACM, New York, NY, USA, 2002.
[61]
S. Zschaler, A. Rashid, Aspect assumptions: a retrospective study of AspectJ developers' assumptions about aspect usage, ACM, New York, NY, USA, 2011.

Cited By

View all
  • (2022)Visualization of aspect-oriented programs using city transportation metaphorCluster Computing10.1007/s10586-022-03639-725:6(3993-4008)Online publication date: 1-Dec-2022
  • (2018)A Framework for Assessing Reusability Using Package Cohesion Measure in Aspect Oriented SystemsInternational Journal of Parallel Programming10.1007/s10766-017-0501-646:3(543-564)Online publication date: 1-Jun-2018
  1. AspectJ code analysis and verification with GASR

    Recommendations

    Comments

    Information & Contributors

    Information

    Published In

    cover image Journal of Systems and Software
    Journal of Systems and Software  Volume 117, Issue C
    July 2016
    658 pages

    Publisher

    Elsevier Science Inc.

    United States

    Publication History

    Published: 01 July 2016

    Author Tags

    1. Aspect oriented programming
    2. Logic program querying
    3. Source code analysis

    Qualifiers

    • Research-article

    Contributors

    Other Metrics

    Bibliometrics & Citations

    Bibliometrics

    Article Metrics

    • Downloads (Last 12 months)0
    • Downloads (Last 6 weeks)0
    Reflects downloads up to 13 Jan 2025

    Other Metrics

    Citations

    Cited By

    View all
    • (2022)Visualization of aspect-oriented programs using city transportation metaphorCluster Computing10.1007/s10586-022-03639-725:6(3993-4008)Online publication date: 1-Dec-2022
    • (2018)A Framework for Assessing Reusability Using Package Cohesion Measure in Aspect Oriented SystemsInternational Journal of Parallel Programming10.1007/s10766-017-0501-646:3(543-564)Online publication date: 1-Jun-2018

    View Options

    View options

    Media

    Figures

    Other

    Tables

    Share

    Share

    Share this Publication link

    Share on social media