Main Page/Resources/Mutations

From Atenea

Jump to: navigation, search


Mutations in Model Transformations


Model transformations are subject to thorough tests for correctness in the context of Model-Driven Engineering. For this reason, several approaches have been proposed that either fully verify the correct behavior of the transformations using formal methods or certify their behavior for a selected set of test models mainly to identity bugs of industrial-scale transformations in a cost-effective way. As mutation analysis has proven to be useful as a practical testing approach, it has also been applied to test model transformations mainly for the generation of test data in terms of input models and mutants of model transformations. Considering the latter, we have automated the generation of model transformation mutants by realizing a framework that exploits the concept of Higher-Order Transformations (HOTs) [1]. Specifically, on this website it is provided the implementation of a prototype for the mutation of model transformations written in the Atlas Transformation Language (ATL) [2].


We have built a Java program for the automation of our approach to automate the mutation of model transformations. It takes as input several HOTs with generic mutations as well as a second-order HOT to make the generic mutations specific, and the transformation to be mutated along with its input and output metamodels. After the process is executed, it generates the mutated transformation as output. The activity diagram in Figure 1 illustrates the process, which is explained in the following.


Figure 1. Activity diagram for the mutation process

First of all, let us clarify that when an ATL model transformation is the input for a HOT, then it needs to be represented as a model (conforming to the ATL metamodel). If a HOT produces a transformation, then it is also represented as a model. On the contrary, when an ATL model transformation is to be executed, it has to be represented as a text file. The process of obtaining a model representing a transformation from a text file is called injection, and is carried out by means of a code-to-model transformation. The inverse process is called extraction, and is performed by a model-to-code transformation.

(1) In the first step, all HOTs with generic mutations need to be injected into models. (2) After that, a second-order HOT takes as input each generic HOT, together with the input and output metamodels of the transformation we want to mutate, and generates one HOT with a specific mutation for each of the generic ones. (3) Then, those models with specific mutations must be extracted to ATL text files, so that they can be executed. (4) But before the execution, the transformation to be mutated has to be injected into a model. (5) Finally, the HOTs with specific mutations are executed and produce the mutation of the original ATL transformation, (6) which is extracted to a file.


Our fully-executable prototype can be downloaded from here. It includes the following folders and artefacts:

  • HOTs. It is a folder containing the following higher-order transformations:
    • AddInPatternElememnt_FirstRule. It is a generic HOT to insert an InPatternElement in the first rule of the transformation.
    • DeleteLastOutPatternElement_LastRule. Generic HOT to delete the last OutPatternElement of the last rule of the transformation, provided such rule contains more than one OutPatternElements.
    • DeleteBindingsWithoutReferredVariable. Generic HOT to delete those Bindings that were pointing to a removed OutPatternElement
    • SecondOrderHOT. IT is a second-order HOT that makes specific the generic transformations described above.
  • metamodels. It is a folder containing the ATL.ecore metamodel
  • transformation. This folder contains the specific ATL transformation that we want to mutate, together with its input and output metamodels. In our example, it is an ATL transformation that generates a PNML (Petri Net Markup Language) model from a PetriNet model. The files are the following, taken from the ATL transformations zoo:
    • PetriNet2PNML.atl
    • PetriNet.ecore
    • PNML_simplified.ecore
    • PetriNet2PNML_Mutated.atl. This file is produced after executing the main program and contains the mutated transformation.
  • src/mutations. Among others, this package contains the program to be executed, namely
    • To execute the program, simply right-click on it and select Run As -> Java Application. It the current version of the prototype, the input files described above have to be given. In this Java program the user can easily identify the entry points where the inputs need to be specified.

Other than the files described, there are many others, although they can be ignored by the user. We have implemented our prototype in the Luna version of Eclipse, the latest one to the date. After downloading our prototype, the user simply needs to start Eclipse and select the option to Import Existing Projects into Workspace.


[1] Tisi, M., Jouault, F., Fraternali, P., Ceri, S., Bézivin, J.: On the Use of Higher-Order Model Transformations. ECMDA-FA, LNCS Springer, 2009, vol. 5562, pp. 18–33.

[2] Jouault, F., Allilaire, F., Bézivin, J., Kurtev, I.: ATL: A model transformation tool . Science of Computing Programming 72(1-2), 2008, pp. 31–39

Personal tools