Example: dental hygienist

Understanding Understanding Source Code with …

Understanding Understanding Source Code withFunctional magnetic resonance ImagingJanet Siegmund , Christian K stner , Sven Apel , Chris Parnin , Anja Bethmann ,Thomas Leich , Gunter Saake , and Andr Brechmann University of Passau, Germany Carnegie Mellon University, USA Georgia Institute of Technology, USA Leibniz Inst. for Neurobiology Magdeburg, Germany Metop Research Institute, Magdeburg, Germany University of Magdeburg, GermanyABSTRACTP rogram comprehension is an important cognitive process that in-herently eludes direct measurement. Thus, researchers are strug-gling with providing suitable programming languages, tools, orcoding conventions to support developers in their everyday this paper, we explore whetherfunctional magnetic resonanceimaging (fMRI), which is well established in cognitive neuroscience,is feasible to soundly measure program comprehension. In a con-trolled experiment, we observed 17 participants inside an fMRIscanner while they were comprehending short Source -code snip-pets, which we contrasted with locating syntax errors.

method is functional magnetic resonance imaging (fMRI), a non-invasive means of measuring blood-oxygenation levels that change as a result of localized brain activity. In this paper, we report on results and experience from applying fMRI in a program-comprehension experiment. While our experi- ment is a first step toward measuring …

Tags:

  Functional, Imaging, Magnetic, Resonance, Functional magnetic resonance imaging

Information

Domain:

Source:

Link to this page:

Please notify us if you found a problem with this document:

Other abuse

Advertisement

Transcription of Understanding Understanding Source Code with …

1 Understanding Understanding Source Code withFunctional magnetic resonance ImagingJanet Siegmund , Christian K stner , Sven Apel , Chris Parnin , Anja Bethmann ,Thomas Leich , Gunter Saake , and Andr Brechmann University of Passau, Germany Carnegie Mellon University, USA Georgia Institute of Technology, USA Leibniz Inst. for Neurobiology Magdeburg, Germany Metop Research Institute, Magdeburg, Germany University of Magdeburg, GermanyABSTRACTP rogram comprehension is an important cognitive process that in-herently eludes direct measurement. Thus, researchers are strug-gling with providing suitable programming languages, tools, orcoding conventions to support developers in their everyday this paper, we explore whetherfunctional magnetic resonanceimaging (fMRI), which is well established in cognitive neuroscience,is feasible to soundly measure program comprehension. In a con-trolled experiment, we observed 17 participants inside an fMRIscanner while they were comprehending short Source -code snip-pets, which we contrasted with locating syntax errors.

2 We found aclear, distinct activation pattern of five brain regions, which are re-lated to working memory, attention, and language processing allprocesses that fit well to our Understanding of program comprehen-sion. Our results encourage us and, hopefully, other researchers touse fMRI in future studies to measure program comprehension and,in the long run, answer questions, such as: Can we predict whethersomeone will be an excellent programmer? How effective are newlanguages and tools for program Understanding ? How should wetrain programmers?Categories and Subject [Information Systems]: User/Machine SystemsGeneral TermsExperimentation, human factorsKeywordsFunctional magnetic resonance imaging , program comprehension1. INTRODUCTIONAs the world becomes increasingly dependent on the billionslines of code written by software developers, little comfort can betaken in the fact that we still have no fundamental Understanding ofhow programmers understand Source program comprehension is not limited to theorybuilding, but can have real downstream effects in improving educa-tion, training, and the design and evaluation of tools and languages This author published previous work as Janet to make digital or hard copies of all or part of this work forpersonal or classroom use is granted without fee provided that copies arenot made or distributed for profit or commercial advantage and that copiesbear this notice and the full citation on the first page.

3 To copy otherwise, torepublish, to post on servers or to redistribute to lists, requires prior specificpermission and/or a 14, May 31 June 7, 2014, Hyderabad, IndiaCopyright 14 ACM 978-1-4503-2756-5/14/05 ..$ Screen Head coil while .. That s a currValue = (a) Prestudy(b) fMRI measurement(c) Activation pattern(d) Cognitive proc.(e) Other fMRI studies(f) Interpretation forprogram comprehensionFigure 1: Workflow of our fMRI programmers. If direct measures of cognitive effort and diffi-culty could be obtained and correlated with programming activity,then researchers could identify and quantify which types of activi-ties, segments of code, or kinds of problem solving are troublesomeor improved with the introduction of a new language or studying programmers, decades of psychological and observa-tional experiments have relied on indirect techniques, such as com-paring task performance or having programmers articulate theirthoughts in think-aloud protocols. Each method, when skillfullyapplied, can yield important insights.

4 However, these commontechniques are not without problems. In human studies of program-ming, individual [13] and task variance [19] in performance oftenmask any significant effects hoping to be found when evaluating,say, a new tool. Think-aloud protocols and surveys rely on self-reporting and require considerable manual transcription and analy-sis that garner valuable but indefinite and inconsistent the past few decades, psychologists and cognitive neurosci-entists have collectively embraced methods that measure physio-logical correlates of cognition as a standard practice. One suchmethod isfunctional magnetic resonance imaging (fMRI), a non-invasive means of measuring blood-oxygenation levels that changeas a result of localized brain this paper, we report on results and experience from applyingfMRI in a program-comprehension experiment. While our experi-ment is a first step toward measuring program comprehension withfMRI, and as such inherently limited, we believe it illuminates apath for future studies that systematically explore hypotheses andthat will help to build stronger theories of program our experiment, 17 participants performed two kinds of tasksinside an fMRI scanner.

5 In the first kind, referred to ascomprehen-sion tasks, developers comprehended code snippets and identifiedthe program s output. In the second kind, referred to assyntaxtasks, developers identified syntax errors in code snippets, whichis similar to the comprehension tasks, but does not require actualunderstanding of the program. As a result of our study, we found: evidence that distinct cognitive processes took place whenperforming the comprehension tasks, activation of functional areas related to working memory, at-tention, and language comprehension, and a left-hemisphere results provide direct evidence of the involvement of work-ing memory and language processing in program comprehension,and suggest that, while learning programming, training workingmemory (necessary for many cognitive tasks) and language skills(which Dijkstra already claimed as relevant for programming)might also be essential for programming skills. Furthermore, ourresults can help to validate or invalidate particular theories of pro-gram comprehension.

6 Although a single study is not sufficient toanswer general questions, we can raise some further probing ques-tions: If program comprehension is linked to language compre-hension, does learning and Understanding a programming languagerequire the same struggles and challenges as learning another nat-ural language? If program comprehension only activates the lefthemisphere (often referred to as analytical), can we derive betterguidelines on how to train students?Taking a broader perspective, our study demonstrates the feasi-bility of using fMRI experiments in software-engineering we believe this is only a first step, our experience and ex-perimental design is meant to be a template for other researchers toadopt and improve. With decreasing costs of fMRI studies, we be-lieve that such studies will become a standard tool also in software-engineering are still many interesting, unanswered questions that fol-low this line of research: How do people use domain knowledgeduring comprehension?

7 To what extent is implementing sourcecode a creative process? Can we train anybody to become an excel-lent programmer? How should we design programming languagesand tools for optimal developer support? Can software metrics pre-dict the comprehensibility of Source code?In summary, we make the following contributions: We designed the first fMRI study to observe brain activityduring program-comprehension tasks. We share our designand experiences. We conducted the study with 17 participants and observedactivation in five distinct brain regions. This demonstratesthe potential of fMRI studies in software-engineering re-search. We interpret how the identified cognitive processes con-tribute to program comprehension and discuss future re-search paper builds on our previous proposal, in which we de-scribed our planning stage and conducted only preliminary stud-ies with traditional controlled experiements [71]. In this paper, wenow report on the actual experiments inside an fMRI scanner thatwe conducted FMRI STUDIES IN A NUTSHELLIn this section, we give a high-level view of our study; we de-scribe the details in Section of fMRI studying cognitive pro-cesses in the brain, scientists often follow a pattern of research thatbegins with a single case of brain injury that interferes with a cog-nitive behavior, followed by further studies locating and isolatingbrain activity.

8 To identify a region of the brain, scientists use in-struments with high spatial precision, such as fMRI having established a general idea of where brain activity isoccurring, scientists further try identifying the timing and interac-tion of brain activity among brain regions. For example, scientistswill try to measure the time to process a color or a behaviors, such as Understanding a spoken sentence,require interactions among multiple areas of the brain. Eventually,to create a model of behavior, scientists use techniques to dissoci-ate activated brain areas to understand how a particular brain areacontributes to a behavior. For instance, scientists found that theleft medial extra striate cortexwas associated with visual process-ing of words and pseudo words that obey English spelling, but notactivated by unfamiliar strings of letters or letter-like forms [57].To reference an identified brain location, Brodmann areas haveproved useful as classification system. There are 52 Brodmannarea (some are divided further) [11], each associated with cogni-tive processes, such as seeing words or retrieving meaning frommemory.

9 Through extensive research in this field over the pasttwenty years, there is a detailed and continuously growing mapbetween Brodmann areas and associated cognitive processes ( , an atlas). Due to its success,we selected fMRI to evaluate whether it is feasible to measure pro-gram such map, if we study a new task, such as program com-prehension, we can identify which brain regions are activated andconsequently hypothesize which cognitive processes are example, we found that one of the activated regions in our studyis related to language recognition, so we can hypothesize that lan-guage recognition is an integral part of program comprehension,which was not certain a priori (see Section ).General Challenges of fMRI using fMRIface general challenges due to the technologies involved, whichare very different from, say, controlled experiments in empiricalsoftware measures differences in blood-oxygen levels in the a brain region becomes active, its oxygen need increases, andthe amount of oxygenated blood in that region increases, while theamount of deoxygenated blood decreases known as theBOLD(blood oxygenation level dependent)effect.

10 Oxygenated and de-oxygenated blood have different magnetic properties, which aremeasured by fMRI scanners to identify active brain BOLD effect needs a few seconds to manifest. Typically,after about 5 seconds, it peaks; after a task is finished, the oxygenlevel returns to the baseline level after 12 seconds. Often, beforereturning to the baseline, the oxygen level drops below the base-line [39]. Thus, the length of the experiment has to be plannedcarefully. For optimal measurement of the BOLD effect, task du-rations between 30 and 120 seconds have proved useful, followedby a rest condition of about 30 to 60 seconds. A longer task dura-tion allows the BOLD signal to accumulate, which produces betterdifferences between tasks. Furthermore, we need several measure-ments, so an experiment consists of several similar tasks to average1public static void main(String[] args) {2 String word = "Hello";3 String result = new String();45for (int j = () - 1; j >= 0; j--)6result = result + (j); (result);9}Figure 2: Source code for one comprehension task with ex-pected output olleH.


Related search queries