- Write a .mj query to be tested and place it in the /query folder of the test project
- Subclass MetaModelTest to test structural properties of the generated target metamodel such as the existence of classes, attributes and references
- Subclass TransformationTest to test the model that is obtained by running the generated transformation on two source models. Test it for the existence of particular objects, attribute values and referenced objects.
- Create a JUnit TestSuite that bundles the MetaModelTest and the TransformationTest, let @BeforeClassexecute the ModelJoin query to generate the target metamodel and transformation first.
Synthetic Scalability Tests
Aim to measure the ModelJoin time performance on automatically generated large (meta)models.
- Create a ExperimentConfig and set parameters for number of repetitions, number of classes in metamodel, number of objects per class in model and SelfJoiningMJQueryBuilder which generates a mj query for the synthesized metamodel (by joining it with itself). Alternatively parse the parameter values from a xml file.
- Create a Experiment and pass the ExperimentConfig. Activate logging for storing text files that contain the combined time consumption for metamodel and transformation generation.
- Experiment.init() synthesizes a default metamodel based on three predefined EClassPrototypes. Experiment.init(EClassPrototype proto) synthesizes a metamodel from the passed class prototype.
- For custom ModelJoinQueryBuilder subclass SelfJoiningMJQueryBuilder. Currently one query builder exists that creates natural join statements for every possible class combinations.
- Run the experiment.
SoPeCo is a client-server based test framework for systematic test experiment series.
- Setup SoPeCo locally (install Tomcat, DB-Derby, R, SoPeCo Webapp)
- java -jar <dbderby-path>/lib/derbyrun.jar server start
- <tomcat-path>/bin/startup.bat (Windows) or startup.sh
- Open SoPeCo Webapp and login
- Start *.mj.test.scalability.sopeco.ModelJoinSopecoController in Eclipse
- Connect with controller in Webapp by entering the ID "ModelJoinScalability"
- Configure the experiment in the Webapp. Enter parameters ONLY for the deepest config level, i.e. the "Experiment Assignments"
- Execute experiment through Webapp UI
- Export results
About Synthetic Models
The (meta)model synthesizer functionality is independent from ModelJoin and is useful for quick creation of large ECore metamodels and models. The MetaModelSynthesizer creates EClasses by cloning user-defined EClassPrototypes. The ModelSynthesizer builds models by iteratively assigning attribute values from a user-defined period of values. Reference assignments are not yet supported by the ModelSynthesizer.
How To - MetaModelSynthesizer:
- Instantiate a MetaModelSynthesizer
- Create at least one EClassPrototype and add attributes and references. Attribute types may be explicit (EInt, EBoolean or EString) or mixed, i.e. the n-th attribute is of type i = n mod 3 where i = 0 is EInt, i = 1 is EBoolean and i = 2 is EString. Reference types may be explicit, i.e. an EClass is passed as type, or mixed, i.e. the type is determined by iterating over all EClasses in the metamodel.
- Add the EClassProtypes to the MetaModelSynthesizer
- Serialize the defined metamodel as .ecore
How To - ModelSynthesizer:
- Instantiate a ModelSynthesizer
- Set a period for instance counts: e.g. (2,5) means for the first EClass two EObjects are created, for the second EClass there are 5 EObjects, for the third EClass there are again two EObjects and so on.
- Set a value period per attribute type: e.g. (42,23,-7) for EInt means that each time an EInt attribute is set, the value is periodically chosen: 42,23,-7,42,23,....
- Serialize the defined model as XMI file, therein pass the metamodel to be instantiated