Our goal is to identify brain regions involved in comprehending computer programs. We use functional magnetic resonance imaging (fMRI) to investigate two candidate systems of brain regions which may support this -- the Multiple Demand (MD) system, known to respond to a range of cognitively demanding tasks, and the Language system (LS), known to primarily respond to language stimuli. We devise experiment conditions to isolate the act of code comprehension, and employ a state-of-the-art method to locate brain systems of interest. We administer these experiments in Python (24 participants) and Scratch Jr. (19 participants) - which provides a visual interface to programming, thus eliminating the effect of text in code comprehension. From this robust experiment setup, we find that the Language system is not consistently involved in code comprehension, while the MD is. Further, we find no other brain regions beyond those in the MD to be responsive to code. We also find that variable names, the control flow used in the program, and the types of operations performed do not affect brain responses. We discuss the implications of our findings on the software engineering and CS education communities.
翻译:我们的目标是识别参与理解计算机程序的大脑区域。我们采用功能性磁共振成像(fMRI)技术,考察两个可能支持此功能的候选脑区系统——多重需求(MD)系统(已知对一系列认知高负荷任务有响应)和语言系统(LS)(已知主要对语言刺激有响应)。我们设计了实验条件以隔离代码理解行为,并采用最先进的方法定位感兴趣的大脑系统。我们分别在Python(24名参与者)和Scratch Jr.(19名参与者)中进行了实验——后者提供可视化编程界面,从而消除了代码理解中文本的影响。通过这一稳健的实验设置,我们发现语言系统并非持续参与代码理解,而多重需求系统则持续参与其中。此外,除MD系统中的脑区外,未发现其他脑区对代码产生响应。我们还发现,变量名、程序中使用控制流以及所执行的操作类型均不影响大脑响应。我们讨论了这些发现对软件工程及计算机科学教育领域的启示。