Using Roles of Variables to Enhance Novice's Debugging Work

Article excerpt

Introduction

Programming is a complex cognitive skill. Most students face a lot of new challenges in learning the basic skills required to design and implement even small programs. Several extensive inter national studies have confirmed this, not to speak of results that have been reported in dozens of studies--mostly of single courses--presented in computing education conferences. For example, Valentine (2004) surveyed and classified total of 444 papers published in SIGCSE Technical Symposium conferences in years 1984-2003, all of which were related to teaching introductory programming, including different teaching methods, tools, experiments, new kinds of assignments, etc. Extensive studies include the McCracken et al. (2001) working group research with 216 students in 4 universities. The results indicate an alarming number of failures in simple programs the students were requested to code. A few years later another study was carried out by Lister et al. (2004). In this case, the topic of investigation was the students' understanding of execution of simple programs. The results of 556 students from 12 institutions indicate that the students had severe problems understanding even the smallest of the code fragments. Thus, it seems that first and second year students have serious shortcomings in both reading and writing skills of programs. It is therefore not surprising that Tenenberg et al. (2005) found out in their study--concerning 21 institutions and 300 students--that students cannot design even simple programs after their introductory courses.

What makes learning to program so complex, and how should we tackle this problem in education? Obviously much of the complexity follows from the fact that programming includes many different types of tasks, including problem solving, conceptual analysis of problem domain, program design, detailed temporal time splitting of actions, developing and combining algorithms and data structures, understanding language issues--both syntax and semantics, writing program code, testing and finally debugging it. Mastering all of these requires a lot of training and experience, which cannot be acquired during a single introductory course. Moreover, programming requires thinking with abstract concepts, which is not easy for all novices.

du Boulay (1989) classified some of these challenges by identifying five different subfields of programming skill that a novice student has to learn to work effectively. Firstly, he must gain a general understanding in what programming is about and what computers can do. Secondly, he needs to understand the principles of how programs execute within a computer. du Boulay used a term notional machine, which means a general model of computer internals and program execution--including how memory is used for storing variables, how statements and procedures are executed etc. Thirdly, computer programs are written using programming languages, artificial formal notations. Each of these has its own syntax and semantics that must be understood. Fourthly, learning programming means acquiring a large set of schemas of how things--such as scanning an array of data to identify information, building a linked list or reading data from input source--are typically implemented. Knowledge of such schemas reduces the cognitive complexity of reading and writing programs, as the programmer can focus on composing larger chunks of code from smaller ones instead of thinking all the details simultaneously. Finally, programming requires practical skill--programmers need to know (and be able to use) special tools such as editors, compilers, profilers and debuggers for coding, compiling, testing and debugging programs.

Programming education has traditionally put a lot of effort in teaching the syntax of particular language. However, when recalling du Boulay's five subfields of programming skill, we note that issues concerning syntax mostly cover the last three areas, whereas the second one, understanding program execution, may easily be somewhat overlooked, or is at least less emphasized. …