Skip to main content
Log in

Automated transformations from UML behavior models to contracts

  • Research Paper
  • Published:
Science China Information Sciences Aims and scope Submit manuscript

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.

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

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Similar content being viewed by others

References

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

    Chapter  Google Scholar 

  2. Schmidt D. Model-driven engineering. IEEE Comput, 2006, 39: 25–31

    Article  Google Scholar 

  3. Hailpern B, Tarr P. Model-driven development: The good, the bad, and the ugly. IBM Syst J, 2006, 45: 451–461

    Article  Google Scholar 

  4. OMG. Unified Modeling Language: Superstructure, version 2.4.1. Aug. 2011. http://www.omg.org/spec/UML/2.4/Superstructure

    Google Scholar 

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

    Google Scholar 

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

    MathSciNet  MATH  Google Scholar 

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

    Google Scholar 

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

    Google Scholar 

  9. OMG. Meta Object Facility (MOF) 2.0 Query/View/Transformation Specification, version 1.1. Jan. 2011

    Google Scholar 

  10. Li D, Li X S, Stolz V. QVT-based model transformation using XSLT. SIGSOFT Softw Eng Notes, 2011, 36: 1–8

    Article  Google Scholar 

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

    Google Scholar 

  12. www Consortium, XSL Transformations (XSLT) Version 2.0, W3C Recommendation. Jan. 2007. http://www.w3.org/TR/2007/REC-xslt20-20070123/

    Google Scholar 

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

    Google Scholar 

  14. Hoare C A R. Communicating Sequential Processes. New Jersey: Prentice-Hall, 1985

    MATH  Google Scholar 

  15. Formal Systems (Europe) Ltd. FDR2 User Manual, 2005. http://www.fsel.com

    Google Scholar 

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

    Chapter  Google Scholar 

  17. Amyot D, Eberlein A. An evaluation of scenario notations and construction approaches for telecommunication systems development. Telecommun Syst, 2003, 24: 61–94

    Article  Google Scholar 

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

    Chapter  Google Scholar 

  19. Whittle J, Jayaraman P. Synthesizing hierarchical state machines from expressive scenario descriptions. ACM T Softw Eng Meth, 2010, 19: 8

    Google Scholar 

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

    Article  Google Scholar 

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

    Chapter  Google Scholar 

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

    Chapter  Google Scholar 

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

    Chapter  Google Scholar 

  24. Harel D, Segall I. Synthesis from scenario-based specifications. J Comput Syst Sci, 2012, 78: 970–980

    Article  MathSciNet  MATH  Google Scholar 

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

    Google Scholar 

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

    Chapter  Google Scholar 

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

    Chapter  Google Scholar 

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

    Chapter  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Dan Li.

Rights and permissions

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

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

Download citation

  • Received:

  • Accepted:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s11432-014-5159-8

Keywords

Navigation