Software & Systems Modeling

, Volume 9, Issue 2, pp 225–255 | Cite as

Efficient analysis of pattern-based constraint specifications

  • Michael Wahler
  • David Basin
  • Achim D. Brucker
  • Jana Koehler
Regular Paper


Precision and consistency are important prerequisites for class models to conform to their intended domain semantics. Precision can be achieved by augmenting models with design constraints and consistency can be achieved by avoiding contradictory constraints. However, there are different views of what constitutes a contradiction for design constraints. Moreover, state-of-the-art analysis approaches for proving constrained models consistent either scale poorly or require the use of interactive theorem proving. In this paper, we present a heuristic approach for efficiently analyzing constraint specifications built from constraint patterns. This analysis is based on precise notions of consistency for constrained class models and exploits the semantic properties of constraint patterns, thereby enabling syntax-based consistency checking in polynomial-time. We introduce a consistency checker implementing these ideas and we report on case studies in applying our approach to analyze industrial-scale models. These studies show that pattern-based constraint development supports the creation of concise specifications and provides immediate feedback on model consistency.


UML OCL Constraints Patterns Consistency 


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    Ackermann, J., Turowski, K.: A library of OCL specification patterns to simplify behavioral specification of software components. In: Proceedings of Conference on Advanced Information Systems Engineering. Lecture Notes in Computer Science, vol. 4001, pp. 255–269 (2006)Google Scholar
  2. 2.
    Ahrendt W., Baar T., Beckert B., Bubel R., Giese M., Hähnle R., Menzel W., Mostowski W., Roth A., Schlager S., Schmitt P.H.: The KeY Tool. Softw. Syst. Model. 4(1), 32–54 (2005)CrossRefGoogle Scholar
  3. 3.
    Aichernig, B.K., Larsenz, P.G.: A proof obligation generator for VDM-SL. In: FME ’97: Industrial Applications and Strengthened Foundations of Formal Methods. Lecture Notes in Computer Science, vol. 1313, pp. 338–357 (1997)Google Scholar
  4. 4.
    Basin D., Doser J., Lodderstedt T.: Model driven security: from UML models to access control infrastructures. ACM Trans. Softw. Eng. Methodol. 15(1), 39–91 (2006)CrossRefGoogle Scholar
  5. 5.
    Berardi D., Calvanese D., De Giacomo G.: Reasoning on UML class diagrams. Artif. Intell. 168(1), 70–118 (2005)zbMATHCrossRefGoogle Scholar
  6. 6.
    Bordbar, B., Anastasakis, K.: UML2Alloy: a tool for lightweight modelling of discrete event systems. In: Proceedings of IADIS International Conference in Applied Computing 2005, pp. 209–216, Algarve, Portugal (2005)Google Scholar
  7. 7.
    Brucker, A.D.: An interactive proof environment for object-oriented specifications. PhD Thesis, ETH Zurich, March 2007. ETH Dissertation No. 17097Google Scholar
  8. 8.
    Brucker, A.D., Doser, J., Wolff, B.: Semantic issues of OCL: past, present, and future. Electronic Communications of the EASST, 5 (2006)Google Scholar
  9. 9.
    Brucker A.D., Wolff B.: HOL-OCL—a formal proof environment for UML/OCL. In: Fiadeiro, J., Inverardi, P. (eds) Fundamental Approaches to Software Engineering (FASE08) Lecture Notes in Computer Science, vol. 4961, pp. 97–100. Springer, Budapest (2008)CrossRefGoogle Scholar
  10. 10.
    Bry, F., Manthey, R.: Checking consistency of database constraints: a logical basis. In: VLDB ’86: Proceedings of the 12th International Conference on Very Large Data Bases, San Francisco, CA, USA, pp. 13–20. Morgan Kaufmann, Menlo Park (1986)Google Scholar
  11. 11.
    Cabot, J., Clarisó, R., Riera, D.: UMLtoCSP: a tool for the formal verification of UML/OCL models using constraint programming. In: ASE ’07: Proceedings of the Twenty-Second Ieee/Acm International Conference on Automated Software Engineering, New York, NY, USA, pp. 547–548. ACM, New York (2007)Google Scholar
  12. 12.
    Cabot J., Teniente E.: Transformation techniques for OCL constraints. Sci. Comput. Program. 68(3), 179–195 (2007)zbMATHCrossRefMathSciNetGoogle Scholar
  13. 13.
    Cadoli, M., Calvanese, D., De Giacomo, G., Mancini, T.: Finite model reasoning on UML class diagrams via constraint programming. AIIA 2007: Artificial Intelligence and Human-Oriented Computing, pp. 36–47 (2007)Google Scholar
  14. 14.
    Chiorean, D., Paşca, M., Cârcu, A., Botiza, C., Moldovan, S.: Ensuring UML models consistency using the OCL environment. In: UML 2003—Workshop: OCL 2.0—Industry Standard or Scientific Playground? (2003)Google Scholar
  15. 15.
    Clarke E.M., Grumberg O., Peled D.A.: Model Checking. MIT Press, Cambridge (2000)Google Scholar
  16. 16.
    Correa A.L., Werner C.: Refactoring object constraint language specifications. Softw. Syst. Model. 6(2), 113–138 (2007)CrossRefGoogle Scholar
  17. 17.
    Costal D., Gómez C., Queralt A., Raventós R., Teniente E.: Facilitating the definition of general constraints in UML. In: Nierstrasz, O., Whittle, J., Harel, D., Reggio, G. (eds) MoDELS 2006, Lecture Notes in Computer Science, vol. 4199, pp. 260–274. Springer, Berlin (2006)Google Scholar
  18. 18.
    Costal, D., Gómez, C., Queralt, A., Raventós, R., Teniente, E.: Improving the definition of general constraints in UML. Soft. Syst. Model. (2008)Google Scholar
  19. 19.
    Damm, F.M., Hansen, B., Bruun, H.: On type checking in VDM and related consistency issues. In: 4th International Symposium of VDM Europe on Formal Software Development, Volume I, Lecture Notes in Computer Science, vol. 551, pp. 45–62 (1991)Google Scholar
  20. 20.
    Darvas A., Müller P.: Reasoning about method calls in interface specifications. J. Object Technol. 5, 59–85 (2006)Google Scholar
  21. 21.
    Davis J.P., Bonnell R.D.: Propositional logic constraint patterns and their use in UML-based conceptual modeling and analysis. IEEE Trans. Knowl. Data Eng. 19(3), 427–440 (2007)CrossRefGoogle Scholar
  22. 22.
    Davis M., Logemann G., Loveland D.: A machine program for theorem-proving. Commun. ACM 5(7), 394–397 (1962)zbMATHCrossRefMathSciNetGoogle Scholar
  23. 23.
    Distefano, D., Katoen, J.-P., Rensink, A.: Towards model checking OCL. In: Proceedings of the ECOOP Workshop on Defining a Precise Semantics for UML (2000)Google Scholar
  24. 24.
    Dwyer, M.B., Avrunin, G.S., Corbett, J.C.: Property specification patterns for finite-state verification. In: FMSP ’98: Proceedings of the Second Workshop on Formal Methods in Software Practice, pp. 7–15, ACM Press, New York (1998)Google Scholar
  25. 25.
    Emmerich, W., Finkelstein, A., Nentwich, C.: Consistency management with repair actions. In: Proceedings of the 25th International Conference on Software Engineering, pp. 455–464, IEEE Computer Society, Portland, Oregon (2003)Google Scholar
  26. 26.
    Farré C., Teniente E., Urpí T.: Checking query containment with the CQC method. Data Knowl. Eng. 53(2), 163–223 (2005)CrossRefGoogle Scholar
  27. 27.
    Gallier Jean H.: Logic for computer science: foundations of automatic theorem proving. Harper & Row, New York (1986)zbMATHGoogle Scholar
  28. 28.
    Giese M., Larsson D.: Simplifying transformations of OCL constraints. In: Briand Lionel, C., Williams, C. (eds) MoDELS., pp. 309–323. MoDELS. Lecture Notes in Computer Science, vol. 3713, Springer (2005)Google Scholar
  29. 29.
    Glubrecht, J.-M., Oberschelp, A., Todt, G.: Klassenlogik. Bibliographisches Institut, Mannheim/Wien/Zürich (1983)Google Scholar
  30. 30.
    Gogolla M., Bohling J., Richters M.: Validating UML and OCL models in USE by automatic snapshot generation. Softw. Syst. Model. 4(4), 386–398 (2005)CrossRefGoogle Scholar
  31. 31.
    Gogolla, M., Richters, M.: Expressing UML class diagrams properties with OCL. In: Object modeling with the OCL, the rationale behind the object constraint language, pp. 85–114 Springer, London (2002)Google Scholar
  32. 32.
    Hartmann S.: Coping with inconsistent constraint specifications. In: Kunii Hideko, S., Jajodia, S., Sølvberg, A. (eds.) ER, Lecture Notes in Computer Science, vol. 2224, pp. 241–255. Springer, Berlin (2001)Google Scholar
  33. 33.
    IBM. developerWorks., December 2007
  34. 34.
    Jackson D.: Alloy: a lightweight object modelling notation. ACM Trans. Softw. Eng. Methodol. 11(2), 256–290 (2002)CrossRefGoogle Scholar
  35. 35.
    Jackson, D., Schechter, I., Shlyakhter, I.: Alcoa: the alloy constraint analyzer. In: Proceedings of the International Conference on Software Engineering, pp. 730–733 (2000)Google Scholar
  36. 36.
    Jonckers V., Mens T., Simmonds J., VanDer Straeten R.: Using description logic to maintain consistency between UML models. In: Stevens, P., Whittle, J., Booch, G. (eds) UML. Lecture Notes in Computer Science, vol. 2863, pp. 326–340. Springer, Berlin (2003)Google Scholar
  37. 37.
    Jones C.B.: Systematic software development using VDM. Prentice-Hall, Englewood Cliffs (1990) ISBN 0-13-880733-7zbMATHGoogle Scholar
  38. 38.
    Kaneiwa K., Satoh K.: Consistency checking algorithms for restricted UML class diagrams. In: Dix, J., Hegner Stephen, J. (eds) FoIKS. Lecture Notes in Computer Science, vol. 3861, pp. 219–239. Springer, Berlin (2006)Google Scholar
  39. 39.
    Kent S.: Model driven engineering. In: Butler Michael, J., Petre, L., Sere, K. (eds) IFM. Lecture Notes in Computer Science, vol. 2335, pp. 286–298. Springer, Berlin (2002)Google Scholar
  40. 40.
    Kleppe A., Warmer J.: The object constraint language, 2nd edn. Addison-Wesley, Reading (2003)Google Scholar
  41. 41.
    Küster, J.M.: Consistency management of object-oriented behavioral models. PhD Thesis, University of Paderborn (2004)Google Scholar
  42. 42.
    Küster, J.M., Ryndina, K., Gall, H.: Generation of business process models for object life cycle compliance. In: Proceedings of the 5th International Conference on Business Process Management (BPM) Lecture Notes in Computer Science, vol. 4714, pp. 165–181. Springer, Berlin (2007)Google Scholar
  43. 43.
    Kyas M., Fecher H., de Boer F.S., Jacob J., Hooman J., van der Zwaag M., Arons T., Kugler H.: Formalizing UML models and OCL constraints in PVS. Electron. Notes Theor. Comput. Sci. 115, 39–47 (2005)CrossRefGoogle Scholar
  44. 44.
    Leuschel M., Butler M.J.: ProB: an automated analysis toolset for the B method. STTT 10(2), 185–203 (2008)CrossRefGoogle Scholar
  45. 45.
    Liskov B.H., Wing J.M.: A behavioral notion of subtyping. ACM Trans. Programm. Lang. Syst. 16(6), 1811–1841 (1994)CrossRefGoogle Scholar
  46. 46.
    Maraee A., Balaban M.: Efficient reasoning about finite satisfiability of UML class diagrams with constrained generalization sets. In: Akehurst David, H., Vogel, R., Paige Richard, F. (eds) ECMDA-FA, Lecture Notes in Computer Science, vol. 4530, pp. 17–31. Springer, Berlin (2007)Google Scholar
  47. 47.
    Miliauskaitė E., Nemuraitė L.: Representation of integrity constraints in conceptual models. Inf. Technol. Control 34(4), 355–365 (2005)Google Scholar
  48. 48.
    Nipkow T., Paulson L.C., Wenzel M.: Isabelle/HOL—a proof assistant for higher-order logic. Lecture Notes in Computer Science, vol. 2283. Springer, Berlin (2002)Google Scholar
  49. 49.
    Object Management Group (OMG): UML 2.0 OCL Final Adopted Specification. (2003)
  50. 50.
    Object Management Group (OMG): Unified Modeling Language: Superstructure. Version 2.1., April (2006)
  51. 51.
    Owre S., Rajan S., Rushby J.M., Shankar N., Srivas M.: PVS: combining specification, proof checking, and model checking. Comput. Aided Verif. CAV 96, 411–414 (1996)Google Scholar
  52. 52.
    Queralt, A., Teniente, E.: Reasoning on UML class diagrams with OCL constraints. In: Proceedings of the 25th International Conference on Conceptual Modeling (ER 2006). Lecture Notes in Computer Science, vol. 4215, pp. 497–512. Springer, Berlin (2006)Google Scholar
  53. 53.
    Queralt A., Teniente E.: Decidable reasoning in UML schemas with constraints. In: Bellahsene, Z., Léonard, M. (eds) CAiSE. Lecture Notes in Computer Science, vol. 5074, pp. 281–295. Springer, Berlin (2008)Google Scholar
  54. 54.
    Sabetzadeh, M., Nejati, S., Liaskos, S., Easterbrook, S., Chechik, M.: Consistency checking of conceptual models via model merging. In: Proceedings of the 15th IEEE International Requirements Engineering Conference 2007 (2007)Google Scholar
  55. 55.
    Snook C.F., Butler M.J.: UML-B: formal modeling and design aided by UML. ACM Trans. Softw. Eng. Methodol. 15(1), 92–122 (2006)CrossRefGoogle Scholar
  56. 56.
    Wahler, M.: Model-driven software development: integrating quality assurance, Chap A. Pattern approach to increasing the maturity level of class models. Idea Group Inc. (2008)Google Scholar
  57. 57.
    Wahler, M.: Using patterns to develop consistent design constraints. PhD thesis, No. 17643. ETH Zurich, Switzerland, February (2008)Google Scholar
  58. 58.
    Wahler, M., Ackerman, L., Schneider, S.: Using the IBM constraint patterns and consistency analysis extension. A step by step guide. May (2008)
  59. 59.
    Wahler, M., Koehler, J., Brucker, A.D.: Model-driven constraint engineering. Electronic Communications of the EASST, 5 (2006)Google Scholar

Copyright information

© Springer-Verlag 2009

Authors and Affiliations

  • Michael Wahler
    • 1
  • David Basin
    • 2
  • Achim D. Brucker
    • 3
  • Jana Koehler
    • 4
  1. 1.ABB Corporate Research, Industrial Software SystemsBaden-DättwilSwitzerland
  2. 2.ETH ZurichZurichSwitzerland
  3. 3.SAP ResearchKarlsruheGermany
  4. 4.IBM Zurich Research LaboratoryRüschlikonSwitzerland

Personalised recommendations