Download as pdf or txt
Download as pdf or txt
You are on page 1of 6

A COMPARISON OF TWO OBJECT-ORIENTED PROGRAMMING

ENVIRONMENTS FOR NOVICES

Stelios Xinogalos(*), Maya Satratzemi(*), Vassilios Dagdilelis(**)


(*)
Department of Applied Informatics, (**)Department of Educational and Social Policy
University of Macedonia,
156 Egnatia str., P.O.Box 1591, 54006, Thessaloniki
Greece
{stelios, maya, dagdil}@uom.gr

ABSTRACT (1) presenting examples and assigning exercises


Teaching Object Oriented Programming (OOP) to especially designed for avoiding common difficulties; (2)
novices is quite problematic. In order to overcome the using Graphical User Interfaces; (3) using Case Studies;
difficulties various teaching approaches have been (4) using Educational Programming Environments; (5)
proposed. In this paper, we present our findings regarding using Programming Microworlds.
two teaching approaches based on two different In this paper we present the results of teaching OOP with
environments: (i) teaching with the Educational the educational programming environment of BlueJ [3]
Programming Environment of BlueJ; (ii) teaching with and the programming microworld of objectKarel ([4],
the Programming Microworld of objectKarel. The [5]). The presented results are based on students’ answers
presented results are based on students’ answers to a to a questionnaire that was given to students at the last
questionnaire that was given to students at the last lesson lesson of the two studies, and refer exclusively to the
of the two studies, and refer exclusively to the comprehension of basic concepts of object-oriented
comprehension of the most basic concepts of OOP: programming: objects, class. Also, the main differences
objects and classes. The analysis of the results shows that of the two teaching approaches, both the obvious ones
the combined use of the two environments seems to and those that came up from our study, are presented.
constitute a better didactic strategy from just using one of Finally, we conclude with some proposals for combining
the two environments. the advantages of the teaching approaches described.

KEY WORDS
Object-oriented programming, educational software, 2. Teaching OOP with BlueJ
educational programming environments, microworlds.
2.1 The Main Features of BlueJ
1. Introduction
Students can use the interactive interface of BlueJ (Figure
The introduction to programming one or two decades ago 1) for creating objects and invoking their methods.
was usually realized with procedural programming Students can also inspect the state of the objects that they
languages, and mainly Pascal. However, the last decade have created. This feature gives students the chance to
teachers begun to teach, some times in combination with watch the state of instance variables. Furthermore, this
procedural/imperative programming, OOP too. The first feature gives teachers the chance to delay the presentation
years of teaching OOP the most important research issue of other interface technologies and support a pure objects-
was whether the imperative or the object-oriented first approach.
programming paradigm should be used for introducing The editor supports limited coloring of source code
students to programming [1]. Nowadays, the OOP (syntax highlighting), display of line numbers and
paradigm is usually used for the introduction to brackets matching. The source code of each class is
programming and teachers/researchers have focused on presented in a separate window. In the case of syntax
devising more effective – if not effective – teaching errors, they are presented in the bottom of the window
approaches, since the teaching of OOP has proven to be and there is no interaction between the error message and
quite problematic [2]. The teaching approaches that have the corresponding line of the source code. BlueJ also
been proposed are several, but they have not been provides a visual debugger that allows the insertion of
thoroughly evaluated. The most important teaching breakpoints and step-by-step execution.
approaches that have been proposed are the following:
Lesson 3: Object interaction.
Lesson 4: Grouping objects in flexible size collections
(ArrayList), fixed size collections (array).
Lesson 5: Using class libraries.
Lesson 6: Testing and Debugging.
Lesson 7: Designing classes.
Lesson 8: Improving structure with inheritance.
Lesson 9: Polymorphism, overriding.
Lesson 10: Abstract classes and interfaces.
Lesson 11: Static methods: the main method.
Each laboratory session, started with a brief summary of
the concepts presented at the corresponding theory
session. Next, students solved in cooperation with the
instructor an assignment, which aimed at using the taught
Figure 1. The project manager window of BlueJ. concepts. A video projector was used for presenting and
discussing the various solutions suggested by students
and also their syntax, logical and semantic errors. Finally,
students carried out various assignments based on the
2.2 Using BlueJ in the Classroom
projects presented at the book. In the context of these
assignments students had to modify/extend the given
BlueJ and the series of lessons suggested by Kölling and
projects by adding fields, constructors and methods to
Barnes at their book "Objects First with Java: A practical
existing classes, and at some cases defining new classes.
introduction using BlueJ" [6] were used for teaching the
Students developed projects from scratch only at the last
compulsory one-semester course “Object-oriented Design
lessons.
and Programming” at the department of Technology
Management at the University of Macedonia. The aim of
the course is for the students to comprehend and be able 3. Teaching OOP with objectkarel
to use basic concepts of OOP. The course is taught in the
3rd semester, while students are taught the main concepts 3.1 The Main Features of objectKarel
of programming in the 2nd semester with C as a
programming language. In the final exams of the 2nd objectKarel ([4], [5]) is based on Karel++ [7] and uses a
semester course a high failure rate was recorded for the programming language closely related to C++ and Java.
specific group of students. The course of the 3rd semester objectKarel incorporates a series of lessons and activities
consisted of a weekly two-hour theory session and a for familiarizing students with OOP concepts before they
weekly two-hour laboratory session. are asked to implement them [8]. Students use a structure
In each theory session the instructor presented the editor for developing programs, so as to avoid focusing
corresponding concepts with the use of slides. on the syntax details of the programming language. The
Occasionally, the BlueJ environment was used for structure editor has the form of a menu that is
creating objects, invoking their methods and automatically updated when changes are made to classes,
presenting/discussing their result with students. All the and dialog boxes. The errors that can arise are very few
concepts were presented in the context of the projects that and they are presented at the bottom of the main window,
accompany the book of Kölling and Barnes. Some of while there is the ability of interaction between error
these projects consist of a large number (for students) of messages and the corresponding lines of source code.
classes, but not all of them were presented/studied. Students can run a program, trace through it with a speed
Specifically, for some of the classes only their role and/or defined by them or execute it step by step. Also,
part of their interface was presented to students and not objectKarel incorporates the technology of explanatory
their implementation. Copies of the projects’ source code visualization, which is the presentation of explanatory
or excerpts of the source code (commented by the messages in natural language about the semantics of the
instructor), UML class diagrams and object diagrams current statement.
were given to students in order to assist them in The actors of the microworld are robots that live in a
understanding the presented concepts and keeping notes world consisting of horizontal streets and vertical
for parts of the source code they faced difficulties with. avenues, wall sections and beepers, which are small
Eleven theory lessons and eleven laboratory lessons were plastic cones that emit a “beep” noise (see Figure 2). The
given. Approximately 45 students attended the lessons, class Primitive_Robot is the base class provided and
but 34 answered the final questionnaire. The content of contains:
each lesson can be summarized as follows: ƒ the fields street (street number), avenue
Lesson 1: Objects and classes, parameters. (avenue number), direction (the direction a
Lesson 2: Understanding class definitions.
robot is facing) and numOfBeepers (number of of the e-lessons that are incorporated in the programming
beepers in the robot’s bag), environment in order to teach the corresponding concepts.
ƒ the methods move (moves the robot to the next Next, students used the activities that are incorporated in
corner if front is clear), turnLeft (the robot turns the programming environment, and in some cases existing
left 90ο), putBeeper (the robot takes a beeper programs, so as to assimilate the concepts and become
from its bag and leaves it to its corner) and familiar with the features of the programming
pickBeeper (the robot takes a beeper from its environment. Finally, the students in groups of two
corner and places it to its bag). developed one or two programs without help from the
teacher. Students were not assigned any homework.

4. Comprehension of OOP Concepts in


BlueJ and objectkarel

One of the main goals of this paper is the comparative


presentation of some results of the two teachings. The
results are based on the detailed recording of students’
solutions and the analysis of their errors based on the
findings of subsequent studies and our own hypotheses.
At the end of both the series of lessons, students were
given a questionnaire with the same structure and
questions. This questionnaire was not given in the context
of the final exams of the course based on BlueJ or the
Figure 2. The main window of objectKarel. seminar based on objectKarel, but instead it was given in
the context of an activity that students participated in. We
Also, a class named Robot that extends the mention this fact in order to make clear that students
answered the questionnaire without having made any
Primitive_Robot class is available. This class
special preparation, revision or study – as is usually the
defines boolean methods, such as frontIsClear,
nextToABeeper & anyBeepersInBeeperBag, case in periods of exams. Furthermore, we would like to
mention that the BlueJ group was given 2 hours for the
that give robots the ability to check their own state and
test, while the objectKarel was given 1 hour. The most
the state of the microworld.
important goal of the questions and problems was to
compare the didactic effectiveness of the two
3.2 Using objectKarel in the Classroom environments. Since the introduction to OOP constitutes a
source of difficulties for most of the students, we
objectKarel was used for teaching the main concepts of considered as an important factor students’ errors. So, in
OOP to undergraduate students from the department of this section we present comparatively the difficulties,
Applied Informatics at the University of Macedonia in errors and the correct answers of students in the same
Greece. The students that participated in the empirical questions, that were posed to both groups, that is the
study had attended the 1st semester compulsory course group taught with the environment of BlueJ and the group
“Programming”, which is based on the procedural taught with the environment of οbjectKarel.
programming paradigm and uses Pascal as the Prior to presenting the comparative results, we must stress
programming language, and they had all failed in the out the didactic differences and similarities of the two
exams. series of lessons, so as to have a precise picture of these
Five lessons were given. Nineteen students attended the results.
lessons and answered the final questionnaire. The content (1) The BlueJ environment constitutes an Educational
of each lesson can be summarized as follows: Programming Environment, that is designed for helping
Lesson 1: Objects and classes. students in comprehending basic concepts of OOP, but is
Lesson 2: Inheritance. also a relatively open environment that practically allows
Lesson 3: Polymorphism and overriding. the solution of any problem. On the other hand, the
Lesson 4: Conditional structures. objectKarel environment constitutes a didactically
Lesson 5: Repetitive structures. minimalistic microworld, since it refers to virtual robots
All the lessons were carried out at the laboratory, and the moving on a world of crisscrossing streets and avenues.
programming environment was used as the medium of (2) The lessons carried out with the environment of BlueJ
instruction - occasionally the blackboard was used too. were 11 (2 hour lecture and 2 hour lab each) and the total
The lessons took place weekly, and their duration was 2 duration 44 hours, while the lessons carried out with the
hours each. In each one of the lessons we used the theory environment of objectΚarel were 5 (2 hours each) and the
total duration 10 hours. Furthermore, their content was at identical, and from them: (i) only 38% gave a correct and
a high degree analogous (objects, classes, inheritance), justified answer, most of which stated that “the class
but not the same. However, the basic concepts examined creates the objects”; (ii) 6% of the students (2 students)
in this paper were taught in the very first lessons in both justified their answer based on the way of creating an
teachings. object with BlueJ, and specifically they stated that “by
(3) The audience of the two series of lessons was not the right-clicking on a class we can create objects”; (iii) 9%
same, neither in number nor in background. The students of the students (3 students) justified their answer by
that participated in the lessons with objectKarel were writing that “objects are categorized in classes”. The rest
volunteer students that had attended a compulsory 29% of the students answered that the two concepts are
“Introduction to Procedural Programming” course at a not identical but they gave a completely wrong or
Department of Applied Informatics, and had all failed in insufficient explanation.
the exams. On the contrast, teaching OOP with BlueJ took
place in the context of a typical teaching at the 3rd Conclusions
semester at a Department of Technology Management. The results of the studies based on objectKarel and BlueJ
Both teachings were designed from the same research were not the same. Specifically, the misconception
team and the instructor is a member of this team. recorded by Holland et al. [9] was not confirmed for the
(4) The selection of questions and problems that were objectKarel group, since 95% of the students
suggested to students was made having as criteria the differentiated between classes and their instances and
concepts of OOP that seem to represent the main sources gave a correct explanation for their answer. On the other
of difficulties for novices ([2], [9], [10]). These concepts hand, 47% of the BlueJ group seems to face difficulties,
are objects, classes, inheritance, polymorphism and since 18% did not answer at all and 29% of them gave a
overriding. However, due to space limitations we present wrong or insufficient explanation.
the results that refer to the most basic concepts of OOP,
which are objects and classes. For each question that is Question 2: Is it possible for the way that an object
examined comparatively in the two environments, we responds to a message (or in other words the way that an
remind some basic findings recorded in the literature, object executes a method) to alter depending on the state
present the relevant results from our study and draw on of the object; Justify your answer.
some conclusions.
Literature review
Question 1: Are the concepts “class” and “object” Holland et al. [9] state that “students may fail to realize
identical? Justify your answer. that the behavior of some objects may alter substantially
depending on their state” (pp. 132), if the examples that
Literature review are used “overemphasize the data aspects of objects at the
Experience has shown that students often confuse the expense of the behavioral aspect”. Of course, our
concepts class and object. However, the results of studies hypothesis was that the misconception that “objects are
reported in the literature are not consistent. Holland et al. simple records” would not be recorded in our studies,
[9], in contrast with Carter and Fowler [10], state that since: (i) both the language and the environment of
some students confuse the two concepts and cannot objectKarel emphasize the behavioral aspect of objects;
differentiate between classes and their instances. The (ii) the projects used in the BlueJ study, that is the
problem is more intense when the teacher uses examples projects described in the book "Objects First with Java: A
that use just one instance of each class. practical introduction using BlueJ" [6], are well-designed
and do not treat objects as database records.
objectKarel group
All the students of the objectKarel group answered this objectKarel group
question. Specifically, 95% of the students answered that This question was answered by 95% of the students of the
the concepts class and object are not identical. A objectKarel group. All these students justified their
significant number of students included in their answers answers by using examples from the microworld of
that “a class defines the properties and the behavior of objects. For example, they described how a robot
objects that come from it”, as well as that “a class responds to the message putBeeper in the case that it
contains methods, which are executed by the objects that has a beeper in its bag and in the case that it does not.
belong to it”. Some students included in their answers
that “an object is an instance of a class”, and that “a BlueJ group
class defines the capabilities of an object”. The 2nd question was not answered by 29% of the
students of the BlueJ group. 24% of the students
BlueJ group answered correctly and provided the following
The first question was not answered by 18% of the explanation for their answer: “depending on the values of
students of the BlueJ group. The rest 82% of the students an object’s fields the way that a method is executed might
answered that the concepts class and object are not be different”. The rest 12% answered correctly but gave a
wrong explanation, while 35% of the students gave a comprehend that work in messages/methods is
wrong answer. Generally, the justification of the answer accomplished with method passing. On the other hand,
(either correct or wrong) did not include an example. only 47% of the students of the BlueJ group gave a
correct answer, but even from these students only 26%
Conclusions gave a full answer (including a correct example).
As expected, due to the assignments and the programming However, we cannot claim that half the students of the
environment of objectKarel, the misconception that BlueJ group have acquired the specific misconception,
“objects are simple records” and as a consequence they since 41% did not answer at all.
respond to a message always in the same way
independently of their state [9], was not confirmed. Question 4: Can a method change the state of the object
However, our hypothesis was not confirmed for the BlueJ that executes it? Give an example.
group too. Specifically, the misconception mentioned
above was recorded in the answers of many students. Literature review
Only 24% of the students gave a full answer and 12% See above the sub-section “Literature review” of Question
answered correctly but gave wrong explanation. 3.

Question 3: Can we send more messages to an object objectKarel group


through a single message; Give an example. The fourth question was answered by all the students of
the objectKarel group, with just one exception. All the
Literature review students answered that a method can change the state of
The third and fourth question were motivated by the an object that executes it and most of them gave as
misconception that “work in methods is exclusively done example how the state of the robots of the base class
by assignment (and not by message passing)” (pp. 132), changes when it executes the five methods of this class.
recorded by Holland et al. [9]. Of course, this BlueJ group
misconception suggests that students comprehend that the This question was not answered by 59% of the students of
state of an object can change when it executes a method, the BlueJ group. 26% of the students answered correctly
but they have the impression that this is accomplished and gave various examples based, mainly, on the projects
with assignment rather than method passing. However, that were discussed in the lessons. Another 6% anwsered
besides checking if this misconception is confirmed we correctly but did not give an example and finally 9% gave
also wanted to test to what degree students comprehend a wrong answer.
that the execution of a method may alter the state of an
object (question 4). Conclusions
Although this question seems simple enough and one
objectKarel group would expect that all, or at least nearly all, the students
All the students of the objectKarel group answered this would answer this question correctly this was not the case
question correctly. The example that was used by most of for the BlueJ group. The fact that the majority of students
the students was passing the message turnLeft (which (59%) in the BlueJ group did not answer this question at
is a member of the base class) three times through the all – even without justification – clearly shows that
message turnRight (which is a message defined by students face difficulties. On the other hand, the
students in a subclass defined in the 2nd lesson and used in objectKarel group seems to have fully comprehended the
many problems). relation between an object’s state and method execution.

BlueJ group
The third question was not answered by 41% of the BlueJ 5. CONCLUSIONS
group. The rest 26% of the students answered correctly,
12% answered correctly but did not give an example, and
9% answered correctly but gave as an example either the In this paper, we tried to examine the differences that
call of internal and external calls or an incorrect piece of were observed in the comprehension of basic OOP
code that was copied from question 5. Finally, 3% gave a concepts by the students that participated in two teachings
wrong answer. based on the widespread programming environment BlueJ
[3] and the programming microworld objectKarel
Conclusions respectively. The study was based on the analysis
The misconception that “work in methods is exclusively (quantitative and qualitative) of students’ answers in the
done by assignment (and not by message passing)” [9] same (adjusted where it was necessary) questionnaire that
was not confirmed for the objectKarel group. This result was given to both groups, after the end of the lessons. The
was expected, since with the specific programming research group that designed the lessons and the instructor
language and the visual step-by-step execution of that participated in both teachings were the same.
programs, it would be very difficult for students not to
Furthermore, the concepts that we examine were taught at analysis give us the chance to redesign the introductory
the beginning of both series of lessons. courses more synthetically, since the best didactic strategy
The most important finding was that a significant seems to be the gradual use of both environments, so as to
deviation was observed in the answers given by the two make use of the advantages of both environments, a
groups of students. In all cases that such a significant teaching that we plan to carry out the next semester.
difference was observed, the students taught with In conclusion, the comparative study that is referred in the
objectKarel answered in a much more correct way. The title seems to show that the combined use of the two
students that attended the lessons with objectKarel [11] environments might constitute a better didactic strategy
answered with greater frequency (the number of questions from just using one of the two environments.
that was not answered was smaller), gave more correct
answers and provided better justifications. Also, Acknowledgments
significant deviations were observed in comparison with “Pythagoras II – Funding of research groups in the
findings of older studies. University of Macedonia”, Priority Action 2.2.3e, Action
These differences are attributed, mainly, to the way the 2.2.3, Measure 2.2, to be implemented within the
two environments function, and of course the nature of framework of the Operational Programme “Education and
the programming language. objectKarel aims mainly at a Initial Vocational Training II” (EPEAEK) and co-
“basic” understanding of concepts, a comprehension of financed by the European Union [3rd Community Support
how each concept is defined and used, while BlueJ aims Framework, 75% financed by the European Social Fund,
more at an understanding of the object-oriented design of 25% national resources]
a solution to a problem, that is a “functional”
comprehension of the basic OOP tools. So, while the References
students of the objectKarel group programmed various [1] Brilliant, S. & Wiseman, T. R. The First Programming
robots from the first lessons and studied their behavior in Paradigm and Language Dilemma, ACM SIGCSE
relation to the source code, the students of the BlueJ Bulletin, Vol. 28, Issue 1, 1996, 338-342.
group had the chance to study the structure/design of [2] Milne, I., & Rowe, G., Difficulties in Learning and
relatively big programs that make clear the advantages of Teaching Programming - Views of Students and Tutors.
ΟΟΡ, but did not program with the frequency that their International Journal of Education and Information
colleagues did with objectKarel. Another important factor Technologies, 7(1), 2002, Kluwer Academic Publishers,
for the differences observed in the answers of the two 55-66.
groups lies in the fact that objectKarel offers a clearer [3] Kölling, M., Quig, B., Patterson, A., and Rosenberg, J.
depiction of the OOP concepts examined, which makes it The BlueJ system and its pedagogy. Journal of Computer
easier for students to comprehend them and be more Science Education, 13(4), 2003, 249-268.
confident about their knowledge. For example, when a [4] Xinogalos, S. Educational Technology: a Didactic
message is sent to an object: (1) in objectKarel students - Microworld for an Introduction to OOP. Ph.D. Thesis,
without having to do anything- see on their screen that its University of Macedonia, Thessaloniki, Greece, 2002.
state changes and furthermore an explanation message is [5] objectKarel, available at:
presented; (2) in BlueJ students –in most cases- have to http://www.csis.pace.edu/~bergin/temp/findkarel.html
use the inspect function and keep track of the changes in [6] Barnes, D., and Kölling, M. Objects First with Java: A
the object’s state that is usually not depicted. practical introduction using BlueJ. 2004, Prentice Hall.
Moreover, an implicit conclusion is that a better design [7] Bergin, J., Stehlik, M., Roberts, J., and Pattis, R.
and analysis of the teachings is acquired. For example, the Karel++ - A Gentle Introduction to the Art of Object-
comprehension of a concept should not be considered as a Oriented Programming. 1997, John Wiley & Sons.
one-way street. The students taught with BlueJ applied in [8] Xinogalos, S., and Satratzemi, M. The Hands-on
a correct way the main principles of ΟΟΡ during the Activities of the Programming Microworld objectKarel,
lessons – consequently someone could assume that they ACM SIGCSE Bulletin, Vol. 37, Number 3, September
have comprehended basic concepts. However, the same 2005, 384.
students appeared to have - at some degree - an inability [9] Holland, S. Griffiths, R., and Woodman, M. Avoiding
to answer correctly and fully the corresponding questions object misconceptions, ACM SIGCSE Bulletin, Vol. 29,
at the end of the lessons. Furthermore, it is not sure that No. 1, 1997, 131-134.
the same students would be able to solve problems that [10] Carter, J., and Fowler, A. Object Oriented Students?
demand the use of these concepts. Consequently, the SIGCSE Bulletin, Vol. 28, No. 3, 1998, 271.
comprehension of a concept by students seems to be [11] Xinogalos, S., Satratzemi, M. and Dagdilelis, V. An
multilevel. introduction to object-oriented programming with a
The differences that were observed in relation to the didactic microworld: objectKarel, Computers &
findings of older studies, suggest that it is possible to Education, Volume 47, Issue 2, September 2006, 148-
overcome the corresponding difficulties with the 171.
appropriate adjustment of teaching. The findings of this

You might also like