Exploring faster ways to think like a software developer

Beginner and expert programmers think about code very differently while they program, an insight that can inform more tailored training.

A pair of studies have brought us closer to understanding how novice programmers, including students in introductory CSE courses like EECS 183, can achieve expert status more quickly. By first comparing patterns of brain activity in brand new coders and then testing two different training interventions, a team of researchers led by PhD student Madeline Endres and Prof. Westley Weimer demonstrated some key differences in how coders think as they gain experience – and how we might accelerate the change.

Recent use of neural imaging to study how different activities compare inside our brains has revealed a number of useful insights. Studies examining what reading or writing code looks like inside a person’s head has shown that the task has a good deal of overlap with both spatial reasoning – mentally manipulating 3D objects – and reading technical papers.

But to date, these studies have focused exclusively on the brains of software developers or students with years of coding experience.

“Our work uses brain imaging to understand what’s really going on in novices’ heads when they program,” says Endres. The goal of their first study, “Relating Reading, Visualization, and Coding for New Programmers: A Neuroimaging Study,” was to determine whether the overlap between these different activities occurred to the same extent in beginners as it does in people with more experience. 

A pattern emerged – the way beginners think about code has far more in common with spatial reasoning than it does reading, while the opposite is true for experts.

According to Endres, this finding could prove to be a key insight for designing pedagogical strategies tailored to new programmers.

“This finding has implications for developer training and pedagogy,” she says. The researchers propose one possible interpretation of the finding, although determining the specific ways these three skillsets intersect will require more experimentation. 

“Spatial skills may enable general problem solving for novices, but domain-specific programming strategies use more reading-associated cognitive processes,” Endres explains. “If this is true, directly training reading-based domain-specific strategies may help novices become experts faster.”

Endres, Weimer, and collaborators took a first step toward determining whether this training can be directly useful for novice coders. In a followup study, “To Read or to Rotate? Comparing the Effects of Technical Reading Training and Spatial Skills Training on Novice Programming Ability,” the team organized training sessions for reading and spatial reasoning skills and compared the outcomes for different novice programmers.

Figure of different brain scans
A study used neural imaging techniques to compare writing and reading code to both reading prose and mentally rotating 3D objects. Novice coders were found to have more overlap in brain activity between coding and rotation exercises, while experienced developers had more overlap with reading.

The reading training taught strategies for summarizing scientific papers and understanding scientific charts and figures; most of the covered readings were from computer science research papers accessible to students enrolled in their first CS classes. The spatial training made use of a standardized training curriculum previously found to improve programming skills by focusing on spatial ability (i.e., the ability to mentally manipulate objects).

Notably, neither type of training exercised the participants’ coding skills directly.

Aligning with the results of their previous neural imaging study, participants in the reading training went on to exhibit larger programming ability gains than those in the standard spatial training. In particular, the study found that reading-trained participants performed well on programming problems that require tracing through code.

Endres believes this type of work, designing non-programming based training that can positively impact developers, could be an important means to accelerate early programming education. 

“In general, understanding the cognitive basis for software engineering is important because it can help us understand the cause of observed effects,” she says, “and from this implement more effective policies and tools.”

Explore:
Research News; Westley Weimer