Abstract
In model driven architecture (MDA), system requirements are first captured by UML (unified modeling language) use cases with sequence diagrams to describe their intended use and implemented by classes of objected-oriented languages in the subsequent design stages. It is important that the dynamic behavior specified by the sequence diagrams is in full compliance with the implementation classes. This paper proposes an automatic approach and tool support for generating class contracts, which define a precondition and a postcondition for each operation of the class. The former serves as a guard to ensure invocations of the operations respect the semantics introduced by the sequence diagrams, and the latter places the system in a legal state to facilitate the succeeding operation calls. The contracts can be easily mapped to code of an object-oriented language such as Java. Thus, the approach helps to bridge the gap between the requirements and design stages of system development process. We use our model transformation tool to first generate a UML protocol state machine from the sequence diagrams, and then derive the contracts for a controller class. The transformations take into account the concurrency and critical constructs of the respective UML diagrams.
Article PDF
Similar content being viewed by others
Avoid common mistakes on your manuscript.
References
France R, Rumpe B. Model-driven development of complex software: A research roadmap. In: Lionel C B, Alexander L W, eds. 2007 Future of Software Engineering (FOSE 07). Minnesota: IEEE, 2007. 37–54
Schmidt D. Model-driven engineering. IEEE Comput, 2006, 39: 25–31
Hailpern B, Tarr P. Model-driven development: The good, the bad, and the ugly. IBM Syst J, 2006, 45: 451–461
OMG. Unified Modeling Language: Superstructure, version 2.4.1. Aug. 2011. http://www.omg.org/spec/UML/2.4/Superstructure
Larman C. Applying UML and Patterns: An Introduction to Object-Oriented Analysis and Design and the Unified Process, 3rd ed. New Jersey: Prentice-Hall, 2005
Ke W, Li X S, Liu Z M, et al. rCOS: A formal model-driven engineering method for component-based software. Front Comput Sci China, 2012, 6: 17–39
Dromey R G. From requirements to design: Formalizing the key steps. In: Antonio C, Peter L, eds. Proceedings of First International Conference on Software Engineering and Formal Methods (SEFM 03). Brisbane: IEEE, 2003. 2–11
Leavens G, Baker A, Ruby C. JML: A notation for detailed design. Kluwer International Series in Engineering and Computer Science. Kluwer Academic Publishers Group, 1999. 175–188
OMG. Meta Object Facility (MOF) 2.0 Query/View/Transformation Specification, version 1.1. Jan. 2011
Li D, Li X S, Stolz V. QVT-based model transformation using XSLT. SIGSOFT Softw Eng Notes, 2011, 36: 1–8
Ali J, Tanaka J. Implementing the dynamic behavior represented as multiple state diagrams and activity diagrams. J Comput Sci Inf Manage, 2001, 2: 22–34
www Consortium, XSL Transformations (XSLT) Version 2.0, W3C Recommendation. Jan. 2007. http://www.w3.org/TR/2007/REC-xslt20-20070123/
Chen Z B, Morisset C, Stolz V. Specification and validation of behavioural protocols in the rCOS modeler. In: Proceedings of 3rd Intl. Symp. on Fundamentals of Software Engineering (FSEN 2009), Springer, 2010. LNCS 5961: 387–401
Hoare C A R. Communicating Sequential Processes. New Jersey: Prentice-Hall, 1985
Formal Systems (Europe) Ltd. FDR2 User Manual, 2005. http://www.fsel.com
Whittle J, Jayaraman P. Generating hierarchical state machines from use case charts. In: Martin G, Robyn L, eds. Proceedings of the 14th IEEE International Conference on Requirements Engineering. Minneapolis: IEEE, 2006. 19–28
Amyot D, Eberlein A. An evaluation of scenario notations and construction approaches for telecommunication systems development. Telecommun Syst, 2003, 24: 61–94
Liang H, Dingel J, Diskin Z. A comparative survey of scenario-based to state-based model synthesis approaches. In: Proceedings of 2006 International Workshop on Scenarios and State Machines: Models, Algorithms, and Tools. ACM, 2006. 5–12
Whittle J, Jayaraman P. Synthesizing hierarchical state machines from expressive scenario descriptions. ACM T Softw Eng Meth, 2010, 19: 8
Grønmo R, Møller-Pedersen B. From UML 2 sequence diagrams to state machines by graph transformation. J Object Technol, 2011, 10: 1–22
Ziadi T, Helouet L, Jezequel J. Revisiting statechart synthesis with an slgebraic approach. In: Proceedings of the 26th International Conference on Software Engineering. Edinburgh: IEEE, 2004. 242–251
Graaf B, Deursen A V. Model-driven consistency checking of behavioural specifications. In: Proceedings of the Fourth International Workshop on Model-Based Methodologies for Pervasive and Embedded Software (MOMPES 07). Braga: IEEE, 2007. 115–126
Harel D, Kugler H, Pnueli A. Synthesis revisited: Generating statechart models from scenario-based requirements. In: Formal Methods in Software and Systems Modeling. Berlin: Springer, 2005. LNCS 3393: 309–324
Harel D, Segall I. Synthesis from scenario-based specifications. J Comput Syst Sci, 2012, 78: 970–980
Porres I, Rauf I. Generating class contracts from UML protocol statemachines. In: Proceedings of 6th International Workshop on Model-Driven Engineering, Verification and Validation (MoDeVVa’09). ACM, 2009. 8
Chen X, Liu Z M, Mencl V. Separation of concerns and consistent integration in requirements modelling. In: Proceedings of 33rd Conference on Current Trends in Theory and Practice of Computer Science (SOFSEM 2007). Berlin: Springer, 2007. LNCS 4362: 819–831
Li D, Li X S, Liu Z M, et al. Interactive transformations from object-oriented models to component-based models. In: Proceedings of Formal Aspects of Component Software (FACS 11). Berlin: Springer, 2012. LNCS 7253: 97–114
Li D, Li X S, Liu Z M, et al. Support formal component-based development with UML profile. In: Proceedings of the 22nd Australian Conference on Software Engineering (ASWEC 2013). Melbourne: IEEE, 2013. 191–200
Author information
Authors and Affiliations
Corresponding author
Rights and permissions
About this article
Cite this article
Li, D., Li, X., Liu, Z. et al. Automated transformations from UML behavior models to contracts. Sci. China Inf. Sci. 57, 1–17 (2014). https://doi.org/10.1007/s11432-014-5159-8
Received:
Accepted:
Published:
Issue Date:
DOI: https://doi.org/10.1007/s11432-014-5159-8