in general not define or use any kind of coloring
inside their object diagrams. However, at least three
possibilities exist how coloring can be used to make
object diagrams more comprehensible for first year
students.
First, colors can be assigned to each object class,
thus coloring all objects of the same type in the same
color, making it easy to distungish them from objects
of other types. This way of coloring is useful in
situations, where many different classes are in action
and using objects of the wrong type is expected to
be a frequent fault made by students. This way of
coloring is of little use if only one or two different
classes are in action, e.g. in a list data structure with
elements of the same type, where wrong references
between objects are expected to be the most common
fault. In these cases, the second method of coloring
may be beneficial: the coloring of class attributes of
non-primitve types. For example, in a binary tree, the
left child of a node could always be colored yellow,
while the right child is always colored blue.
A third way of using colors is to mark objects that
have been removed from a data structure, e.g. by
displaying them half-transparent or surrounded with
a red border. This way, even a static visualization
can give information about changes that happened to
the data structure. Furthermore, it helps students to
distuingish between a situation in which an object
is missing because it has never been created and a
situation in which an object is missing because it
has been deleted. Being able to distuingish between
these situations is assumed to be a crucial point in
understanding behaviour of algorithms acting on data
structures.
2.3 Sequences of Visualizations
An even better understanding of behaviour can be
gained if not only one static visualization is used, but
a sequence of static visualizations. This can simply
be achieved by taking snapshots of the program state
several times during run time. Despite this simplicity,
this raises some additional requirementsfor the layout
of each visualization.
The most important concept in this context is the
“mental map” (Eades et al., 1991) of the student
using this visualizations. According to this concept,
changes between visualizations should be as minimal
as possible. Thus it is not acceptable that objects
displayed in one visualization are changing positions
or colors in the subsequent one without changes in the
relations between them. Even if changes in the data
structure occur it is hard to identify where an object
has gone if it has different positions in subsequent
visualizations. Thus we require our layout algorithms
to look ahead with respect to changes in the data
structure, minimizing confusion for the students. In
a simple solution, each object has only one fixed
position in all visualizations generated for a program.
This is well suited to perserve the mental map of the
student, but may be confusing with respect to the
behavior of the implemented algorithm. For example,
an exercise may be to realize sorting of elemtens in
a list. In this case, it would be much more helpful
if objects in the visualization change place step by
step until the algorithm terminates, instead of keeping
each in a fixed position and just changing pointers
between them.
Note that the requirements for sequences of
visualizations may stand in contrast to our general
requirements. For example, generating a compact
arrangement of objects in order to reduce the size of
the visualization would imply to move objects closely
together and close gaps between them. However,
being foresighted with regards to object positions
would imply to reduce this movement and plan with
gaps in early visualizations that are filled by objects
that appear later on in subsequent visualizations.
3 IMPLEMENTATION
The flexible architecture of our e-learning and e-
assessment framework JACK (Striewe et al., 2009)
allowed to implement an independent module for
creating visualizations. The implementation has been
done in Java and is so far able to visualize data
structures from Java programs.
3.1 Retrieving Data
The visualization module is based on the Java
Platform Debugging Architecture (Sun Microsys-
tems, Inc., b) and uses the JDI-API (Sun Microsys-
tems, Inc., a) for retrieving objects and events from
the Java virtual machine running the program submit-
ted by the student.
Besides the source code it requires a file
containing configuration information created by
the teacher. This way the teacher can specify
which classes of objects should be visualized and
which classes are irrelevant for the visualization.
Additionally, the teacher can specify breakpoints in
terms of lines in the program code at which snapshots
of the program state are taken. Note that this requires
to have at least one source code file which is not
modified by students so that line numbers are known
to the teacher for sure.
CSEDU 2010 - 2nd International Conference on Computer Supported Education
174