On 19 oct. 2010, at 14:11, Simon Denier wrote:

OK I can reproduce now :)

Well two things: you are doing it wrong ;) but you found a bug :D (or actually, multiple)

the 'importFromMse' in the contextual menu imports the model from mse into the currently selected model. In this case, you are importing Merlin into the existing Merlin model, which duplicates everything. Perhaps the name of this action is not explicit enough?

Anyway, the bug is elsewhere: 
- when computing FamixMethod>>numberOfLinesOfCode in Smalltalk, the name of the method is given to the calculator, which retrieves the compiledmethod given the name in the method dictionary
- problem is that the method dictionary expects a symbol as a key
- now a 'fresh' model from the Smalltalk importer does set a symbol for a FamixMethod name
- but the MSE importer sets a string instead, hence the error when you try to compute number of lines of code on mse-imported famix method

But why is there no error when I or Doru creates a moose model from the drop-down menu?
- because the newly created model is not set as #isSmalltalk (because moosemodel attributes are not saved in the mse file, argh)
- then numberOfLinesOfCode does not try to retrieve the compiledmethod and instead try to rely on sourceanchor -> and in the end it returns 0 (hence the white classes Doru noticed).



Solutions? I think there are multiple things to fix.
- As Doru says, we could tag such properties as LOC and Cyclo as Fame attributes, this way models are portable
- change the importer to set a string to be consistent, and the calculator to use #asSymbol?
- what about exporting MooseModel attributes? #isSmalltalkModel






On 19 oct. 2010, at 12:57, Cyrille Delaunay wrote:

Ok, I know what is different :)
Here is how I import from mse (I'm sure this is not a good way to do it, but this is at least possible in the menu:)) :
In the moosePanel:
   => I right-click on the model I just exported
   => select 'import/export'
   => click on 'import from mse' and select merlin.mse
   => close the moosePanel and re-open it.
   => the name of your model is now 'merlin', and the error happen on this model.

Indeed, when I import from mse using the tool bar at the top of the moosePanel, it generate a new model, and all work fine with it.

2010/10/19 Tudor Girba <tudor.girba@gmail.com>
Hi,

On 19 Oct 2010, at 12:26, Simon Denier wrote:

>
> On 19 oct. 2010, at 11:48, Cyrille Delaunay wrote:
>
>> You can try with the moose-suite provided here: http://www.moosetechnology.org/download.
>> I build a model from Merlin. Then export and import it. Normaly you should not be able to open a SystemComplexity view.
>
> I can't reproduce the problem with a latest dev.

I did exactly this and it works fine:
- import the package named Merlin
- export the model into merlin.mse
- import the model from merlin.mse
- spawn System Complexity on both all famixclasses, and on allmodelclasses and everything works fine, except that there is no color.

>>
>> Should the property be annoted with 'fame' pragmas, or is it better to modify the exporter to take into account the current used pragmas (<property:longName:description:>) ?
>
>
> Problem is, before exporting the metric, you have to compute the value, and then it takes a lot of time and the mse file gets quite big. Metrics used to be included in older mse, but we exclude them since most of the time we can compute them again. Note that infusion does export some metrics.
>
> Now what we need is a way to select what we want to export in the mse. I think that an incremental metamodel builder is the way to go. I don't want metrics to be included in the default metamodel, there are too many of them.

I would say that the metrics that we want to have exported should be explicitly annotated with Fame descriptions. This would be useful for things like lines of code or cyclomatic complexity, which are primitive metrics that cannot be computed out of the model alone.

Cheers,
Doru




>>
>>
>> 2010/10/19 Tudor Girba <tudor.girba@gmail.com>
>> Hi Cyrille,
>>
>> I cannot reproduce that. Could you send a small sample MSE, or at least point to which model you try?
>>
>> In any case, the exporter does not export the properties that are just marked with <property:longName:description:> pragmas, although it would be nice if it would do so.
>>
>> Cheers,
>> Doru
>>
>>
>> On 19 Oct 2010, at 10:49, Cyrille Delaunay wrote:
>>
>> > Hello,
>> >
>> > I have a smalltalk moose-model, for which I can display SystemComplexity. All work fine. Then I export it as MSE and then import it from the MSE file. When I try to reopen System-complexity all seem to be broken (I have a red square).
>> > Does that means that the model is not well exported ? Maybe some required properties are not described by correct FAame-Pragmas, and are therefore not exported ?
>> >
>> > _______________________________________________
>> > Moose-dev mailing list
>> > Moose-dev@iam.unibe.ch
>> > https://www.iam.unibe.ch/mailman/listinfo/moose-dev
>>
>> --
>> www.tudorgirba.com
>>
>> "We cannot reach the flow of things unless we let go."
>>
>>
>>
>>
>> _______________________________________________
>> Moose-dev mailing list
>> Moose-dev@iam.unibe.ch
>> https://www.iam.unibe.ch/mailman/listinfo/moose-dev
>>
>> _______________________________________________
>> Moose-dev mailing list
>> Moose-dev@iam.unibe.ch
>> https://www.iam.unibe.ch/mailman/listinfo/moose-dev
>
> --
>  Simon
>
>
>
> _______________________________________________
> Moose-dev mailing list
> Moose-dev@iam.unibe.ch
> https://www.iam.unibe.ch/mailman/listinfo/moose-dev

--
www.tudorgirba.com

"Reasonable is what we are accustomed with."


_______________________________________________
Moose-dev mailing list
Moose-dev@iam.unibe.ch
https://www.iam.unibe.ch/mailman/listinfo/moose-dev

_______________________________________________
Moose-dev mailing list
Moose-dev@iam.unibe.ch
https://www.iam.unibe.ch/mailman/listinfo/moose-dev

--
 Simon




--
 Simon