Unexpected but informative: What fixation-related potentials tell us about the processing of confusing program code
Preprint
- 6 June 2025
- preprint
- Published by Springer Nature in Research Square
Abstract
As software pervades more and more areas of our professional and personal lives, there is an ever-increasing need to maintain software, and for programmers to be able to efficiently write and understand program code. In the first study of its kind, we analyze fixation-related potentials (FRPs) to explore the online processing of program code patterns that are confusing to programmers, but not the computer (so-called atoms of confusion), and their underlying neurocognitive mechanisms in an ecologically valid setting. Relative to clean counterparts in program code without an atom of confusion, confusing code elicits a late frontal positivity of about 400 to 700 ms after first looking at the atom of confusion. This frontal positivity resembles an event-related potential (ERP) component found during natural language processing that is elicited by unexpected but plausible words in sentence context. Thus, we suggest that the brain engages similar neurocognitive mechanisms in response to unexpected and informative inputs in program code and in natural language. In both domains, these inputs update a comprehender’s situation model that is essential for information extraction from a quickly unfolding input. Our results have far-reaching implications for programming and pave the way for interdisciplinary collaborations between software engineering and psycholinguistics.Keywords
All Related Versions
This publication has 42 references indexed in Scilit:
- Do developer perceptions have borders? Comparing C code responses across continentsSoftware Quality Journal, 2023
- Benefits and costs of predictive processing: How sentential constraint and word expectedness affect memory formationBrain Research, 2022
- An investigation of misunderstanding code patterns in C open-source software projectsEmpirical Software Engineering, 2018
- Cognitive control ability mediates prediction costs in monolinguals and bilingualsCognition, 2018
- The role of the insula in intuitive expert bug detection in computer code: an fMRI studyBrain Imaging and Behavior, 2018
- Measuring and modeling programming experienceEmpirical Software Engineering, 2013
- Welcome to the real world: Validating fixation-related brain potentials for ecologically valid settingsBrain Research, 2007
- P600 related to rule violation in an arithmetic taskCognitive Brain Research, 2004
- Event-related brain potentials elicited by syntactic anomalyJournal of Memory and Language, 1992
- The assessment and analysis of handedness: The Edinburgh inventoryNeuropsychologia, 1971