• No results found

We developed a rule-based approach for generating consistent models w.r.t. arbitrary multiplicities and EMF constraints. Since we use a rule-based approach, our genera- tor is configurable to support user specifications and to allow user interaction. Several parameterization strategies are presented to generate different sets of consistent EMF models. Two Eclipse plug-ins have been developed: Meta2GR automatically trans- lates the meta-model of a given DSML to an MTS and the EMF Model Generator uses the derived MTS to generate consistent EMF models. We evaluated the scalabil- ity of our approach by generating large instances of several meta-models of different domains and showed that models with 10 000 elements can be generated in about a minute on average. Furthermore, our tool can generate consistent EMF models of 500 000 elements in less than 2 minutes for a meta-model with largely unrelated multiplicity constraints and in about 30 minutes for a meta-model with closely in- terrelated ones. A scalability comparison with the state-of-the-art instance generator is provided showing that our generator is efficient for generating large and consis- tent EMF models from meta-models without OCL constraints. Moreover, we showed that a certain form of diversity between the generated models can be achieved by configuration. The related work is discussed in detail as well.

As future work, we intend to support a set of OCL constraints (at least negative constraints). Translating OCL constraints to graph patterns [114, 89], and further to application conditions of rules is promising to develop an automated interactive approach for generating consistent EMF models conforming meta-models with (OCL) constraints. Furthermore, we want to support further configurations and generate realistic models by leveraging a stochastic controller [148] and extend our experiments to generate huge models starting from existing large models as seed models.

Part II

Consistency Ensuring Techniques for Model

Transformations

In Model-Driven Engineering (MDE), model transformations are the key operations for manipulating models, including, e.g., a repair transformation as described in Chapter 3, refactoring, and code generation. Applying a transformation to a model may change its consistency with respect to a set of constraints, and thus, errors may occur. In several application scenarios, models have to fulfill a set of constraints or their consistencies (at least basic ones) have to be preserved during the transformation process. For example, applying editing operations to a model has to satisfy the constraints required by the model editor to view it. Moreover, each state of a concurrent and distributed system should fulfill some required invariants such as safety properties, and each refactoring should preserve the model consistency.

Manually enhancing a set of rules to guarantee or to preserve a set of constraints is a tedious, time-consuming, and error-prone task. Furthermore, it requires high skills related to the theoretical foundation and the environment. Optimizing the results is another challenge as well.

In this part, we present two works: In Chapter 5, we introduce a correct-by-construction technique for translating OCL constraints into semantically equivalent graph constraints and integrating them as guaranteeing application conditions into a transformation rule. Our techniques realize an existing theory and automate the whole process. In Chapter 6, we present an optimizing-by-construction technique for application conditions for transforma- tion rules that need to be constraint-preserving. This automatic construction of optimized preserving application condition is conceptually new. Moreover, we show the soundness of the technique.

We develop all the techniques as ready-to-use tools based on the Eclipse Modeling Framework. Further, we evaluate the efficiency (complexity and performance) of both works, assess the overall approach in general, and discuss the related work.

5

Automated Construction of Guaranteeing

Application Conditions from OCL Constraints

This chapter shares material with the ICGT’18 paper “OCL2AC: Automatic Transla- tion of OCL Constraints to Graph Constraints and Application Conditions for Trans- formation Rules” Nassar et al.[89].

Model transformations are often supposed to have a well-defined behavior in the sense that their resulting models are consistent w.r.t. a set of constraints. Based on existing theory, we develop an automated technique that is able to adapt a given rule-based model transformation such that resulting models guarantee a given constraint set. This technique is designed for models of the Eclipse Modeling Framework and based on graph constraints and graph transformations. Two main correct-by-construction functionalities are developed: First, OCL constraints are translated into semantically equivalent graph constraints. Secondly, graph constraints can further be integrated as application conditions into transformation rules. The resulting rule is applicable to an EMF model only if its application does not violate the original constraints. This technique is thus able to guarantee the consistency of a model transformation w.r.t a given set of constraints; its correctness is shown in the literature. Our technique is implemented as Eclipse plug-in, called OCL2AC, and enhances Henshin transforma- tion rules in a fully automated way. In the evaluation, we show that our technique is feasible and effective in practice, i.e., both components work reasonably fast, and the complexity of the resulting output is far better than could be expected from theory.