• Keine Ergebnisse gefunden

Measuring program comprehension with functional magnetic resonance imaging

N/A
N/A
Protected

Academic year: 2022

Aktie "Measuring program comprehension with functional magnetic resonance imaging"

Copied!
2
0
0

Wird geladen.... (Jetzt Volltext ansehen)

Volltext

(1)

Measuring Program Comprehension with Functional Magnetic Resonance Imaging

Janet Siegmundπ, Sven Apelπ, Christian K¨astnerω, Chris Parninβ, Anja Bethmannθ, Gunter Saakeσ, Thomas Leichδ, and Andr´e Brechmannθ

πUniversity of Passau ωCarnegie Mellon University βNorth Carolina State University

θLeibniz Inst. for Neurobiology σUniversity of Magdeburg δMetop Research Institute

Abstract:We observed program comprehension with functional magnetic resonance imaging and found activation in brain areas related to working memory, divided atten- tion, problem solving, and language processing.

Programmers spend significant time comprehending source code everyday, so naturally, decades of research have been devoted to understanding and improving program compre- hension. However, this research has still not completely unraveled what happens inside programmers’ heads when they work with source code. The problem is that program comprehension is an internal cognitive process that inherently eludes measurement. To shed light on this issue, we explored the feasibility of using functional magnetic resonance imaging (fMRI), which has proved successful in cognitive neuroscience to understand cognitive processes in more depth.

fMRI measures and locates change of the oxygen level in the blood, which is an indicator for activation. To filter irrelevant activation that is not specific to program comprehension (e.g., visual perception of source code), fMRI measurement requires a control condition that does not require program comprehension. Then, the difference in activation between program comprehension and the control condition describes the brain areas that are spe- cific for program comprehension.

We performed our study as outlined in Figure 1 and described it in more detail in the cor- responding publication [SKA+14]. We designed twelve source-code snippets of similar length and difficulty (e.g., reversing a word, computing the cross sum of a given number;

see project’s website attinyurl.com/ProgramComprehensionAndfMRI/for all snippets), which we evaluated in pilot studies [SBA+12]. We asked participants to deter- mine the output of each source-code snippet. We obfuscated identifier names, so that they do not give a hint about a snippet’s purpose. As control condition, we introduced syntax errors into the twelve code snippets and asked participants to locate them. As participants, we recruited computer-science students with a similar level of programming experience (as determined by our questionnaire [SKL+14]). A trial consisted of a comprehension task and a syntax task (different snippets), each followed by a resting condition to let the oxygen level return to a baseline. Overall, the experiment consisted of twelve trials.

As a result of our experiment, we observed a clear activation pattern of five different brain areas located in the left hemisphere(see Figure 1(c)), which are associated with different cognitive processes: language comprehension, working memory, problem solving, and di-

63

(2)

Mirror Screen

Head coil

BA21

BA6 BA40

BA47 BA44

while ….

That‘s a loop...

currValue = 1… 2… 4…

(a) Prestudy (b) fMRI measurement

(c) Activation pattern (d) Cognitive processes

(e) Other fMRI studies

(f) Interpretation for program comprehension

Figure 1: Workflow of our fMRI study.

vided attention. Thus, we can hypothesize that the following happened during program comprehension: Participants processed the words and symbols of the code snippets (lan- guage processing) and kept variable values in mind (working memory). At the same time (divided attention), they analyzed the effect of the words and symbols on the variable val- ues (problem solving). Hence, the activated brain areas and associated processes align well with our current understanding of program comprehension, backing up decades of program-comprehension research with first supporting evidence from neuro-imaging data.

The finding that all activated areas were located in the left hemisphere, however, suggests that processes related to language competences are most relevant.

Furthermore, our experiment demonstrates the feasibility of measuring program compre- hension with fMRI, and we hope that other researchers will follow us to eventually un- ravel the mysteries of programmers’ brains and to enrich the empirical basis for future software-engineering research, tools, and education. For more details on this work, we refer the reader to the paper ”Understanding Understanding Source Code with Functional Magnetic Resonance Imaging”, which was published at the International Conference on Software Engineering in 2014 [SKA+14].

References

[SBA+12] Janet Siegmund, Andr´e Brechmann, Sven Apel, Christian K¨astner, J¨org Liebig, Thomas Leich, and Gunter Saake. Toward Measuring Program Comprehension with Functional Magnetic Resonance Imaging. InFSE-NIER, pages 24:1–24:4. ACM, 2012.

[SKA+14] Janet Siegmund, Christian K¨astner, Sven Apel, Chris Parnin, Anja Bethmann, Thomas Leich, Gunter Saake, and Andr´e Brechmann. Understanding Understanding Source Code with Functional Magnetic Resonance Imaging. InICSE, pages 378–389, 2014.

[SKL+14] Janet Siegmund, Christian K¨astner, J¨org Liebig, Sven Apel, and Stefan Hanenberg.

Measuring and Modeling Programming Experience. EMSE, 19(5), 2014. Invited ar- ticle.

64

Referenzen

ÄHNLICHE DOKUMENTE

Percentage of current year earlywood vessel-elements connected to previous year latewood vessel-elements (A) and mean (±SD) flow (B) expressed as the proportion of axial flow in

Neuroimaging studies using the visual search paradigm to study the neural correlates of selective attention have reported activation in similar regions in the frontal (in

Abstract: Dichoptic stimuli (different stimuli displayed to each eye) are increasingly being used in functional brain imag- ing experiments using visual stimulation.. These

The most difficult issue in fMRI studies and most other studies that evaluate cognitive processes is to select suitable material and tasks (that is, source code in our case) and

As outlined in detail below (i) we demonstrate that variants of 5-HTTLPR/rs25531 genotype and different levels of neuroticism appear to be linked by rs-FC between amygdala

chapter 4: How does the complex consistency of brain tissue, consisting of coupled pools of protons (e.g., myelin water – free water), affect the outcome of the

Here, we demonstrate that, by remaining in the transient-state and relying on physical mod- eling of spin dynamics to optimally encode and reconstruct signals, it is possible

Physiological self-regulation of regional brain activity using real-time functional magnetic resonance imaging (fMRI): methodology and exemplary data. Temporal Autocorrelation