testingeclipse-emftest-datarandom-data

How to create random EMF (eclipse modelling framework) object for testing purposes?


I need large and random EMF objects for testing certain performance-related aspects of my application. They don't have to be "correct" by any means, or have any meaning wrt the metamodel.

Creating a list of primary EMF objects is relatively easy by traversing in a reflective manner the factory object and looking for "create.*Instance()" methods.

But afterwards setting the relations (e.g ownership, association, etc) randomly among these primary objects seems to be more tricky if one wants to avoid explicitly mentioning the concrete class types.

Has anyone encountered similar problem? What was your approach?


Solution

  • You could have a look at the EMF (pseudo) random instantiator tool or at Epsilon's EMG language if you need more control over the model generation process.