Some FAMIX questions

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

Some FAMIX questions

Stephan Eggermont-3
While trying to map Delphi to FAMIX, we ran into some issues:
- Delphi has definitions of a.o. methods split over the interface and
  the implementation part of a unit. Where do I put the second sourcetextanchor?
  This might be similar to the situation with c header files.
- Being a hybrid of structured and oo, functions seem to be best modeled as
  scopingentities too. What does it mean that scopingentities represent an entity
  defining a scope at a global level? Units in Delphi can be local to another unit.
- The class comment of behaviouralentity is a bit sloppy in describing which
  metrics we should provide: is cylomatic complexity, numberOfStatements &
  numberOfConditionals enough?  
I am not sure I like the deep inheritance hierarchy of FAMIX.  It seems
rather brittle. Is Delphi a special case?

Stephan


_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: Some FAMIX questions

Tudor Girba-2
Hi,


On Thu, Aug 29, 2013 at 1:12 AM, Stephan Eggermont <[hidden email]> wrote:
While trying to map Delphi to FAMIX, we ran into some issues:
- Delphi has definitions of a.o. methods split over the interface and
  the implementation part of a unit. Where do I put the second sourcetextanchor?
  This might be similar to the situation with c header files.

The source anchor should point to the implementation, not the definition. Perhaps for the definition, you can add a FAMIXDelphiMethodDefinition and link it with a FAMIXMethod. This one then can have its own source anchor.
 
- Being a hybrid of structured and oo, functions seem to be best modeled as
  scopingentities too. What does it mean that scopingentities represent an entity
  defining a scope at a global level? Units in Delphi can be local to another unit.

I do not understand this part. Could you provide more details and maybe an example?
 
- The class comment of behaviouralentity is a bit sloppy in describing which
  metrics we should provide: is cylomatic complexity, numberOfStatements &
  numberOfConditionals enough?

You should provide those metrics that are not marked as derived. To find this out you can evaluate:
FAMIXBehaviouralEntity asMooseDescription allAttributes select: [ :each | each isDerived not and: [ each type = FM3 number ] ]
==>

 an Array(
a FM3PropertyDescription[FAMIX.BehaviouralEntity.numberOfParameters] 
a FM3PropertyDescription[FAMIX.BehaviouralEntity.numberOfStatements] 
a FM3PropertyDescription[FAMIX.BehaviouralEntity.cyclomaticComplexity] 
a FM3PropertyDescription[FAMIX.BehaviouralEntity.numberOfConditionals] 
a FM3PropertyDescription[FAMIX.BehaviouralEntity.numberOfLinesOfCode] 
a FM3PropertyDescription[FAMIX.BehaviouralEntity.numberOfComments])
 
I am not sure I like the deep inheritance hierarchy of FAMIX.  It seems
rather brittle. Is Delphi a special case?

FAMIX was first built in VW, and we only relied on single inheritance. Since a long while we have the plan of moving towards Traits. More recently Nicolas expressed an interest in working on such a topic, and Alain Plantec extended Fame with the concept of Traits. However, until now, nothing really moved but it would definitely be great to have more energy spent there.

Cheers,
Doru


 
Stephan


_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev



--

"Every thing has its own flow"

_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: Some FAMIX questions

Nicolas Anquetil

On 08/29/2013 06:56 AM, Tudor Girba wrote:
I am not sure I like the deep inheritance hierarchy of FAMIX.  It seems
rather brittle. Is Delphi a special case?

FAMIX was first built in VW, and we only relied on single inheritance. Since a long while we have the plan of moving towards Traits. More recently Nicolas expressed an interest in working on such a topic, and Alain Plantec extended Fame with the concept of Traits. However, until now, nothing really moved but it would definitely be great to have more energy spent there.

Cheers,
Doru

It is still on my todo list, but I just don't have the time to do it.

nicolas

-- 
Nicolas Anquetil -- RMod research team (Inria)

_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: Some FAMIX questions

Stephan Eggermont-3
In reply to this post by Stephan Eggermont-3
Thanks for the pointers.

My confusion on scopingentities has to do with the following:
In Delphi, functions can be nested and then also provide a scope.
Old libraries, e.g. ported from turbo pascal times, sometimes
are structured like that. But that scope is nested, not global.
Variables defined in the implementation part of a unit are not
globally reachable, unlike those defined in the interface.

Stephan
_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: Some FAMIX questions

Stephan Eggermont-3
In reply to this post by Stephan Eggermont-3
Currently, quite a lot of space seem to be taken up by not-filled instvars.
In my Delphi based Whitestar model, 406085 out of 664371
are either nil or empty sets. In a JHotDraw model from inFusion
it is 724408 out of 1351527

Stephan


FAMeasurements>measure
        varSize := mClass instSize.
        instSize := mClass allInstances size.
        nrNil := 0.
        nrEmpty := 0.
        mClass allInstancesDo: [ :instance |
                1 to: varSize do: [:varIndex | |value|
                        value := instance instVarAt: varIndex.
                        value ifNil: [ nrNil := nrNil+1 ].
                        value isCollection ifTrue: [
                                value ifEmpty: [ nrEmpty := nrEmpty+1 ] ] ] ]

MeasureFAMIX>initializeMeasurements
        FAMIXEntity withAllSubclassesDo: [ :each |
                self measurements add: (FAMeasurements new
                  mClass: each;
                  yourself). ]

MeasureFAMIX>run
        self initializeMeasurements.
        measurements do: [ :each | each measure]

MeasureFAMIX>sum
        nrOfVars := 0.
        nrEmpty := 0.
        measurements do: [ :measurement |
                nrOfVars := nrOfVars + (measurement varSize * measurement instSize).
                nrEmpty := nrEmpty + measurement nrEmpty + measurement nrNil].

 In Famix-SelfMeasurements on smalltalkhub
_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: Some FAMIX questions

Stéphane Ducasse
nice analysis.
I really hope that using smarter class structure based on Slot we can offer a solution in the future.


On Aug 29, 2013, at 6:24 PM, Stephan Eggermont <[hidden email]> wrote:

> Currently, quite a lot of space seem to be taken up by not-filled instvars.
> In my Delphi based Whitestar model, 406085 out of 664371
> are either nil or empty sets. In a JHotDraw model from inFusion
> it is 724408 out of 1351527
>
> Stephan
>
>
> FAMeasurements>measure
> varSize := mClass instSize.
> instSize := mClass allInstances size.
> nrNil := 0.
> nrEmpty := 0.
> mClass allInstancesDo: [ :instance |
> 1 to: varSize do: [:varIndex | |value|
> value := instance instVarAt: varIndex.
> value ifNil: [ nrNil := nrNil+1 ].
> value isCollection ifTrue: [
> value ifEmpty: [ nrEmpty := nrEmpty+1 ] ] ] ]
>
> MeasureFAMIX>initializeMeasurements
> FAMIXEntity withAllSubclassesDo: [ :each |
> self measurements add: (FAMeasurements new
>  mClass: each;
>  yourself). ]
>
> MeasureFAMIX>run
> self initializeMeasurements.
> measurements do: [ :each | each measure]
>
> MeasureFAMIX>sum
> nrOfVars := 0.
> nrEmpty := 0.
> measurements do: [ :measurement |
> nrOfVars := nrOfVars + (measurement varSize * measurement instSize).
> nrEmpty := nrEmpty + measurement nrEmpty + measurement nrNil].
>
> In Famix-SelfMeasurements on smalltalkhub
> _______________________________________________
> Moose-dev mailing list
> [hidden email]
> https://www.iam.unibe.ch/mailman/listinfo/moose-dev


_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: [Pharo-dev] Some FAMIX questions

Tudor Girba-2
+100

Doru


On Thu, Aug 29, 2013 at 9:58 PM, Stéphane Ducasse <[hidden email]> wrote:
nice analysis.
I really hope that using smarter class structure based on Slot we can offer a solution in the future.


On Aug 29, 2013, at 6:24 PM, Stephan Eggermont <[hidden email]> wrote:

> Currently, quite a lot of space seem to be taken up by not-filled instvars.
> In my Delphi based Whitestar model, 406085 out of 664371
> are either nil or empty sets. In a JHotDraw model from inFusion
> it is 724408 out of 1351527
>
> Stephan
>
>
> FAMeasurements>measure
>       varSize := mClass instSize.
>       instSize := mClass allInstances size.
>       nrNil := 0.
>       nrEmpty := 0.
>       mClass allInstancesDo: [ :instance |
>               1 to: varSize do: [:varIndex | |value|
>                       value := instance instVarAt: varIndex.
>                       value ifNil: [ nrNil := nrNil+1 ].
>                       value isCollection ifTrue: [
>                               value ifEmpty: [ nrEmpty := nrEmpty+1 ] ] ] ]
>
> MeasureFAMIX>initializeMeasurements
>       FAMIXEntity withAllSubclassesDo: [ :each |
>               self measurements add: (FAMeasurements new
>                 mClass: each;
>                 yourself). ]
>
> MeasureFAMIX>run
>       self initializeMeasurements.
>       measurements do: [ :each | each measure]
>
> MeasureFAMIX>sum
>       nrOfVars := 0.
>       nrEmpty := 0.
>       measurements do: [ :measurement |
>               nrOfVars := nrOfVars + (measurement varSize * measurement instSize).
>               nrEmpty := nrEmpty + measurement nrEmpty + measurement nrNil].
>
> In Famix-SelfMeasurements on smalltalkhub
> _______________________________________________
> Moose-dev mailing list
> [hidden email]
> https://www.iam.unibe.ch/mailman/listinfo/moose-dev





--

"Every thing has its own flow"

_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: Some FAMIX questions

Stephan Eggermont-3
In reply to this post by Stephan Eggermont-3
Ok, so easiest to reclaim some space seems to be FMMultivalueLink.
Lots of empty ones (>80%), and values is an OrderedCollection
of size 10.

Stephan

_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev