AspectJML: modular specification and runtime checking for crosscutting contracts

Aspect-oriented programming (AOP) is a popular technique for modularizing crosscutting concerns. In this context, researchers have found that the realization of design by contract (DbC) is crosscutting and fares better when modularized by AOP. However, previous efforts aimed at supporting crosscutting contract modularity might actually compromise the main DbC principles. For example, in AspectJ-style, reasoning about the correctness of a method call may require a whole-program analysis to determine what advice applies and what that advice does relative to DbC implementation and checking. Also, when contracts are separated from classes a programmer may not know about them and may break them inadvertently. In this paper we solve these problems with AspectJML, a new specification language that supports crosscutting contracts for Java code. We also show how AspectJML supports the main DbC principles of modular reasoning and contracts as documentation.

[1]  Ricardo Lima,et al.  Modular Enforcement of Supertype Abstraction and Information Hiding with Client-Side Checking , 2012 .

[2]  N. H. Beebe on Software Tools for Technology Transfer ( STTT ) , 2005 .

[3]  Gregor Kiczales,et al.  Design pattern implementation in Java and aspectJ , 2002, OOPSLA '02.

[4]  William G. Griswold,et al.  Getting started with ASPECTJ , 2001, CACM.

[5]  Cristina V. Lopes,et al.  A study on exception detection and handling using aspect-oriented programming , 2000, Proceedings of the 2000 International Conference on Software Engineering. ICSE 2000 the New Millennium.

[6]  Cláudio Sant'Anna,et al.  On the Impact of Aspectual Decompositions on Design Stability: An Empirical Study , 2007, ECOOP.

[7]  Márcio Ribeiro,et al.  A design rule language for aspect-oriented programming , 2013, J. Syst. Softw..

[8]  Patrick Th. Eugster,et al.  Can Aspects Implement Contracts? , 2005, RISE.

[9]  Stefan Hanenberg,et al.  AspectJ Idioms for Aspect-Oriented Software Construction , 2003, EuroPLoP.

[10]  Arie van Deursen,et al.  A classification of crosscutting concerns , 2005, 21st IEEE International Conference on Software Maintenance (ICSM'05).

[11]  David S. Rosenblum A Practical Approach to Programming With Assertions , 1995, IEEE Trans. Software Eng..

[12]  David H. Lorenz,et al.  Cona: aspects for contracts and contracts for aspects , 2004, OOPSLA '04.

[13]  David Lorge Parnas,et al.  Precise Documentation: The Key to Better Software , 2010, The Future of Software Engineering.

[14]  Yoonsik Cheon,et al.  A Runtime Assertion Checker for the Java Modeling Language (JML) , 2003, ICSE 2003.

[15]  Gary T. Leavens,et al.  Modular aspect-oriented design rule enforcement with XPIDRs , 2013, FOAL.

[16]  Jean-Marc Jézéquel,et al.  Design by Contract to Improve Software Vigilance , 2006, IEEE Transactions on Software Engineering.

[17]  Yishai A. Feldman,et al.  Jose: Aspects for Design by Contract80-89 , 2006, Fourth IEEE International Conference on Software Engineering and Formal Methods (SEFM'06).

[18]  G. Kiczales,et al.  Aspect-oriented programming and modular reasoning , 2005, Proceedings. 27th International Conference on Software Engineering, 2005. ICSE 2005..

[19]  Gary T. Leavens,et al.  Translucid contracts: expressive specification and modular verification for aspect-oriented interfaces , 2011, AOSD '11.

[20]  Patrice Chalin,et al.  Non-null References by Default in Java: Alleviating the Nullity Annotation Burden , 2007, ECOOP.

[21]  Gary T. Leavens,et al.  Forcing behavioral subtyping through specification inheritance , 1996, Proceedings of IEEE 18th International Conference on Software Engineering.

[22]  Lionel C. Briand,et al.  Instrumenting contracts with aspect-oriented programming to increase observability and support debugging , 2005, 21st IEEE International Conference on Software Maintenance (ICSM'05).

[23]  Cláudio Sant'Anna,et al.  Quantifying the effects of Aspectual Decompositions on Design by Contract Modularization: a Maintenance Study , 2013, Int. J. Softw. Eng. Knowl. Eng..

[24]  Sven Apel,et al.  Types and modularity for implicit invocation with implicit announcement , 2010, TSEM.

[25]  Gary T. Leavens,et al.  Client-aware checking and information hiding in interface specifications with JML/ajmlc , 2013, SPLASH '13.

[26]  Hong Sun,et al.  Investigating the use of analysis contracts to improve the testability of object‐oriented code , 2003, Softw. Pract. Exp..

[27]  Bertrand Meyer,et al.  Eiffel: The Language , 1991 .

[28]  Hridesh Rajan,et al.  On exceptions, events and observer chains , 2013, AOSD.

[29]  Eric Bodden,et al.  Join point interfaces for modular reasoning in aspect-oriented programs , 2011, ESEC/FSE '11.

[30]  K. Rustan M. Leino,et al.  The Spec# Programming System: An Overview , 2004, CASSIS.

[31]  D. L. Parnas,et al.  On the criteria to be used in decomposing systems into modules , 1972, Software Pioneers.

[32]  Sven Apel,et al.  Subclack: feature-oriented programming with behavioral feature interfaces , 2013 .

[33]  Michael D. Ernst,et al.  An overview of JML tools and applications , 2003, International Journal on Software Tools for Technology Transfer.

[34]  Gary T. Leavens,et al.  Behavioral Subtyping, Specification Inheritance, and Modular Reasoning , 2015, ACM Trans. Program. Lang. Syst..

[35]  Sérgio Soares,et al.  Implementing Java modeling language contracts with AspectJ , 2008, SAC '08.

[36]  James C. McKim,et al.  Design by Contract, By Example , 2001, TOOLS.

[37]  Yuanyuan Song,et al.  Modular aspect-oriented design with XPIs , 2010, ACM Trans. Softw. Eng. Methodol..

[38]  Gunter Saake,et al.  Applying Design by Contract to Feature-Oriented Programming , 2012, FASE.

[39]  Cristina V. Lopes,et al.  Aspect-oriented programming , 1999, ECOOP Workshops.

[40]  Marco Tulio Valente,et al.  On the benefits of quantification in AspectJ systems , 2010, Journal of the Brazilian Computer Society.

[41]  G. Leavens,et al.  Modular Contracts with Procedures , Annotations , Pointcuts and Advice , 2011 .

[42]  Friedrich Steimann The paradoxical success of aspect-oriented programming , 2006, OOPSLA '06.

[43]  MeyerBertrand,et al.  Design by Contract , 1997 .

[44]  Sérgio Soares,et al.  Implementing distribution and persistence aspects with aspectJ , 2002, OOPSLA '02.

[45]  Gregor Kiczales,et al.  Aspect-oriented programming , 2001, ESEC/FSE-9.

[46]  Gary T. Leavens,et al.  JML's Rich, Inherited Specifications for Behavioral Subtypes , 2006, ICFEM.

[47]  簡聰富,et al.  物件導向軟體之架構(Object-Oriented Software Construction)探討 , 1989 .

[48]  Daniel P. Friedman,et al.  Aspect-Oriented Programming is Quantification and Obliviousness , 2000 .

[49]  Jianjun Zhao,et al.  Pipa: A Behavioral Interface Specification Language for AspectJ , 2003, FASE.

[50]  Viktor Kuncak,et al.  Crosscutting techniques in program specification and analysis , 2005, AOSD '05.

[51]  Manuel Fähndrich,et al.  Embedded contract languages , 2010, SAC '10.

[52]  Gary T. Leavens,et al.  Optimizing generated aspect-oriented assertion checking code for JML using program transformations: An empirical study , 2013, Sci. Comput. Program..

[53]  Bertrand Meyer,et al.  Applying 'design by contract' , 1992, Computer.

[54]  Albert L. Baker,et al.  Preliminary design of JML: a behavioral interface specification language for java , 2006, SOEN.

[55]  David S. Rosenblum,et al.  A historical perspective on runtime assertion checking in software development , 2006, SOEN.