Abstract
The Object Constraint Language (OCL) carries a platform independent characteristic allowing it to be decoupled from implementation details, and therefore it is widely applied in model transformations used by model-driven development techniques. However, OCL can be found tremendously useful in the implementation phase aiding assertion code generation and allowing system verification. Yet, taking full advantage of OCL without destroying its platform independence is a difficult task. This paper proposes an approach for generating assertion code from OCL constraints by using a model transformation technique to abstract language specific details away from OCL high-level concepts, showing wide applicability of model transformation techniques. We take advantage of structural similarities of implementation languages to describe a rewriting framework, which is used to easily and flexibly reformulate OCL constraints into any target language, making them executable on any platform. A tool is implemented to demonstrate the effectiveness of this approach.
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
OMG: Model-Driven Architecture, http://www.omg.org/mda/
OMG: Object Constraint Language specification, version 2.0, http://www.omg.org/technology/documents/formal/ocl.htm
Kiczales, G., Irwin, J., Lamping, J., Loingtier, J.M., Lopes, C.V., Maeda, C., Mendhekar, A.: Aspect-oriented programming. In: Aksit, M., Matsuoka, S. (eds.) ECOOP 1997. LNCS, vol. 1241, pp. 220–242. Springer, Heidelberg (1997)
The Maude Team: The Maude System, http://maude.cs.uiuc.edu/
Akehurst, D.H., Patrascoiu, O.: OCL 2.0 – implementing the standard for multiple metamodels. Electronic Notes in Theoretical Computer Science 102, 21–41 (2004)
Chabarek, F.: Development of an OCL-parser for UML-extensions. Master’s thesis, Technical University of Berlin (2004)
Clavel, M., Egea, M.: ITP/OCL: A rewriting-based validation tool for UML+OCL static class diagrams. In: Proc. 11th International Conference on Algebraic Methodology and Software Technology, pp. 368–373 (2006)
Karaorman, M., Hölzle, U., Bruno, J.L.: jContractor: A reflective Java library to support design by contract. In: Cointe, P. (ed.) Reflection 1999. LNCS, vol. 1616, pp. 175–196. Springer, Heidelberg (1999)
Duncan, A., Hölzle, U.: Adding contracts to Java with Handshake. Technical Report TRCS98-32, Department of Computer Science, University of California (1998)
Dzidek, W.J., Briand, L.C., Labiche, Y.: Lessons learned from developing a dynamic OCL constraint enforcement tool for Java. In: Bruel, J.-M. (ed.) MoDELS 2005. LNCS, vol. 3844, pp. 10–19. Springer, Heidelberg (2006)
Bartetzko, D., Fischer, C., Möller, M., Wehrheim, H.: Jass – Java with assertions. Electronic Notes in Theoretical Computer Science 55(2), 1–15 (2001)
Kramer, R.: iContract – the Java design by contract tool. In: Proc. Technology of Object-Oriented Languages and Systems, pp. 295–307 (1998)
Burdy, L., Cheon, Y., Cok, D., Ernst, M., Kiniry, J., Leavens, G.T., Leino, K.R.M., Poll, E.: An overview of JML tools and applications. International Journal on Software Tools for Technology Transfer 7(3), 212–232 (2005)
Cheon, Y., Leavens, G.T.: A runtime assertion checker for the Java Modeling Language (JML). In: Proc. International Conference on Software Engineering Research and Practice, pp. 322–328 (2002)
Leavens, G.T., Leino, K.R.M., Poll, E., Ruby, C., Jacobs, B.: JML: notations and tools supporting detailed design in Java. In: Companion Proc. 21st International Conference on Object-Oriented Programming Systems, Languages and Applications, pp. 105–106 (2000)
Hamie, A.: Translating the Object Constraint Language into the Java Modelling Language. In: Proc. 2004 ACM Symposium on Applied Computing, pp. 1531–1535 (2004)
Moiseev, R., Russo, A.: Implementing an OCL to JML translation tool. IEICE Technical Report 106(426) SS2006–58, 13–17 (2006)
Gogolla, M., Kuhlmann, M., Büttner, F.: Benchmark for OCL engine accuracy, determinateness, and efficiency. In: Czarnecki, K., Ober, I., Bruel, J.-M., Uhl, A., Völter, M. (eds.) MODELS 2008. LNCS, vol. 5301, pp. 446–459. Springer, Heidelberg (2008)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2009 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Moiseev, R., Hayashi, S., Saeki, M. (2009). Generating Assertion Code from OCL: A Transformational Approach Based on Similarities of Implementation Languages. In: Schürr, A., Selic, B. (eds) Model Driven Engineering Languages and Systems. MODELS 2009. Lecture Notes in Computer Science, vol 5795. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-04425-0_52
Download citation
DOI: https://doi.org/10.1007/978-3-642-04425-0_52
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-642-04424-3
Online ISBN: 978-3-642-04425-0
eBook Packages: Computer ScienceComputer Science (R0)