Teaching Python Programming to Novices: Addressing Misconceptions and Creating a Development Environment

Teaching Python Programming to Novices: Addressing Misconceptions and Creating a Development Environment

Research Collection Doctoral Thesis Teaching Python Programming to Novices: Addressing Misconceptions and Creating a Development Environment Author(s): Kohn, Tobias Publication Date: 2017 Permanent Link: https://doi.org/10.3929/ethz-a-010871088 Rights / License: In Copyright - Non-Commercial Use Permitted This page was generated automatically upon download from the ETH Zurich Research Collection. For more information please consult the Terms of use. ETH Library DISS. ETH NO. 24076 Teaching Python Programming to Novices: Addressing Misconceptions and Creating a Development Environment A thesis submitted to attain the degree of DOCTOR OF SCIENCES of ETH ZURICH (Dr. sc. ETH Zurich) presented by Tobias Kohn Dipl. Math, ETH Zurich born on January 31, 1982 citizen of Endingen (AG) accepted on the recommendation of Prof. Dr. Juraj Hromkoviˇc, examiner Prof. Dr. Bill Manaris, co-examiner Prof. Dr. Thomas R. Gross, co-examiner Prof. Dr. Jürg Gutknecht, co-examiner 2017 Für Sarah Abstract One of the great challenges in teaching to program is to help students understand how pro- gramming actually works. Students unavoidably develop misconceptions during their learning process, which must be corrected through skillful feedback. Such misconceptions reach from rather simple syntactical problems to deep underlying misunderstandings about what a compu- tational machine is, and how it works. With the objective to assist the students in developing correct mental models, we must understand these misconceptions, and how to correct them. An example of a misconception about the syntax is the well-documented problem that the assignment operator is believed to be symmetric, i. e., 2 = x is seen as equivalent to x = 2. At the other end of the spectrum, we find fundamental misconceptions about the computational machine itself. One such misconception is to apply a model of mathematical procedure to the computational machine, and thereby attribute algebraic capabilities to the machine. This is evidenced by the belief that the statement y = 2*x establishes a link between the two variables x and y, so that any change of x is subsequently also reflected by y. The primary and foremost means to detect misconceptions is through careful analysis of the students’ mistakes and errors. While some errors lead to syntactically incorrect programs, which are not even accepted by the computer, and therefore quickly recognized, other errors show themselved in incorrect outputs once the program is run. However, the main question to answer is: what can we infer about a student’s mental models and misconceptions from his or her errors? This dissertation investigates the errors of novice programming students in high school. In particular, it provides evidence that some students apply a model of mathematical substitution when reasoning about variables in a program. This misconception is relevant as it directly per- tains the sequential nature and data abstraction as employed in imperative computer program- ming; in fact, variables are a core concept in imperative programming. However, the dissertation also proposes a teaching method to specifically overcome this misconception by carefully ad- dressing it in the classroom. Preliminary results are promising, and indicate that such dedicated teaching might indeed be effective. During a period of five years, we have collected erroneous program of novice programming high school students. Based on this collection, the dissertation includes a list of common stu- dent errors. While there are several such collections of student errors already available, this PhD-Thesis, Tobias Kohn, 2017 vi dissertation provides the first collection based on the programming language Python. Python has recently become a popular programming language for introductory courses. At the same time, it differs significantly from more traditional programming languages such as Java, in both syntax and execution model. Hence, many previously documented errors do not apply equally to Python. Finally, the dissertation describes a parser for Python programs, capable of recognizing var- ious error patterns, as documented in the collection of student errors. The parser has been implemented as part of the educational Python environment “TigerJython”, which has already found widespread use. Moreover, with the possibility to discern different errors more accurately than what traditional Python environments provide, future research can study the relationships between the observed errors and the underlying misconception of students in more detail. PhD-Thesis, Tobias Kohn, 2017 Zusammenfassung Eine der grossen Herausforderungen im Programmierunterricht besteht darin, in den Lernen- den das Verständnis zu fördern, wie Programmieren tatsächlich funktioniert. Während ihres Lernprozesses machen Schüler und Studenten unweigerlich Fehler und entwickeln Fehlvorstel- lungen, die durch gezielte Rückmeldungen korrigiert werden müssen. Diese Fehlvorstellungen reichen von einfachen syntaktischen Problemen bis hin zu einem tief liegenden Misverständnis darüber, was eine Rechenmaschine eigentlich ist und wie sie funktioniert. Mit dem Ziel, die Ler- nenden bei der Entwicklung korrekter mentaler Modelle zu unterstützen müssen wie ihre Fehler und Fehlvorstellungen untersuchen und studieren, wie sie korrigiert werden können. Ein bekanntes Beispiel für eine syntaktische Fehlvorstellung liegt im Glauben, der Zuweisung- soperator sei symmetrisch. Die beiden Varianten x = 2 und 2 = x werden also als äquivalent angesehen. Auf der anderen Seite des Spektrums finden wir grundlegende Fehlvorstellungen über die Rechenmaschine selbst. Zum Beispiel tendieren einige Lernende dazu, ihr mathema- tisches Vorwissen auf die Rechenmaschine zu übertragen und gehen dann davon aus, dass die Maschine algebraische Fähigkeiten besitzt. Die Anweisung y = 2*x wird dann so verstanden, dass sie die beiden Variablen x und y fest miteinander verknüpft. Wenn wir später also den Wert von x ändern, dann würde diese Änderung auch sofort im Wert von y sichtbar. Das wichtigste Mittel, um Fehlvorstellungen zu erkennen und zu untersuchen, ist eine sorgfältige Analyse der Fehler, die Schüler und Studenten machen. Während einige Fehler zu syntaktisch falschen Programmen führen, die schon vom Computer abgelehnt werden und daher einfach zu erkennen sind, äussern sich andere Fehler erst in den falschen Ausgaben, wenn das Programm ausgeführt wird. Die Hauptfrage ist aber in jedem Fall: Was für Schlüsse können wir aus den beobachteten Fehlern ziehen, um die mentalen Modelle und Fehlvorstellungen der Lernenden zu verstehen? Die vorliegende Dissertation untersucht die Fehler von Schülerinnen und Schülern im Gym- nasium, die einen Anfängerkurs in der Programmierung besuchen. Dabei präsentieren wir vor allem auch Indizien dafür, dass einige der Schüler ein Modell der mathematischen Substitution auf das Programmieren anwenden, wenn es darum geht, das Verhalten von Variablen im Pro- gramm zu erklären. Das ist insofern relevant, weil Variablen ein Kernkonzept der imperativen Programmierung darstellen. Tatsächlich hängen die Fehlvorstellungen der Schüler direkt mit PhD-Thesis, Tobias Kohn, 2017 viii der sequentiellen Natur und der Datenabstraktion zusammen, zwei essentiellen Begriffen für die Programmierung. Die Dissertation stellt aber auch einen Ansatz vor, um diese Fehlvorstellungen in der Klasse zu korrigieren, indem das Problem bewusst und gezielt angegangen wird. Erste Ergebnisse dazu sind vielversprechend. Während fünf Jahren haben wir eine Sammlung an fehlerhaften Programmen von Gym- nasialschülern angelegt. Basierend auf dieser Sammlung enthält die Dissertation auch eine Liste mit häufigeren Fehlern. Natürlich gibt es bereits einige solche Listen und Zusammenstellun- gen, allerdings präsentieren wir die erste Liste zur Programmiersprache Python. Python erfreut sich zur Zeit wachsender Beliebtheit als Anfängersprache. Gleichzeitig unterscheidet sich Python aber auch relativ stark von traditionelleren Sprachen wie Java, und zwar sowohl in der Syntax als auch im Ausführungsmodell. Entsprechend lassen sich viele frühere Ergebnisse nicht einfach übertragen. Schliesslich stellt diese Dissertation auch einen Parser für Python vor, der eine ganze Reihe von Fehlern erkennt, die zuvor dokumentiert wurden. Dieser Parser ist bereits Teil der Python- Umgebung “TigerJython” für den Unterricht, die relativ weit verbreitet ist und vielfältig einge- setzt wird. Darüber hinaus ermöglicht die systematische Erkennung von Fehlern aber ach zukün- ftige Forschung, insbesondere das Studium der Beziehungen zwischen den beobachteten Fehlern und den tatsächlich zugrunde liegenden Fehlvorstellungen. PhD-Thesis, Tobias Kohn, 2017 Acknowledgments Apart from the scientific results, the writing of this dissertation has brought me in contact with many great people. I feel a deep gratitude for all the opportunities, the support, and the friend- ship I have received during this time, and I would like to express my highest appreciation. In particular, I would like to thank the following people. When I first approached Profs. Juraj Hromkoviˇc and Jürg Gutknecht with my ideas for this dissertation, I quickly found their full endorsement. I am most grateful for their extensive sup- port, their trust and skillful advice. Both allowed me to always pursue my own ideas, and learn from my own mistakes, while still guiding and assisting me when necessary. In addition, Prof. Thomas R. Gross has supported and guided me in my studies of parsing technologies. Moreover, he provided

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    166 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us