skip to main content
10.1145/2577080.2577084acmotherconferencesArticle/Chapter ViewAbstractPublication PagesmodularityConference Proceedingsconference-collections
research-article

AspectJML: modular specification and runtime checking for crosscutting contracts

Published:22 April 2014Publication History

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.

References

  1. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  2. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  3. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  4. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  5. J. Boner. Aspectwerks. http://aspectwerkz.codehaus.org/.Google ScholarGoogle Scholar
  6. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  7. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  8. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  9. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  10. 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 ScholarGoogle Scholar
  11. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  12. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  13. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  14. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  15. Y. A. Feldman et al. Jose: Aspects for Design by Contract80--89. IEEE SEFM, 0:80--89, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. R. E. Filman and D. P. Friedman. Aspect-Oriented Programming is Quantification and Obliviousness. Technical report, 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  18. S. Hanenberg and R. Unland. AspectJ idioms for aspect-oriented software construction. In EuroPlop'03, 2003.Google ScholarGoogle Scholar
  19. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  20. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  21. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  22. 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 ScholarGoogle Scholar
  23. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  24. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  25. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  26. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  27. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  28. 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 ScholarGoogle Scholar
  29. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  30. 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 ScholarGoogle Scholar
  31. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  32. B. Meyer. Applying "design by contract". Computer, 25(10):40--51, 1992. Google ScholarGoogle ScholarDigital LibraryDigital Library
  33. B. Meyer. Eiffel: The Language. Prentice-Hall, Inc., Upper Saddle River, NJ, USA, 1992. Google ScholarGoogle ScholarDigital LibraryDigital Library
  34. B. Meyer. Object-Oriented Software Construction. Prentice-Hall, PTR, 2nd edition, 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  35. R.Mitchell, J.McKim, and B.Meyer. Design by contract, by example. Addison Wesley Longman Publishing Co., Inc., Redwood City, CA, USA, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  36. D. L. Parnas. On the criteria to be used in decomposing systems into modules. Commun. ACM, 15:1053--1058, December 1972. Google ScholarGoogle ScholarDigital LibraryDigital Library
  37. 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 ScholarGoogle ScholarCross RefCross Ref
  38. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  39. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  40. {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 ScholarGoogle ScholarCross RefCross Ref
  41. 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 ScholarGoogle Scholar
  42. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  43. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  44. D. S. Rosenblum. A Practical Approach to Programming With Assertions. IEEE Trans. Softw. Eng., 21(1):19--31, Jan. 1995. Google ScholarGoogle ScholarDigital LibraryDigital Library
  45. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  46. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  47. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  48. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  49. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  50. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  51. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  52. 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 ScholarGoogle ScholarCross RefCross Ref
  53. 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 ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. AspectJML: modular specification and runtime checking for crosscutting contracts

                  Recommendations

                  Comments

                  Login options

                  Check if you have access through your login credentials or your institution to get full access on this article.

                  Sign in
                  • Published in

                    cover image ACM Other conferences
                    MODULARITY '14: Proceedings of the 13th international conference on Modularity
                    April 2014
                    264 pages
                    ISBN:9781450327725
                    DOI:10.1145/2577080

                    Copyright © 2014 ACM

                    Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

                    Publisher

                    Association for Computing Machinery

                    New York, NY, United States

                    Publication History

                    • Published: 22 April 2014

                    Permissions

                    Request permissions about this article.

                    Request Permissions

                    Check for updates

                    Qualifiers

                    • research-article

                    Acceptance Rates

                    MODULARITY '14 Paper Acceptance Rate21of60submissions,35%Overall Acceptance Rate41of139submissions,29%

                  PDF Format

                  View or Download as a PDF file.

                  PDF

                  eReader

                  View online with eReader.

                  eReader