Abstract
Analysis and design by contract allows the definition of a formal agreement between a class and its clients, expressing each party’s rights and obligations. Contracts written in the Object Constraint Language (OCL) are known to be a useful technique to specify the precondition and postcondition of operations and class invariants in a UML context, making the definition of object-oriented analysis or design elements more precise while also helping in testing and debugging. In this article, we report on the experiences with the development of ocl2j, a tool that automatically instruments OCL constraints in Java programs using aspect-oriented programming (AOP). The approach strives for automatic and efficient generation of contract code, and a non-intrusive instrumentation technique. A summary of our approach is given along with the results of an initial case study, the discussion of encountered problems, and the necessary future work to resolve the encountered issues.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
References
Szyperski, C.: Component Software, 2nd edn. ACM Press, New York (2002)
Briand, L.C., et al.: A Controlled Experiment on the Impact of the Object Constraint Language in UML-Based Development. In: IEEE ICSM, pp. 380–389 (2004)
Emmerich, W.: Engineering Distributed Objects. Wiley, Chichester (2000)
Kleppe, A., Warmer, J., Bast, W.: MDA Explained - The Model Driven Architecture: Practice and Promise. Addison-Wesley, Reading (2003)
Briand, L.C., Labiche, Y., Sun, H.: Investigating the Use of Analysis Contracts to Improve the Testability of Object-Oriented Code. Software - Practice and Experience 33(7), 637–672 (2003)
Briand, L.C., Dzidek, W., Labiche, Y.: Using Aspect-Oriented Programming to Instrument OCL Contracts in Java (2004), SCE-04-03, http://www.sce.carleton.ca/squall
Finger, F.: Design and Implementation of a Modular OCL Compiler. Dresden University of Technology (2000)
Wiebicke, R.: Utility Support for Checking OCL Business Rules in Java Programs. Dresden University of Technology (2000)
LCI, Object Constraint Language Environment (OCLE), http://lci.cs.ubbcluj.ro/ocle/
Liskov, B.: Data Abstraction and Hierarchy. SIGPLAN Notices 23(5) (1988)
Plösch, R.: Evaluation of Assertion Support for the Java Programming Language. Journal of Object Technology 1(3) (2002)
Lackner, M., Krall, A., Puntigam, F.: Supporting Design by Contract in Java. Journal of Object Technology 1(3) (2002)
Appel, A.W.: Modern Compiler Implementation in Java, 2nd edn. Cambridge University Press, Cambridge (2002)
Elrad, T., Filman, R.E., Bader, A.: Aspect-oriented programming: Introduction. Communications of the ACM 44(10), 29–32 (2001)
Briand, L.C., Dzidek, W.J., Labiche, Y.: Instrumenting Contracts with Aspect-Oriented Programming to Increase Observability and Support Debugging. IEEE International Conference on Software Maintenance (2005)
Warmer, J., Kleppe, A.: The Object Constraint Language. Addison-Wesley, Reading (1999)
Bloch, J.: Effective Java: Programming Language Guide. Addison-Wesley, Reading (2001)
Hussmann, H., Finger, F., Wiebicke, R.: Using Previous Property Values in OCL Postconditions - An Implementation Perspective. In: < <UML> >2000 Workshop - UML 2.0 - The Future of the UML Constraint Language OCL (2000)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2006 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Dzidek, W.J., Briand, L.C., Labiche, Y. (2006). Lessons Learned from Developing a Dynamic OCL Constraint Enforcement Tool for Java. In: Bruel, JM. (eds) Satellite Events at the MoDELS 2005 Conference. MODELS 2005. Lecture Notes in Computer Science, vol 3844. Springer, Berlin, Heidelberg. https://doi.org/10.1007/11663430_2
Download citation
DOI: https://doi.org/10.1007/11663430_2
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-31780-7
Online ISBN: 978-3-540-31781-4
eBook Packages: Computer ScienceComputer Science (R0)