Abstract
Program comprehension is an important cognitive process that inherently eludes direct measurement. Thus, researchers are struggling with providing suitable programming languages, tools, or coding conventions to support developers in their everyday work. In this paper, we explore whether functional magnetic resonance imaging (fMRI), which is well established in cognitive neuroscience, is feasible to soundly measure program comprehension. In a controlled experiment, we observed 17 participants inside an fMRI scanner while they were comprehending short source-code snippets, which we contrasted with locating syntax errors. We found a clear, distinct activation pattern of five brain regions, which are related to working memory, attention, and language processing---all processes that fit well to our understanding of program comprehension. Our results encourage us and, hopefully, other researchers to use fMRI in future studies to measure program comprehension and, in the long run, answer questions, such as: Can we predict whether someone will be an excellent programmer? How effective are new languages and tools for program understanding? How should we train programmers?
Highlights
As the world becomes increasingly dependent on the billions lines of code written by software developers, little comfort can be taken in the fact that we still have no fundamental understanding of how developers understand source code.Understanding program comprehension is not limited to theory building, but can have real downstream effects in improving education, training, and the design and evaluation of tools and languages for programmers
A single study is not sufficient to answer general questions, we can raise some further probing questions: If program comprehension is linked to language comprehension, does learning and understanding a programming language require the same struggles and challenges as learning another spoken language? If program comprehension only activates the left hemisphere, can we derive guidelines on how to train students? Taking a broader perspective, our study demonstrates the feasibility of using functional magnetic resonance imaging (fMRI) experiments in software engineering
We show Talairach coordinates, the size of the cluster, related Brodmann areas, and relevant associated cognitive processes
Summary
Understanding program comprehension is not limited to theory building, but can have real downstream effects in improving education, training, and the design and evaluation of tools and languages for programmers. If direct measures of cognitive effort and difficulty could be obtained and correlated with programming activity, researchers could identify and quantify which types of activities, segments of code, or kinds of problem solving are troublesome or improved with the introduction of a new language or tool. Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. To republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee.
Submitted Version (Free)
Published Version
Talk to us
Join us for a 30 min session where you can share your feedback and ask us any queries you have