Software Visualization....

Dwight Hughes dwighth at ipa.net
Thu Oct 22 04:31:13 UTC 1998


Warning, Long reply.... :-b

Mark,

Sorry, I'm not a VA kind of guy -- since I do Smalltalk as an avocation,
not a vocation, VA is out of the question ($$$$). I know very little
about that side of the fence, so these tools are new to me.

Mark Wai wrote:
> 
> Warning:  Long message....
> 
> Dwight -
> 
> Maybe you have already seen it or know about it.  But never mind I repeat here.
> 
> Since version 4.0, VisualAge has a new add on tool (free of charge) called
> 'Visualization Tools' that I believe people are rarely use or even know
> about it.  Anyway,  VT provides three basic tools for object visualization
> within VAST environment.
---snip---

Since I haven't seen any of these apps in action, I will ask a number of
rhetorical questions that point to what capabilities I am looking for.
(Many of these capabilities are present in ZStep -- you might need to
map Lisp onto the corresponding Smalltalk constructs to see that in
detail though.)

> 1)  Object Visualizer
> 
> The Object Visualizer is a tool that enables you to analyze object activity
> and interaction. With this tool, you can visualize objects in your
> application, which enables you to do the following:
> 
> o See how many instances of a class exist at any time during application
> execution

Can you examine each instance at any point? Can you "sit" on an instance
(or instances) and watch it (them) change as the application executes? 

> o Watch a visual representation of message traffic between objects

Can you see why the messages were sent and what their content was
(listen in on the conversation)?

> o Identify which objects are busiest, and which are most idle
> o Determine which clusters of objects are closely related to one another,
> based on the amount of message traffic between them.

Can you watch the activity as it is happening? Can you stop and see what
is causing the activity at any particular point? [1]

---snip---
>                 The Object Visualizer provides two views that
> you can use to visually analyze your application performance:
> 
> o The main Object Visualizer  window is  a visual representation of object
> instances. For each
> visualized class, the Object Visualizer displays an icon representing each
> instance of that
> class. This view also provides several indicators you can use to track the
> level of message
> traffic between the instances.

see [1]
 
> o The Cluster View  is  a dynamic visual representation of the relationships
> between objects.
> The Cluster View measures the level of interaction between objects, visually
> arranging the
> objects to show which objects are closely related (based upon the amount of
> message traffic
> between them). You can use the Cluster View to analyze either classes or
> instances.

see [1]

> 2) Widget Scope
> 
> A tool that reveals objects "behind the scenes" of an interactive Smalltalk
> application.  A user simply clicks anywhere on the screen, and the Widget
> Scope lists the widget objects that produce that part of the display, as
> well as other objects that implement the function provided by the
> application.  Widget scoping in onjunction with visualizing and snooping
> (pages 3 and 19), constitutes an extremely powerful, yet practical and
> convenient, means of "getting to the bottom" of behavior of unfamiliar
> applications and frameworks.
> Without these tools, a programmer trying to gain an understanding of how an
> application works (to fix it,  to extend it,  or to reuse parts of it)  is
> faced with roundabout schemes involving searching for classes by pattern
> matching on their names, guessing at how to launch an application, and
> trying to get a debugger to open at opportune times.

Can you also go the other way - can you select an area of screen and
watch it being manipulated and watch the methods as they do the
manipulation?

---snip--- 

> >As a zero-th approximation of what I am
> >initially shooting for, take a look at "Bridging the Gulf Between Code
> >and Behavior in Programming" by Henry Lieberman and Christopher Fry,
> >which describes the ZStep 94 debugger (for Macintosh Common Lisp) - see:
> >
> >http://lieber.www.media.mit.edu/people/lieber/Lieberary/ZStep/ZStep.html
> 
> I took a quick peek at ZStep.  To be honest, I don't see anything that is
> different or new (in terms of ideas, concepts and implementation) from
> standard ST debugger.  I probably missed something and maybe I should read
> more carefully.

I definitely think reading a bit closer would be enlightening (don't let
the relatively pedestrian appearance of the screen shots distract you).
Let me give an example of exploring a Smalltalk method using
reversibility and "value at mouse pointer":

trivialExample
	| a b |
	a := 5.
	b := 7.
	b := a + b.
	a := a + b * 2. self halt.
	^a max: b

In any Smalltalk debugger I know of, a = 34 and b = 12, and that is it.
You get the state of execution at the point you dropped into the
debugger, period. Now let's examine the values of the variables by
placing the mouse pointer on them (using reversibility) -- I generalize
"value at mouse pointer" to include value returned by messages also:

trivialExample
	| a    b |
	  ^    ^
	 nil  nil
	a := 5.
	^
        5
	b := 7.
	^
	7
	b := a  +   b.
	^    ^  ^   ^
	12   5  12  7	
	a := a   +   b   *  2. self halt.
	^    ^   ^   ^   ^
	34   5   17  12  34
	^a max: b

All this information is available at one place - no need to go to any
other browsers, stack views, etc. ZStep unifies code editing and viewing
with execution and debugging -- again, this is something I want to do in
Squeak, so the scope of what I'm wanting to do is somewhat grandiose
(always shoot for the stars -- if you miss and hit the Moon you're still
doing pretty good).

-- Dwight





More information about the Squeak-dev mailing list