ModelJoin/Synthetic Tests

Aus SDQ-Wiki

Query Tests

Required plugins:

How To:

  1. Write a .mj query to be tested and place it in the /query folder of the test project
  2. Subclass MetaModelTest to test structural properties of the generated target metamodel such as the existence of classes, attributes and references
  3. 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.
  4. 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.

Required plugins:

From Eclipse

How To:

  1. 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.
  2. Create a Experiment and pass the ExperimentConfig. Activate logging for storing text files that contain the combined time consumption for metamodel and transformation generation.
  3. Experiment.init() synthesizes a default metamodel based on three predefined EClassPrototypes. Experiment.init(EClassPrototype proto) synthesizes a metamodel from the passed class prototype.
  4. For custom ModelJoinQueryBuilder subclass SelfJoiningMJQueryBuilder. Currently one query builder exists that creates natural join statements for every possible class combinations.
  5. Run the experiment.

As SoPeCo-Client

SoPeCo is a client-server based test framework for systematic test experiment series.

How To:

  1. Setup SoPeCo locally (install Tomcat, DB-Derby, R, SoPeCo Webapp)
  2. java -jar <dbderby-path>/lib/derbyrun.jar server start
  3. <tomcat-path>/bin/startup.bat (Windows) or startup.sh
  4. Open SoPeCo Webapp and login
  5. Start *.mj.test.scalability.sopeco.ModelJoinSopecoController in Eclipse
  6. Connect with controller in Webapp by entering the ID "ModelJoinScalability"
  7. Configure the experiment in the Webapp. Enter parameters ONLY for the deepest config level, i.e. the "Experiment Assignments"
  8. Execute experiment through Webapp UI
  9. 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.

Plugins:

How To - MetaModelSynthesizer:

  1. Instantiate a MetaModelSynthesizer
  2. 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.
  3. Add the EClassProtypes to the MetaModelSynthesizer
  4. Serialize the defined metamodel as .ecore

How To - ModelSynthesizer:

  1. Instantiate a ModelSynthesizer
  2. 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.
  3. 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,....
  4. Serialize the defined model as XMI file, therein pass the metamodel to be instantiated