Imperative versus declarative constraint specification languages: a controlled experiment

Azzam Maraee, Arnon Sturm

Research output: Contribution to journalArticlepeer-review

1 Scopus citations


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.

Original languageEnglish
Pages (from-to)27-48
Number of pages22
JournalSoftware and Systems Modeling
Issue number1
StatePublished - 1 Feb 2021


  • Constraint language
  • Controlled experiment
  • Declarative language
  • Evaluation
  • Imperative language
  • Java
  • Modeling
  • OCL


Dive into the research topics of 'Imperative versus declarative constraint specification languages: a controlled experiment'. Together they form a unique fingerprint.

Cite this