Constraints that have to hold for all models of a modeling language are often specified as invariants using the Object Constraint Language (OCL). If violations of such invariants shall be documented or resolved in a software system, the exact model elements that violate these conditions have to be computed. OCL validation engines provide, however, only a single context element at which a check for a violated invariant originated.Therefore, the computation of elements that caused an invariant violation is often specified in addition to the invariant declaration with redundant information. These redundancies can make it hard to develop and maintain systems that document or resolve invariant violations. In this paper, we present an automated approach and tool for declaring and binding parameters of invariants to violating elements based on boolean invariant expressions that are similar to OCL invariants. The tool computes a transformed invariant that returns violating elements for each iterator variable of the invariant expression that matches an explicitly declared invariant parameter. The approach can be used for OCL invariants and all models of languages conforming to the MetaObject Facility (MOF) standard. We have evaluated our invariant language and transformation tool by transforming 88 invariants of the Unified Modeling Language (UML).
[1]
Wilhelm Hasselbring,et al.
Xbase: implementing domain-specific languages for Java
,
2012,
GPCE '12.
[2]
Ákos Horváth,et al.
EMF-IncQuery: An integrated development environment for live model queries
,
2015,
Sci. Comput. Program..
[3]
Philippe Collet,et al.
On the use of an internal DSL for enriching EMF models
,
2012,
OCL '12.
[4]
Hannes Schwarz,et al.
Model-Driven Software Development
,
2013
.
[5]
Dániel Varró,et al.
Change-driven model transformations
,
2011,
Software & Systems Modeling.
[6]
Richard F. Paige,et al.
On the Evolution of OCL for Capturing Structural Constraints in Modelling Languages
,
2009,
Rigorous Methods for Software Construction and Analysis.
[7]
Philippe Collet,et al.
Manipulating models using internal domain-specific languages
,
2014,
SAC.
[8]
Max E. Kramer.
A generative approach to change-driven consistency in multi-view modeling
,
2015,
2015 11th International ACM SIGSOFT Conference on Quality of Software Architectures (QoSA).