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 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 to 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, which 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.
翻译:随着软件日益渗透到我们职业和个人生活的各个领域,维护软件的需求以及程序员高效编写和理解程序代码的需求不断增长。在本项开创性研究中,我们通过分析注视相关电位,在生态效度良好的环境中探索令程序员困惑(但对计算机无碍)的程序代码模式(即所谓混淆原子)的在线加工过程及其背后的神经认知机制。相较于不含混淆原子的清晰程序代码,混淆代码会在首次注视混淆原子后约400至700毫秒诱发一个晚期的额叶正波。该额叶正波类似于自然语言加工过程中由句子语境中意外但合理的词语所诱发的事件相关电位成分。因此,我们认为大脑在面对程序代码和自然语言中的意外且富含信息的输入时,会调用相似的神经认知机制。在这两个领域中,此类输入会更新理解者的情境模型,这对于从快速展开的输入中提取信息至关重要。我们的研究结果对编程领域具有深远意义,并为软件工程与心理语言学的跨学科合作开辟了道路。