views:

47

answers:

2

Hi. I'm working on a tool which would make UML models less ambiguous (using EMF and UML2 frameworks for Eclipse). In order to do this I am creating instances of different parts of the model. Does anyone know any efficient algorithms for generating RANDOM model instances?

A: 

hmm. Are you trying to build some kind of simulation/verification tool?

If so have you looked at alloy and its accompanying analyzer?

From the FAQ:

What is alloy?

Alloy is similar to OCL, the Object Language of UML, but it has a more conventional syntax and a simpler semantics, and is designed for automatic analysis.

What's the alloy analyzer?

The Alloy Analyzer is a constraint solver that provides fully automatic simulation and checking.

Language / tool may or may not be relevant - but the community might be a good source of help.

sfinnie
A: 

Do you know the USE Tool. This tool has exactly the same purpose (it´s not integreated with EMF though): to generate instances of a UML/OCL class diagram to see if the model is too much (or too little) restrictive. There´s a kind of scripting language to define what kind of instances (and how many) do you want the tool to generate.

However, I think the most flexible way to achieve this is by translating your UML/OCL model to a CSP (constraint satisfaction problem) or similars. Then you can ask the CSP solver to generate as many instances of the model as you want and, by adding additional constraints, you can easily tune the kind of instances to be generated. Our tool UMLtoCSP could be used to automatically generate the CSP code for you (hopefully we will have soon the resources to restructure the tool and migrate it to Eclipse/EMF but at least you may get an idea of what I say with the current tool version). This idea is similar to what you can do with Alloy but with better support for numerical constraints and a more integrated translation

Jordi Cabot