2012 MIPRO Reif Orehovacki Final
2012 MIPRO Reif Orehovacki Final
net/publication/224954355
CITATIONS READS
4 2,554
2 authors, including:
Tihomir Orehovački
Juraj Dobrila University of Pula
126 PUBLICATIONS 672 CITATIONS
SEE PROFILE
Some of the authors of this publication are also working on these related projects:
All content following this page was uploaded by Tihomir Orehovački on 08 October 2014.
Abstract - Algorithm analysis and design is a great perfectly. Namely, it is very difficult to understand and
challenge for both computer and information science learn complex algorithms such as iterations, recursions or
students. Fear of programming, lack of interest and the sorting algorithms only by watching code lines or a flow
abstract nature of programming concepts are main causes chart. On the contrary, if students can control their own
of the high dropout and failure rates in introductory data sets and see the whole process of algorithm
programming courses. With an aim to motivate and help execution, they are able to draw conclusions from the
students, a number of researchers have proposed various resulting data or in course of the algorithm visualization.
tools. Although it has been reported that some of these tools
have a positive impact on acquiring programming skills, the The aforementioned claims have motivated
problem still remains essentially unresolved. This paper researchers to develop tools that will simplify and
describes ViSA, a tool for visualization of sorting facilitate the learning of programming concepts, thus
algorithms. ViSA is an easy-to-set-up and fully automatic helping students to acquire both programming knowledge
visualization system with step-by-step explanations and and skills. With an aim to engage students in learning
comparison of sorting algorithms. Design principles and activities, the implementation of a visualization
technical structure of the visualization system as well as its technology within educational process has been proposed
practical implications and educational benefits are [8][27]. The earliest examples were slideshow
presented and discussed.
presentations or simple web interfaces with basic
structures and operations [3], [5]. Later, more advanced
I. INTRODUCTION
tools such as DrScheme [29] or Robolab [30] were
Programming courses are a fundamental part of both introduced. However, a mere development and
computer and information science curricula. Their purpose deployment of visualization tools is not enough to attain
is to introduce basic programming concepts (e.g. control an objective of learning complex algorithms. Hansen et al.
structures, aggregation mechanisms, sorting algorithms, [6] suggested that visualization technology should involve
etc.) to students, thus helping them to acquire students in activities such as the construction of their own
programming skills. This goal is often very difficult to input data sets and interaction with animation, which will
achieve and according to some studies (e.g. [28]), eventually result in their own predictions and logical
introductory programming courses have relatively high conclusions.
dropout and failure rates. Nevertheless, a tremendous
variation in pass, fail, abort and skip rates were reported With an aim to facilitate the understanding, analysis
by Bennedsen and Caspersen [2]. It should be noted that and design of sorting algorithms, a tool for their
the higher average passing rate was established at colleges visualization called ViSA is presented in this paper. Using
(88%) than at universities (66%). The most common ViSA, students are guided in the learning process by a
reason for failing a course was the abstract nature of detailed step-by-step explanation. The remainder of the
programming concepts since this was the first course paper is structured as follows. Section 2 provides a brief
where students were confronted with programming. literature review. In section 3, specific features and
According to Radošević et al. [1], the main problems in examples of ViSA use are described. Section 4 presents
learning programming are: lack of previous knowledge, the results of a pilot study on perceived usefulness,
problem-solving algorithms, fear of programming, and the perceived ease of use, behavioral intention, and attitude
perception of difficulty of programming language syntax. towards use of ViSA. Concluding remarks and future
They also discovered that problem-solving algorithms are work directions are provided in the last section.
perceived as a much greater obstacle than programming II. RELATED WORK
language syntax itself. Regarding the problems related to
the C++, programming language syntax, research on A gap between the way in which algorithms are taught
compilation behavior [20] has reported that most common and the students’ learning style is one of the main reasons
mistakes made by novice programmers are: use of why introductory programming courses are perceived as
undeclared variable, defining variable within iteration, hard. Namely, while the majority of people are visual
wrong operator in the logical expression, etc. types [7], teaching, to a great extent, is verbal. Visual
learning is a type of learning where people prefer using
The objective of novice programmers is to implement images, pictures, colors, and maps to organize information
the abstract process of algorithm execution in a way or in order to comprehend complex concepts. This is the
language that will be understandable to the computer. main reason why algorithm visualization (AV) tools are
However, if a programmer wants to ‘explain’ something implemented in learning process. In literature there are a
to the computer, he or she first has to understand it lot of AV tools such as Alice [9], Software Visualization
System [7], Jcat [10], Guido von Robot [11], Samba A similar tool aimed for teaching programming and
Algorithm Animation System [12], JHAVÉ [4], etc. Most algorithms is Guido von Robot. It is not 3D based, but
of them contain a set of control options for the user and instead uses its own programming syntax which is entirely
can run in a step-by-step mode. On the other hand, only written in Python. When working with Guido von Robot
some of them allow the user to adjust the speed of [11], similar problems occur. Although the knowledge of
animation (e.g. Samba [12]). Moreover, the feature triggers and animation is not required here, a more
allowing the user to going backwards a certain number of complex syntax is still used. Guido von Robot is a
steps as in DDD [13] is relatively uncommon. simulation tool made of two basic parts: pointer, and array
of dots. The pointer represents the current position of data
There are two types of AV: animation and simulation in the algorithm while the array of dots represents the path
tools. Algorithma 99 [14] is an animation tool that enables which the data take. This is why the user has to integrate
the user to enter algorithms in a predefined pseudo-code the pointer move commands inside the code itself. The
language which can then be visualized. Such a method of user also needs to know what the code does in order to
animation requires the knowledge of setting up the pseudo integrate the data for moving the cursor correctly, which
code and linking it with control elements which then makes the process of learning a new algorithm much more
execute the animation. Systems like JAWAA [15] and difficult than necessary.
JSamba [4] simulate the algorithm provided in a special
syntax that needs to be learned prior to starting using the While the aforementioned tools are aimed for learning
tools. programming in general, the tools described below are
intended for sorting algorithms visualization. Jcat [10] is a
There are several animation tools based on interpreting web based simulation tool developed in the Java
source code, such as Zstep95 [16]. However, without
programming language. Unlike the afore-mentioned tools,
precognition related to system expressions and their it enables sorting algorithm visualization and provides
contribution to the animation, user cannot make the information related to the steps taken during simulation.
decision whether to use the details (animation controls) or However, it has a number of drawbacks. Users are not
an expression. On the other hand, if all elements are allowed to customize the array size or elements value,
enabled and shown during animation, some key parts which constrains interaction. Furthermore, users cannot
needed for the understanding of algorithm could be control the speed or flow of animation and the information
overlooked. that is shown during the animation does not explain why
The KAMI system [17] is an animation tool that relies certain elements are swapped or compared. Executing web
on debugging data and generates a slide-by-slide display based applications also implies several potential problems
illustrating the code execution. Slide by slide animations such as missing add-ons that are required for code
are not controlled by the user or reviewed by the instructor execution.
so they might present excessive additional information. Animal [21] animations include a linked sequence of
Jeliot [18] reads Java source code and automatically animation steps operated by the pause, stop, play and
generates visualizations. This tool does not offer the rewind buttons just like any other visualization tool. The
explanation of any step executed during animation and is main window is sectionalized in three segments. A control
limited only to java source code. tool bar at the top of the windows allows adjusting the
BlueJ [19] is one of the first systems developed to display speed and magnification. A tool bar at the bottom
teach introductory object oriented programming. The key contains control elements for triggering the animation
feature of the system is the static visualization of a class display and the last part is the pseudo-code area. Animal
structure as a UML diagram. Furthermore, it allows the provides several different control mechanisms for
learner to interact with the objects by creating them, selecting the current animation step: a control tool bar, a
calling their methods, and inspecting their state with easy- list of labeled animation steps, a slide ruler, and text field
to-use menus and dialogs. However, it does not provide for direct input. The main advantage of this tool is its
any dynamic visualization of the program. support to rewinding an animation or skipping to a certain
step. However, it has serious problems with screen
Simulation tools are more user-friendly and useful in resolution. Namely, data containers, graphs, and pseudo-
teaching programming. One of them is Alice [9], a general code will change their positions or completely cover the
purpose simulation tool aimed for teaching any kind of animation control if the screen resolution is changed.
programming concepts. However, before it can be used Additionally, this tool does not provide any information
for teaching specific algorithms, the user has to learn its about the steps that are taken during the animation.
specific syntax. In addition, it does not allow any
interaction with animation during programming. Software Visualization System [7] is very similar to
According to Hansen et al. [6] the use of Alice produces a ViSA. It allows users to select one of the sorting
great deal of time wasted on learning a new syntax instead algorithms and, subsequently, to fill in the array data and
of learning the algorithms at hand. For example, to create run the animation. The main window is made of four
a simple iteration, a user would have to know how to use panels. The first panel presents the execution of the
the syntax, set up 3D models, and implement the triggers algorithm in an array. Along with the execution panel, the
that interact with the models. Setting up a tool like Alice interface also contains a pseudo-code panel, where users
would also require intense preparations on the host can learn the algorithm during code creation. Beneath the
computer such as 3D driver installation, etc. pseudo-code panel the execution status messages panel is
located which shows the steps during the animation. Next
to it is a panel which shows variables in use. Although this
kind of window organization does not explain steps in allowing the students to learn whether their data set drives
which specific elements are swapped or compared, it the animation in the anticipated manner. The animation
shows the user full algorithm information. Nevertheless, it sequence is generated dynamically, as presented in the
does not support more than seven elements in the array. code block 1. After each comparison or swap, the
We believe that customization of the numbers of elements information about the elements is added to the Listbox
in an array is very important because some algorithms queue.
work better with larger arrays than small ones. Given that Do
Software Visualization System does not support changing
the size of an array, it is not really possible to compare blnSwapped = False
two different sorting algorithms. Finally, the lack of multi- For i = iMin To iMax
threading, which means that only one algorithm can be ListBox1.Items.Add((i.ToString + "|" + (i
executed at the same time, presents the greatest + 1).ToString).ToString())
disadvantage of this tool.
If Array(i) > Array(i + 1) Then
III. VISUALIZATION OF SORTING ALGORITHMS (VISA) ListBox1.Items.Add((i.ToString + ">" + (i
+ 1).ToString).ToString())
ListBox1.Items.Add((i.ToString + ">" + (i +
1).ToString).ToString())
Figure 1. ViSA data set construction Code block 2. Control elements syntax
ViSA supports well known sorting algorithms such as
Cocktail Sort, Comb Sort, Heap Sort, Insertion Sort, The function Listbox1.Items.add receives three
Merge Sort, Quick Sort, Selection Sort, and Shell Sort. parameters: (i) i that represents the first element, (ii)
After choosing an algorithm, the user is prompted with the string “>” that represents a comparison action, and (iii)
data set construction form. The form elements (textboxes, i+1, a variable that contains the second element.
labels, array preview) are dynamic, thus allowing the user
to make changes at any time without preventing the
software to receive the correct data input. In case of an
error committed by the user, he or she will receive a
warning about the wrongly entered or inaccurately
formatted data. The user can select among a range of
methods for generating random numbers such as pure
random, big values at the end, small values at the end, or
almost sorted. If the user wants to enter specific values, he
or she will simply enter the numbers in the empty textbox
delimited with a coma and an array preview will be
generated. When the user has finished with setting up the
data set, ViSA runs a final data format test and allows the
user to proceed. This form of input generation is
constructed in a way to be forwarded to the visualization, Figure 2. ViSA main window
The ViSA main animation (presented in Figure 2)
window is composed of several standard controls: (i) oval
shapes that represent elements in an array, (ii) slider for
controlling the animation speed, (iii) start and stop
button, (iv) information about complexity of the
algorithm including the number of swaps and
comparisons that are executed during the animation, and
(v) the panel on the right side that contains explanations
of each step that is taken during the visualization. The
animation flow can be controlled by the user with the
next button that will either execute one step at the time or
fully automatically. Additional controls are added to each Figure 4. Simultaneous animation
sorting algorithm for better understanding of the
algorithm (e.g. a data structure-max tree for Heap sort or Figure 4 illustrates one of ViSA’s special features –
a divided sub-array in Merge Sort). After each action simultaneous visualization of selected sorting algorithms.
(swap, comparison, interval readjustment or pivot update) This feature allows the user to compare the speed and
an appropriate explanation is shown in the bottom right complexity of the sorting algorithms that have been
area. The animation playback has two modes: automatic selected. The user can sort the same array with any
and step-by-step mode. In any of these two modes the algorithm from the list or choose a new data set for a
user can pause the animation and read the description of particular algorithm. If all algorithms are executed for the
the current action. The most appropriate mode for novice same initial array, it is possible to run a real time speed
programmers is the step-by-step mode, where the user is test. In that case, the visualization window is minimized
able to see every action during the visualization and read to the bottom part of the form container, enabling the user
the corresponding explanation. to access any of the running algorithms. Given that some
algorithms perform more comparisons at the beginning
and finish with a quick series of swap actions, users can
compare the number of actions for each algorithm in real
time. In order to enable as much user interaction as
possible and stimulate users’ logical conclusions, ViSA is
supplemented with algorithm analysis (Figure 5).
APPENDIX A.
Items Mean SD
Perceived Usefulness (Cronbach’s α = 0.668)
Using ViSA would enhance my efficiency in understanding of sorting algorithms. 1.41 0.570
Using ViSA would enhance my effectiveness in understanding of sorting algorithms. 1.55 0.551
Using ViSA would enable me to learn sorting algorithms much faster than learning from textbooks. 1.61 0.750
Using ViSA would help me to understand sorting algorithms much more easily than during classes. 1.89 0.741
I would find ViSA useful for learning sorting algorithms. 1.37 0.538
Perceived Ease of Use (Cronbach’s α = 0.808)
Learning to operate ViSA would be easy for me. 1.36 0.534
I would find it easy to get ViSA to do what I want it to do. 1.64 0.725
My interaction with ViSA would be clear and understandable. 1.37 0.512
I would find ViSA to be flexible to interact with. 1.96 0.720
It would be easy for me to become skillful at using ViSA. 1.45 0.575
I would find ViSA easy to use 1.39 0.591
Attitude Towards Use (Cronbach’s α = 0.777)
I think it would be very useful to use ViSA in programming related courses. 1.43 0.574
In my opinion, it would be very desirable to use ViSA in programming related courses. 1.42 0.572
I think it would be very wise if students used ViSA for learning sorting algorithms. 1.43 0.618
Behavioral Intention (Cronbach’s α = 0.807)
I would recommend ViSA to my colleagues. 1.49 0.702
I would recommend ViSA to novice programmers. 1.33 0.661
I intend to use ViSA for learning and recapitulation of sorting algorithms. 2.16 0.994
To the extent possible, I would use ViSA as part of courses related to the programming. 1.67 0.806
When I need to make a comparison and analysis of sorting algorithms, I intend to use ViSA. 1.96 0.855