ABSTRACT
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.
- M. Bagherzadeh, H. Rajan, and A. Darvish. On exceptions, events and observer chains. In Proceedings of the 12th annual international conference on Aspect-oriented software development, AOSD '13, pages 185--196, New York, NY, USA, 2013. ACM. Google ScholarDigital Library
- M. Bagherzadeh, H. Rajan, G. T. Leavens, and S. Mooney. Translucid contracts: Expressive specification and modular verification for aspect-oriented interfaces. In Proceedings of the tenth international conference on Aspect-oriented software development, AOSD '11, pages 141--152, New York, NY, USA, Mar. 2011. ACM. Google ScholarDigital Library
- S. Balzer, P. T. Eugster, and B. Meyer. Can Aspects Implement Contracts. In In: Proceedings of RISE 2005 (Rapid Implementation of Engineering Techniques, pages 13--15, September 2005. Google ScholarDigital Library
- M. Barnett, K. R. M. Leino, and W. Schulte. The Spec# programming system: an overview. In G. Barthe, L. Burdy,M. Huisman, J.-L. Lanet, and T. Muntean, editors, Post Conference Proceedings of CASSIS: Construction and Analysis of Safe, Secure and Interoperable Smart devices, Marseille, volume 3362 of LNCS. Springer-Verlag, 2005. Google ScholarDigital Library
- J. Boner. Aspectwerks. http://aspectwerkz.codehaus.org/.Google Scholar
- L. C. Briand, W. J. Dzidek, and Y. Labiche. Instrumenting Contracts with Aspect-Oriented Programming to Increase Observability and Support Debugging. In ICSM '05: Proceedings of the 21st IEEE International Conference on Software Maintenance (ICSM'05), pages 687--690, Washington, DC, USA, 2005. IEEE Computer Society. Google ScholarDigital Library
- L. C. Briand, Y. Labiche, and H. Sun. Investigating the use of analysis contracts to improve the testability of object-oriented code. Softw. Pract. Exper., 33:637--672, June 2003. Google ScholarDigital Library
- L. Burdy, Y. Cheon, D. R. Cok, M. D. Ernst, J. R. Kiniry, G. T. Leavens, K. R. M. Leino, and E. Poll. An overview of JML tools and applications. International Journal on Software Tools for Technology Transfer (STTT), 7(3):212--232, June 2005. Google ScholarDigital Library
- P. Chalin and P. R. James. Non-null references by default in java: alleviating the nullity annotation burden. In Proceedings of the 21st European conference on Object-Oriented Programming, ECOOP'07, pages 227--247, Berlin, Heidelberg, 2007. Springer-Verlag. Google ScholarDigital Library
- Y. Cheon and G. T. Leavens. A runtime assertion checker for the Java Modeling Language (JML). In H. R. Arabnia and Y. Mun, editors, Proceedings of the International Conference on Software Engineering Research and Practice (SERP '02), Las Vegas, Nevada, USA, June 24-27, 2002, pages 322--328. CSREA Press, June 2002.Google Scholar
- L. A. Clarke and D. S. Rosenblum. A historical perspective on runtime assertion checking in software development. SIGSOFT Softw. Eng. Notes, 31:25--37, May 2006. Google ScholarDigital Library
- A. Costa Neto, R. Bonifácio, M. Ribeiro, C. E. Pontual, P. Borba, and F. Castor. A Design Rule Language for Aspect-oriented Programming. J. Syst. Softw., 86(9):2333--2356, Sept. 2013. Google ScholarDigital Library
- K. K. Dhara and G. T. Leavens. Forcing behavioral subtyping through specification inheritance. In Proceedings of the 18th International Conference on Software Engineering, Berlin, Germany, pages 258--267. IEEE Computer Society Press, Mar. 1996. A corrected version is ISU CS TR #95-20c, http://tinyurl.com/s2krg. Google ScholarDigital Library
- M. Fähndrich, M. Barnett, and F. Logozzo. Embedded contract languages. In Proceedings of the 2010 ACM Symposium on Applied Computing, SAC '10, pages 2103--2110, New York, NY, USA, 2010. ACM. Google ScholarDigital Library
- Y. A. Feldman et al. Jose: Aspects for Design by Contract80--89. IEEE SEFM, 0:80--89, 2006. Google ScholarDigital Library
- R. E. Filman and D. P. Friedman. Aspect-Oriented Programming is Quantification and Obliviousness. Technical report, 2000. Google ScholarDigital Library
- P. Greenwood, T. Bartolomei, E. Figueiredo, M. Dosea, A. Garcia, N. Cacho, C. Sant'Anna, S. Soares, P. Borba, U. Kulesza, and A. Rashid. On the Impact of Aspectual Decompositions on Design Stability: An Empirical Study. In Proceedings of the 21st European conference on Object-Oriented Programming, LNCS, pages 176--200. Springer-Verlag, 2007. Google ScholarDigital Library
- S. Hanenberg and R. Unland. AspectJ idioms for aspect-oriented software construction. In EuroPlop'03, 2003.Google Scholar
- J. Hannemann and G. Kiczales. Design pattern implementation in Java and AspectJ. In Proceedings of the 17th ACM SIGPLAN conference on Object-oriented programming, systems, languages, and applications, OOPSLA '02, pages 161--173, New York, NY, USA, 2002. ACM. Google ScholarDigital Library
- M. Inostroza, E. Tanter, and E. Bodden. Join point interfaces for modular reasoning in aspect-oriented programs. In Proceedings of the 19th ACM SIGSOFT symposium and the 13th European conference on Foundations of software engineering, ESEC/FSE '11, pages 508--511, New York, NY, USA, 2011. ACM. Google ScholarDigital Library
- G. Kiczales, E. Hilsdale, J. Hugunin, M. Kersten, J. Palm, and W. Griswold. Getting Started with AspectJ. Commun. ACM, 44:59--65, October 2001. Google ScholarDigital Library
- G. Kiczales, J. Lamping, A. Mendhekar, C. Maeda, C. Lopes, J.-M. Loingtier, and J. Irwin. Aspect-oriented programming. In M. Aksit and S.Matsuoka, editors, ECOOP'97 Object-Oriented Programming, volume 1241 of Lecture Notes in Computer Science, pages 220--242. Springer Berlin / Heidelberg, 1997.Google Scholar
- G. Kiczales and M. Mezini. Aspect-oriented programming and modular reasoning. In Proceedings of the 27th international conference on Software engineering, ICSE '05, pages 49--58, New York, NY, USA, 2005. ACM. Google ScholarDigital Library
- P. Lam, V. Kuncak, and M. Rinard. Crosscutting Techniques in Program Specification and Analysis. In Proceedings of the 4th International Conference on Aspect-oriented Software Development, AOSD'05, pages 169--180, New York, NY, USA, 2005. ACM. Google ScholarDigital Library
- Y. Le Traon, B. Baudry, and J.-M. Jezequel. Design by contract to improve software vigilance. IEEE Trans. Softw. Eng., 32(8):571--586, Aug. 2006. Google ScholarDigital Library
- G. T. Leavens. JML's rich, inherited specifications for behavioral subtypes. In Z. Liu and H. Jifeng, editors, Formal Methods and Software Engineering: 8th International Conference on Formal Engineering Methods (ICFEM), volume 4260 of Lecture Notes in Computer Science, pages 2--34, New York, NY, Nov. 2006. Springer-Verlag. Google ScholarDigital Library
- G. T. Leavens, A. L. Baker, and C. Ruby. Preliminary design of JML: A behavioral interface specification language for Java. ACM SIGSOFT Software Engineering Notes, 2006. Google ScholarDigital Library
- G. T. Leavens and D. A. Naumann. Behavioral subtyping, specification inheritance, and modular reasoning. Technical Report CS-TR-13-03a, Computer Science, University of Central Florida, Orlando, FL, 32816, July 2013.Google Scholar
- M. Lippert and C. V. Lopes. A study on exception detection and handling using aspect-oriented programming. In Proceedings of the 22nd international conference on Software engineering, ICSE '00, pages 418--427, New York, NY, USA, 2000. ACM. Google ScholarDigital Library
- C. V. Lopes, M. Lippert, and E. A. Hilsdale. Design By Contract with Aspect-Oriented Programming. In U.S. Patent No. 06,442,750, issued August 27, 2002.Google Scholar
- M. Marin, L. Moonen, and A. van Deursen. A Classification of Crosscutting Concerns. In ICSM '05: Proceedings of the 21st IEEE International Conference on Software Maintenance, pages 673--676, Washington, DC, USA, 2005. IEEE Computer Society. Google ScholarDigital Library
- B. Meyer. Applying "design by contract". Computer, 25(10):40--51, 1992. Google ScholarDigital Library
- B. Meyer. Eiffel: The Language. Prentice-Hall, Inc., Upper Saddle River, NJ, USA, 1992. Google ScholarDigital Library
- B. Meyer. Object-Oriented Software Construction. Prentice-Hall, PTR, 2nd edition, 2000. Google ScholarDigital Library
- R.Mitchell, J.McKim, and B.Meyer. Design by contract, by example. Addison Wesley Longman Publishing Co., Inc., Redwood City, CA, USA, 2002. Google ScholarDigital Library
- D. L. Parnas. On the criteria to be used in decomposing systems into modules. Commun. ACM, 15:1053--1058, December 1972. Google ScholarDigital Library
- D. L. Parnas. Precise Documentation: The Key to Better Software. In S. Nanz, editor, The Future of Software Engineering, pages 125--148. Springer Berlin Heidelberg, 2011.Google ScholarCross Ref
- H. Rebêlo, G. T. Leavens, and R. M. Lima. Client-aware Checking and Information Hiding in Interface Specifications with JML/Ajmlc. In Proceedings of the 2013 Companion Publication for Conference on Systems, Programming, & Applications: Software for Humanity, SPLASH '13, pages 11--12, New York, NY, USA, 2013. ACM. Google ScholarDigital Library
- H. Rebêlo, G. T. Leavens, R. M. F. Lima, P. Borba, and M. Ribeiro. Modular aspect-oriented design rule enforcement with XPIDRs. In Proceedings of the 12th workshop on Foundations of aspect-oriented languages, FOAL '13, pages 13--18, New York, NY, USA, 2013. ACM. Google ScholarDigital Library
- {40} H. Rebêlo, R. Lima, U. Kulesza, C. Sant'Anna, Y. Cai, R. Coelho, and M. Ribeiro. Quantifying the Effects of Aspectual Decompositions on Design By Contract Modularization: A Maintenance Study. International Journal of Software Engineering and Knowledge Engineering, 2013.Google ScholarCross Ref
- H. Rebêlo, R. Lima, and G. T. Leavens. Modular Contracts with Procedures, Annotations, Pointcuts and Advice. In SBLP '11: Proceedings of the 2011 Brazilian Symposium on Programming Languages. Brazilian Computer Society, 2011.Google Scholar
- H. Rebêlo, R. Lima, G. T. Leavens, M. Cornélio, A. Mota, and C. Oliveira. Optimizing generated aspect-oriented assertion checking code for JML using program transformations: An empirical study. Science of Computer Programming, 78(8):1137--1156, 2013. Google ScholarDigital Library
- H. Rebêlo, S. Soares, R. Lima, L. Ferreira, and M. Cornélio. Implementing Java modeling language contracts with AspectJ. In Proceedings of the 2008 ACM symposium on Applied computing, SAC '08. ACM, 2008. Google ScholarDigital Library
- D. S. Rosenblum. A Practical Approach to Programming With Assertions. IEEE Trans. Softw. Eng., 21(1):19--31, Jan. 1995. Google ScholarDigital Library
- T. Skotiniotis and D. H. Lorenz. Cona: aspects for contracts and contracts for aspects. In Companion to the 19th annual ACM SIGPLAN conference on Object-oriented programming systems, languages, and applications, OOPSLA '04, pages 196--197, New York, NY, USA, 2004. ACM. Google ScholarDigital Library
- S. Soares, E. Laureano, and P. Borba. Implementing distribution and persistence aspects with AspectJ. In Proceedings of the 17th ACM SIGPLAN conference on Object-oriented programming, systems, languages, and applications, OOPSLA '02, pages 174--190, New York, NY, USA, 2002. ACM. Google ScholarDigital Library
- F. Steimann. The Paradoxical Success of Aspect-Oriented Programming. In OOPSLA 2006: Proceedings of the 21st International Conference on Object-oriented Programming Systems, Languages, and Applications, ACM SIGPLAN Notices, pages 481--497, New York, NY, Oct. 2006. ACM. Google ScholarDigital Library
- F. Steimann, T. Pawlitzki, S. Apel, and C. K¨astner. Types and modularity for implicit invocation with implicit announcement. ACM Trans. Softw. Eng. Methodol., 20(1):1:1--1:43, July 2010. Google ScholarDigital Library
- K. Sullivan, W. G. Griswold, H. Rajan, Y. Song, Y. Cai, M. Shonle, and N. Tewari. Modular Aspect-oriented Design with XPIs. ACM Trans. Softw. Eng. Methodol., 20(2):5:1--5:42, Sept. 2010. Google ScholarDigital Library
- T. Thüm, S. Apel, A. Zelend, R. Schröter, and B. Möller. Subclack: Feature-oriented Programming with Behavioral Feature Interfaces. In Proceedings of the 5th Workshop on MechAnisms for SPEcialization, Generalization and inHerItance, MASPEGHI '13, pages 1--8, New York, NY, USA, 2013. ACM. Google ScholarDigital Library
- T. Thüm, I. Schaefer, M. Kuhlemann, S. Apel, and G. Saake. Applying design by contract to feature-oriented programming. In Proceedings of the 15th international conference on Fundamental Approaches to Software Engineering, FASE'12, pages 255--269, Berlin, Heidelberg, 2012. Springer-Verlag. Google ScholarDigital Library
- M. T. Valente, C. Couto, J. Faria, and S. Soares. On the benefits of quantification in AspectJ systems. Journal of the Brazilian Computer Society, 16(2):133--146, 2010.Google ScholarCross Ref
- J. Zhao and M. Rinard. Pipa: a behavioral interface specification language for AspectJ. In Proceedings of the 6th international conference on Fundamental approaches to software engineering, FASE'03, pages 150--165, Berlin, Heidelberg, 2003. Springer-Verlag. Google ScholarDigital Library
Index Terms
- AspectJML: modular specification and runtime checking for crosscutting contracts
Recommendations
Aspect-Oriented Programming Reloaded
SBLP '17: Proceedings of the 21st Brazilian Symposium on Programming LanguagesMany programs have crosscutting concerns for which neither procedural nor object-oriented programming adequately modularize, which has led to the idea of aspect-oriented programming (AOP). However, AOP has not found favor with the programming languages ...
Modularizing crosscutting contracts with AspectJML
MODULARITY '14: Proceedings of the companion publication of the 13th international conference on ModularityIt is claimed in the literature that the contracts of a system present crosscutting structure during its realization. In this context, there has been attempts to improve separation of crosscutting contracts, e.g. by aspect-oriented programming and ...
Identifying and specifying crosscutting contracts with AspectJML
SPLASH '13: Proceedings of the 2013 companion publication for conference on Systems, programming, & applications: software for humanityI propose AspectJML, a simple and practical aspect-oriented extension to JML. It supports the specification of crosscutting contracts for Java code in a modular way while keeping the benefits of a design by contract language, like documentation and ...
Comments