Checking Design Constraints at Run-time Using OCL and AspectJ

Design decisions and constraints of a software system can be specified precisely using a formal notation such as the Object Constraint Language (OCL). However, they are not executable, and assuring the conformance of an implementation to its design is hard. The inability of expressing design constraints in an implementation and checking them at runtime invites, among others, the problem of design drift and corrosion. We propose runtime checks as a solution to mitigate this problem. The key idea of our approach is to translate design constraints written in a formal notation such as OCL into aspects that, when applied to a particular implementation, check the constraints at run-time. Our approach enables runtime verification of designimplementation conformance and detects design corrosion. The approach is modular and plug-and-playable; the constraint checking logic is completely separated from the implementation modules which are oblivious of the former. We believe that a significant portion of constraints translation can be automated.

[1]  C. A. R. HOARE,et al.  An axiomatic basis for computer programming , 1969, CACM.

[2]  Anneke Kleppe,et al.  The Object Constraint Language: Getting Your Models Ready for MDA , 2003 .

[3]  William G. Griswold,et al.  An Overview of AspectJ , 2001, ECOOP.

[4]  Jeannette M. Wing,et al.  A behavioral notion of subtyping , 1994, TOPL.

[5]  Gary T. Leavens,et al.  A Simple and Practical Approach to Unit Testing: The JML and JUnit Way , 2002, ECOOP.

[6]  Ralph Johnson,et al.  design patterns elements of reusable object oriented software , 2019 .

[7]  David Lorge Parnas,et al.  Using Test Oracles Generated from Program Documentation , 1998, IEEE Trans. Software Eng..

[8]  Yoonsik Cheon,et al.  A Library-Based Approach to Translating OCL Constraints to JML Assertions for Runtime Checking , 2008, Software Engineering Research and Practice.

[9]  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).

[10]  Axel Uhl,et al.  Model-Driven Architecture , 2002, OOIS Workshops.

[11]  Lionel C. Briand,et al.  Lessons Learned from Developing a Dynamic OCL Constraint Enforcement Tool for Java , 2005, MoDELS.

[12]  Ali Hamie,et al.  Translating the Object Constraint Language into the Java Modelling Language , 2004, SAC '04.

[13]  Kent Beck,et al.  Test-infected: programmers love writing tests , 2000 .

[14]  Alan W. Brown Model driven architecture: Principles and practice , 2004, Software and Systems Modeling.

[15]  Stephen H. Edwards,et al.  Model variables: cleanly supporting abstraction in design by contract , 2005, Softw. Pract. Exp..

[16]  Yoonsik Cheon Automated Random Testing to Detect Specification-Code Inconsistencies , 2007, SETP.

[17]  Lorenz Froihofer,et al.  Overview and Evaluation of Constraint Validation Approaches in Java , 2007, 29th International Conference on Software Engineering (ICSE'07).

[18]  Gary T. Leavens,et al.  A contextual interpretation of undefinedness for runtime assertion checking , 2005, AADEBUG'05.

[19]  Martin Fowler,et al.  Refactoring - Improving the Design of Existing Code , 1999, Addison Wesley object technology series.

[20]  B. Demuth,et al.  Model and Object Verification by Using Dresden OCL , 2009 .

[21]  Thomas O. Meservy,et al.  Transforming software development: an MDA road map , 2005, Computer.

[22]  David Coppit,et al.  On the Use of Specification-Based Assertions as Test Oracles , 2005, 29th Annual IEEE/NASA Software Engineering Workshop.

[23]  Ivar Jacobson,et al.  Unified Modeling Language Reference Manual, The (2nd Edition) , 2004 .

[24]  Martin Gogolla,et al.  Aspect-Oriented Monitoring of UML and OCL Constraints , 2007 .

[25]  Tommi Mikkonen,et al.  Run-time monitoring of architecturally significant behaviors using behavioral profiles and aspects , 2006, ISSTA '06.

[26]  Ivar Jacobson,et al.  The unified modeling language reference manual , 2010 .

[27]  Heinrich Hußmann,et al.  Modular architecture for a toolset supporting OCL , 2000, Sci. Comput. Program..

[28]  Alexander L. Wolf,et al.  Acm Sigsoft Software Engineering Notes Vol 17 No 4 Foundations for the Study of Software Architecture , 2022 .

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

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

[31]  Heinrich Hußmann,et al.  On the Precise Meaning of OCL Constraints , 2002, Object Modeling with the OCL.