[GOODIE] SpaghettiTrace

danielv at netvision.net.il danielv at netvision.net.il
Sun Sep 15 13:22:39 UTC 2002


Change Set:		SpaghettiTrace
Date:			15 September 2002
Author:			Daniel Vainsencher
Prerequisites:	3.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 (there
could be other ways):
 CodeAnalyzer pathBetween: MIMEDocument and: Object in: graph (Simple
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 analyze
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]) size
(Gulp)
 components select: [:e | e size > 1] 

Another way to define components is that you can find an indirect link
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. You
can see them using pathBetween:.. as above.

CodeAnalyzer pathBetween: (Smalltalk classNamed: bigComp atRandom) and:
(Smalltalk classNamed: bigComp atRandom) in: g

Have fun.

Daniel Vainsencher
-------------- next part --------------
A non-text attachment was scrubbed...
Name: SpaghettiTrace.cs.gz
Type: application/octet-stream
Size: 4577 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20020915/73bb555b/SpaghettiTrace.cs.obj


More information about the Squeak-dev mailing list