Skip to main content

Lessons Learned from Developing a Dynamic OCL Constraint Enforcement Tool for Java

  • Conference paper
Satellite Events at the MoDELS 2005 Conference (MODELS 2005)

Part of the book series: Lecture Notes in Computer Science ((LNPSE,volume 3844))

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.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Szyperski, C.: Component Software, 2nd edn. ACM Press, New York (2002)

    Google Scholar 

  2. 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)

    Google Scholar 

  3. Emmerich, W.: Engineering Distributed Objects. Wiley, Chichester (2000)

    Google Scholar 

  4. Kleppe, A., Warmer, J., Bast, W.: MDA Explained - The Model Driven Architecture: Practice and Promise. Addison-Wesley, Reading (2003)

    Google Scholar 

  5. 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)

    Article  MATH  Google Scholar 

  6. 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

  7. Finger, F.: Design and Implementation of a Modular OCL Compiler. Dresden University of Technology (2000)

    Google Scholar 

  8. Wiebicke, R.: Utility Support for Checking OCL Business Rules in Java Programs. Dresden University of Technology (2000)

    Google Scholar 

  9. LCI, Object Constraint Language Environment (OCLE), http://lci.cs.ubbcluj.ro/ocle/

  10. Liskov, B.: Data Abstraction and Hierarchy. SIGPLAN Notices 23(5) (1988)

    Google Scholar 

  11. Plösch, R.: Evaluation of Assertion Support for the Java Programming Language. Journal of Object Technology 1(3) (2002)

    Google Scholar 

  12. Lackner, M., Krall, A., Puntigam, F.: Supporting Design by Contract in Java. Journal of Object Technology 1(3) (2002)

    Google Scholar 

  13. Appel, A.W.: Modern Compiler Implementation in Java, 2nd edn. Cambridge University Press, Cambridge (2002)

    MATH  Google Scholar 

  14. Elrad, T., Filman, R.E., Bader, A.: Aspect-oriented programming: Introduction. Communications of the ACM 44(10), 29–32 (2001)

    Article  Google Scholar 

  15. 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)

    Google Scholar 

  16. Warmer, J., Kleppe, A.: The Object Constraint Language. Addison-Wesley, Reading (1999)

    Google Scholar 

  17. Bloch, J.: Effective Java: Programming Language Guide. Addison-Wesley, Reading (2001)

    Google Scholar 

  18. 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)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints 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)

Publish with us

Policies and ethics