[GOODIE] SpaghettiTrace

Stephane Ducasse squeak-dev at lists.squeakfoundation.org
Sun Sep 15 14:01:01 UTC 2002


Really interesting.
I do not have the time to look at your code now. Can you tell what ar=
e=20
the information you take into account?


On dimanche, septembre 15, 2002, at 03:22  PM, danielv at netvision.net.=
il=20
wrote:

> Change Set:=09=09SpaghettiTrace
> Date:=09=09=0915 September 2002
> Author:=09=09=09Daniel Vainsencher
> Prerequisites:=093.2
>
> Tool for understanding indirect links between code.
> If you have trouble, please run the tests first.
>
> setup (this will take a minute or two):
> graph _ CodeGraphCreator graphForClassesAndExtensions: Smalltalk
> allClasses
>
> The following show one way each class is dependent on the other (th=
ere
> could be other ways):
>  CodeAnalyzer pathBetween: MIMEDocument and: Object in: graph (Simp=
le
> inheritance)
>  CodeAnalyzer pathBetween: Object and: MIMEDocument in: graph (bad =
bad
> link!! ;-)
>  CodeAnalyzer pathBetween: MIMEDocument and: GeeBookMorph in: graph
> (whats that got to do with it?!!)
>
> You can also find paths between groups of classes (useful to analyz=
e
> whole categories):
>  GraphAnalyzer new shortestPathFrom: {#Object} to: {#MIMEDocument} =
 in:
> graph
>
> Components show what groups of classes are interdependent:
>  components _ GraphAnalyzer new findStrongComponentsIn: graph
>  (components detect: [:e | e includes: #VRMLNodeSpec]) size (ok,
> interesting)
>  bigComp _ (components detect: [:e | e includes: #GeeBookMorph]) si=
ze
> (Gulp)
>  components select: [:e | e size > 1]
>
> Another way to define components is that you can find an indirect l=
ink
> between any two node, in both directions. Probably on at least one =
of
> those directions you can find a good example of a bad dependency. Y=
ou
> can see them using pathBetween:.. as above.
>
> CodeAnalyzer pathBetween: (Smalltalk classNamed: bigComp atRandom) =
and:
> (Smalltalk classNamed: bigComp atRandom) in: g
>
> Have fun.
>
> Daniel Vainsencher
> <SpaghettiTrace.cs.gz>
Dr. St=E9phane DUCASSE (ducasse at iam.unibe.ch)=20
http://www.iam.unibe.ch/~ducasse/
  "if you knew today was your last day on earth, what would you do
  different? ... especially if, by doing something different, today
  might not be your last day on earth" Calvin&Hobbes





More information about the Squeak-dev mailing list