Neo-Piagetian Preoperational Reasoning in a Novice Programmer

Work in Progress
Raymond Lister; Donna Teague

Using neo-Piagetian theory, Lister (2011) conjectured there were four main stages of cognitive development in the novice programmer, which are (from least mature to most mature):

Sensorimotor: The novice programmer cannot reliably manually execute a piece of code and determine the final values in the variables, due to both the well known novice misconceptions about language semantics and their inability to organize a written manual execution of the code.

Preoperational:Thenovicecanmanuallyexecutecodereliably,butstrugglesto“seetheforestfor the trees”. That is, the novice struggles to understand how several lines of code work together to perform some computational process. When trying to understand a piece of code, such novices tend to use an inductive approach. That is, they manually execute the code, perhaps more than once with differing initial values, and make an educated guess based on the input/output behaviour.

Concrete operational: The novice programmer is capable of deductive reasoning. That is, the novice can understand short pieces of code by simply reading the code, rather than executing the code with specific values. When reading code, they tend to reason in terms of constraints on the set of possible values that each variable may have. The concrete operational stage is the first stage at which novices can reason with abstractions of code, such as diagrams.

Formal Operational: As this most advanced stage does not figure in this paper, we refer the reader to Lister (2011) for a description of it.

It is well known that researchers since Piaget have conducted experiments that call into question aspects of his “classical” Piagetian theory. Neo-Piagetians have proposed modifications to address problematic aspects of the classical theory. One of the problematic aspects is the conception of stages. For example, in classical Piagetian theory, a person spends an extended period in one stage, before undergoing a rapid change to the next stage. This is commonly referred to as the “stair case metaphor”. Instead, some neo-Piagetian researchers have found evidence for the “overlapping wave” metaphor (e.g. Siegler, 1996), where a person exhibits a changing mix of reasoning strategies from the different Piagetian stages. Initially, the sensorimotor stage of reasoning is dominant, but its frequency of use declines as the use of preoperational styles of reasoning increases, and so on. Our think aloud data supports the overlapping wave model.

Corney et al. (2012) provided indirect evidence that novice programmers pass through the preoperational and concrete operational stages, by analyzing student answers to exam questions. They found that (a) within individual exam questions, there were students who could provide a preoperational answer but not a concrete operational answer, and (b) across exam questions, students tended to consistently provide either a preoperational answer or a concrete operational answer. However, such indirect evidence does not indicate the actual thought processes of a student.

In the study reported here, we had several volunteer students complete programming related tasks while "thinking aloud". We found direct evidence that students progress though these neo-Piagetian stages. We met approximately once each week with these students, so we could follow their progress over the course of a semester. In this abstract, we briefly describe a single think aloud session with one representative student, with the pseudonym "Donald". He is 22 years old, speaks English as his first language and at the time of the think aloud described below he was in his 9th week of semester.

In one exercise, Donald (and other participants) were asked to read the mix of python code and pseudocode shown below and then, in one sentence, “describe the purpose of that code”:

        if (y1 < y2):
           Code to swap the values in y1 and y2 goes here.
        if (y2 < y3):
           Code to swap the values in y2 and y3 goes here.
        if (y1 < y2):
           Code to swap the values in y1 and y2 goes here.

Donald (and some other participants) used the inductive approach of a novice at the preoperational stage. That is, Donald selected some initial values for the variables (y1 = 1, y2 = 2 and y3 = 3), manually executed the code with those values, and then inferred what the code did from the input/output behaviour. In his think aloud, Donald initially showed remnant attributes of the sensorimotor stage, as his first attempt at manual execution was unorthodox and poorly organised. After he gave up on that initial attempt, he then spontaneously adopted a more orthodox and better organised approach to manual execution, and quickly completed a correct manual execution. However, he then made an incorrect inductive inference, which led him to write the following incorrect answer: “To reverse the values stored in y1, y2 and y3 ...” The person conducting the think aloud (the first author) then provided Donald with alternate initial values for the variables (y1 = 2, y2 = 1 and y3 = 3). Donald then performed a successful manual execution with those values. On completing that execution, Donald exclaimed, “Oh! It’s ordering them ... um ... so, it’s more about, it’s not to rev ... hang on ... oh [indecipherable]... rather than to reverse, it would be to, place them from highest to lowest.” In summary, Donald manifested behaviour consistent with someone who, in terms of the overlapping wave metaphor, is transitioning from the sensorimotor stage being dominant to the preoperational stage being dominant. In this think aloud, he did not manifest concrete operational reasoning. Elsewhere (Teague et al., 2013), we have described think aloud sessions where students do manifest more sophisticated modes of reasoning than Donald exhibited.

Our think aloud study has pedagogical implications. From the earliest lessons, the traditional approach to teaching programming places heavy emphasis on code writing and code design. In so doing, the traditional approach effectively skips across the sensorimotor and preoperational stages and assumes that all students can immediately reason about code at the concrete operational stage. Our think aloud with Donald, and think alouds with other students, suggests that the traditional approach skips too quickly across the sensorimotor and preoperational stages. 

Type of Publication: Paper
Conference: PPIG WIP Workshop 2013
Publication Year: 2013
Paper #: 2
TitleNeo-Piagetian Preoperational Reasoning in a Novice Programmer
Publication TypePaper
AuthorsLister, R, Teague, D
PPIG Workshop: 
2013-07-WIP