Skip to main content
Log in

Imperative versus declarative constraint specification languages: a controlled experiment

  • Special Section Paper
  • Published:
Software and Systems Modeling Aims and scope Submit manuscript

Abstract

Model-based software engineering gains further attention these days. To better support it, the use of constraint languages is important in order to bridge expressiveness gaps and eliminate ambiguity. Nevertheless, the use of model-based constraint languages, like the Object Constraint Language (OCL), is quite limited and the specification of constraints is left to the implementation stage. One option for these practices might be the misconception that model-based constraint languages are difficult to work with. In this paper, we examine the usages of representative constraint languages, namely OCL, for model-based constraint languages, and Java, for implementation-based constraint languages. In particular, we examine their usage in understanding and developing constraints. We evaluate these usages via a controlled experiment with 110 Information Systems Engineering undergraduate students. We found out that using OCL outperforms using Java for both understanding and developing constraints. Yet, the students had more confidence with Java. The results indicate that the aforementioned misconception is wrong and there is a need for further education regarding model-based constraints languages, so to get more practice and confidence.

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.

Fig. 1

Similar content being viewed by others

References

  1. AbuHassan, A., Alshayeb, M.: A metrics suite for UML model stability. Softw. Syst. Model. 18(1), 557–583 (2019)

    Article  Google Scholar 

  2. Ali, S., Yue, T., Iqbal, M.Z., Panesar-Walawege, R.K.: Insights on the use of OCL in diverse industrial applications. In International Conference on System Analysis and Modeling, pp. 223–238 (2014)

  3. Ali, S., Zohaib, M.I., Arcuri, A., Briand, L.C.: Generating test data from OCL constraints with search techniques. IEEE Trans. Softw. Eng. 39(10), 1376–1402 (2013)

    Article  Google Scholar 

  4. Balaban, M., Bennett, P., Doan, K.H., Georg, G., Gogolla, M., Khitron, I., Kifer, M.: A comparison of textual modeling languages: OCL, Alloy, FOML. InOCL@ MoDELS, pp. 57–72 (2016)

  5. Bao-Lin, L., Zhi-shu, L., Qing, L., Hong, C.Y.: Test case automate generation from UML sequence diagram and OCL expression. In: International Conference on Computational Intelligence and Security, pp. 1048–1052 (2007)

  6. Briand, L.C., Labiche, Y., Yan, H.D., Penta, M.D.: A controlled experiment on the impact of the object constraint language in UML-based maintenance. In: The 20th IEEE International Conference on Software Maintenance, pp. 380–389 (2004)

  7. Briand, L.C., Morasca, S., Basili, V.R.: Defining and validating measures for object-based high-level design. IEEE Trans. Softw. Eng. 25(5), 722–743 (1999)

    Article  Google Scholar 

  8. Briand, L.C., Wust, J., Ikonomovski, S.V., Lounis, H.: Investigating quality factors in object-oriented designs: an industrial case study. In: Proceedings of the 1999 International Conference on Software Engineering (IEEE Cat. No. 99CB37002), pp. 345–354. IEEE (1999)

  9. Burgueño, L., Vallecillo, A., Gogolla, M.: Teaching UML and OCL models and their validation to software engineering students: an experience report. Comput. Sci. Educ. 28(1), 23–41 (2018)

    Article  Google Scholar 

  10. Cabot, J., Clarisó, R., Riera, D.: On the verification of UML/OCL class diagrams using constraint programming. J. Syst. Softw. 93, 1–23 (2014)

    Article  Google Scholar 

  11. Chidamber, S.R., Kemerer, C.F.: A metrics suite for object oriented design. IEEE Trans. Softw. Eng. 20(6), 476–493 (1994)

    Article  Google Scholar 

  12. Chiorean, D., Bortes,M., Corutiu, D., Botiza, C., Cârcu, A.: Object constraint language environment (OCLE). http://lci.cs.ubbcluj.ro/ocle/. Accessed Sept 2019

  13. Correa, A., Werner, C., Barros, M.: An empirical study of the impact of OCL smells and refactorings on the understandability of OCL specifications. In: Proceedings of the 10th international conference on Model Driven Engineering Languages and Systems (MODELS’07). Springer-Verlag, Berlin, Heidelberg, pp. 76–90 (2007)

  14. Cruz-Lemus, J.A., Maes, A., Genero, M., Poels, G., Piattini, M.: The impact of structural complexity on the understandability of UML statechart diagrams. Inf. Sci. 180(11), 2209–2220 (2010)

    Article  MathSciNet  Google Scholar 

  15. Eclipse IDE for Java Developers. https://www.eclipse.org/downloads/packages/release/kepler/sr1/eclipse-ide-java-developers

  16. Eclipse, Eclipse OCL. https://projects.eclipse.org/projects/modeling.mdt.ocl. Accessed Sept 2019

  17. Fahland, D., et al. (2009) Declarative versus Imperative Process Modeling Languages: The Issue of Understandability. In: Halpin, T., et al. (eds.) Enterprise, Business-Process and Information Systems Modeling. BPMDS 2009, EMMSAD 2009. Lecture Notes in Business Information Processing, vol 29. Springer, Berlin, Heidelberg (2009)

  18. Genero, M., Piattini, M., Calero, C.: A survey of metrics for UML class diagrams. J. Object Technol. 4(9), 59–92 (2005)

    Article  Google Scholar 

  19. Genero, M., Poels, G., Piattini, M.: Defining and validating metrics for assessing the understandability of entity–relationship diagrams. Data Knowl. Eng. 64(3), 534–557 (2008)

    Article  Google Scholar 

  20. Gogolla, M., Büttner, F., Richters, R.: USE: a UML-based specification environment for validating UML and OCL. Sci. Comput. Program. 69(1–3), 27–34 (2007)

    Article  MathSciNet  Google Scholar 

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

    Article  Google Scholar 

  22. Green, T.R.G.: Cognitive dimensions of notations. In: Sutcliffe, A., Macaulay, L. (eds.) People and Computers, pp. 443–460. Cambridge University Press, Cambridge (1989)

    Google Scholar 

  23. IntelliJ IDEA. https://www.jetbrains.com/idea/

  24. Jamil H, Islam A.: The power of declarative languages: a comparative exposition of scientific workflow design using BioFlow and Taverna. In: Congress on Services, pp. 322–329 (2009)

  25. Kitchenham, B.A., Pfleeger, S.L., Pickard, L.M., Jones, P.W., Hoaglin, D.C., El Emam, K., Rosenberg, J.: Preliminary guidelines for empirical research in software engineering. IEEE Trans. Softw. Eng. 28(8), 721–734 (2002)

    Article  Google Scholar 

  26. Krogstie, J., Sindre, G.: Utilizing deontic operators in information systems specifications. Requir. Eng. 1, 210–237 (1996)

    Article  Google Scholar 

  27. Krogstie, J.: Model-Based Development and Evolution of Information Systems—A Quality Approach. Springer, New York (2012)

    Book  Google Scholar 

  28. Manso, M.E., Genero, M., Piattini, M.: No-redundant metrics for UML class diagram structural complexity. In International Conference on Advanced Information Systems Engineering, pp. 127–142 (2003)

  29. Maraee, A., Sturm, A.: The usage of constraint specification languages: a controlled experiment. BPMDS/EMMSAD@CAiSE, pp. 329–343 (2019)

  30. Misra, S., Adewumi, A., Fernandez-Sanz, L., Damasevicius, R.: A suite of object oriented cognitive complexity metrics. IEEE Access 6, 8782–8796 (2018)

    Article  Google Scholar 

  31. Mussbacher, G., et al.: The relevance of model-driven engineering thirty years from now. In: Dingel, J., Schulte, W., Ramos, I., Abrahão, S., Insfran, E. (eds.) Model-Driven Engineering Languages and Systems. MODELS 2014. Lecture Notes in Computer Science, vol. 8767, pp. 183–200 (2014)

  32. OCL Portal, OCL Tools. http://st.inf.tu-dresden.de/oclportal/index.php?option=com_content&view=category&id=8&Itemid=26. Accessed Sept 2019

  33. OMG, Object-Constraint Language, version 2.4, https://www.omg.org/spec/OCL/2.4. Accessed Sept 2019

  34. Papyrus. https://www.eclipse.org/papyrus/

  35. Pérez, B., Porres, I.: Reasoning about UML/OCL class diagrams using constraint logic programming and formula. Inf. Syst. 81, 152–177 (2019)

    Article  Google Scholar 

  36. Pichler, P., Weber, B., Zugal, S., Pinggera, J., Mendling, J., Reijers, H.A.: Imperative versus declarative process modeling languages: an empirical investigation. In: Daniel, F., Barkaoui, K., Dustdar, S. (eds.) Business Process Management Workshops. Lecture Notes in Business Information Processing, vol. 99, pp. 383–394 (2012)

  37. Przigoda, N., Wille, R., Przigoda, J., Drechsler, R.: Automated Validation and Verification of UML/OCL Models Using Satisfiability Solvers. Springer, New York (2015)

    Google Scholar 

  38. Rull, G., Farré, C., Queralt, A., Teniente, E., Urpí, T.: AuRUS: explaining the validation of UML/OCL conceptual schemas. Softw. Syst. Model. 14(2), 953–980 (2015)

    Article  Google Scholar 

  39. Rychkova, I., Regev, G., Wegmann, A.: High-level design and analysis of business processes the advantages of declarative specifications. In: Second International Conference on Research Challenges in Information Science, pp. 99–110 (2008)

  40. Sendall, S., Kozaczynski, W.: Model transformation: the heart and soul of model-driven software development. IEEE Softw. 20(5), 42–45 (2003)

    Article  Google Scholar 

  41. Störrle, H.: Improving the usability of OCL as an ad-hoc model querying language. In: The 13th International Workshop on OCL, Model Constraint and Query Languages, pp. 83–92 (2013)

  42. Subramaniam, V.: Functional programming in Java: harnessing the power of Java 8 Lambda expressions. Pragmatic Bookshelf (2014)

  43. Warmer, J., Kleppe, A.: The Object Constraint Language: Getting Your Models Ready for MDA. Addison-Wesley, Boston (2003)

    Google Scholar 

  44. Wikipedia contributors, Integrated development environment, Wikipedia, The Free Encyclopedia. https://en.wikipedia.org/w/index.php?title=Integrated_development_environment&oldid=936168158. Accessed 30 Jan 2020

  45. Wohlin, C., Runeson, P., Höst, M., Ohlsson, M.C., Regnell, B., Wesslén, A.: Experimentation in Software Engineering. Springer, New York (2012)

    Book  Google Scholar 

  46. Yue, T., Ali, S.: Empirically evaluating OCL and Java for specifying constraints on UML models. Softw. Syst. Model. 15(3), 757–781 (2016)

    Article  Google Scholar 

  47. Zugal, S., Pinggera, J., Weber, B.: Toward enhanced life-cycle support for declarative processes. J. Softw. Evol. Process 24(3), 285–302 (2012)

    Article  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Arnon Sturm.

Additional information

Communicated by Jelena Zdravkovic and Iris Reinhartz-Berger.

Publisher's Note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Appendices

Appendix A. Class diagram complexity metrics

See Table 12

Table 12 Class diagram structural complexity metrics for used in the experience (based on [11, 18, 28])

Appendix B. The library management system-class diagram

figure i

See Table 13.

Table 13 Library Management System—the development task constraints

Appendix C. The academic system-class diagram

figure j

See Table 14.

Table 14 Academic system-the development task constraints

Appendix D. Comparing the complexity of the two domains

See Table 15.

Table 15 A comparison of the two domains based on the metrices in Table 8

Appendix E. Values of complexity metrics and specifications in OCL for library management system

See Table 16.

Table 16 Complexity metrics for the OCL realted to the library management system

Appendix F. OCL and Java formulations of the Constraint 1, 5 and 8 discussed in Sect. 0

figure k

Rights and permissions

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Maraee, A., Sturm, A. Imperative versus declarative constraint specification languages: a controlled experiment. Softw Syst Model 20, 27–48 (2021). https://doi.org/10.1007/s10270-020-00796-4

Download citation

  • Received:

  • Revised:

  • Accepted:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s10270-020-00796-4

Keywords

Navigation