{"contenttype":"result","language":"en","availableLanguages":"en","rcn":"1312493","id":"101052182_PSHORIZON","title":"Periodic Reporting for period 1 - Brains On Code (A Neuroscientific Foundation of Program Comprehension)","teaser":"The pivotal role of software in our modern world mandates strong requirements on quality, correctness, and reliability of software systems. In software development and maintenance, the ability to understand program artifacts plays a key role for programmers to fulfill these...","description":"periodic","summary":"The pivotal role of software in our modern world mandates strong requirements on quality, correctness, and reliability of software systems. In software development and maintenance, the ability to understand program artifacts plays a key role for programmers to fulfill these requirements. Despite significant progress, research on program comprehension has a fundamental limitation: program comprehension is a cognitive process that cannot be directly observed, which leaves considerable room for misinterpretation, uncertainty, and confounders. In Brains On Code, we will develop a neuroscientific foundation of program comprehension. Instead of merely observing whether there is a difference regarding program comprehension (e.g., between two programming methods), we aim at precisely and reliably determining the key factors that cause the difference. This is especially challenging as humans are the subjects of study, and interpersonal variance and other confounding factors obfuscate the results. The key idea of Brains On Code is to leverage established methods from cognitive neuroscience to obtain insights into the underlying processes and influential factors of program comprehension. Brains On Code will pursue a multimodal approach that integrates different neurophysiological measures as well as a cognitive computational modeling approach to establish the theoretical foundation. This way, Brains On Code will lay the foundations of measuring and modeling program comprehension and offer substantial feedback for programming methodology, language design, and education. Addressing longstanding foundational questions such as \u201cHow can we reliably measure program comprehension?\u201d, \u201cWhat makes a program hard to understand?\u201d, and \u201cWhat skills should programmers have?\u201d will get into reach. A success of Brains On Code would not only help answer these questions, but also provide an outline for applying the methodology beyond program code (models, specifications, etc.).","workPerformed":"We have achieved significant progress in understanding how programmers comprehend code, using neurophysiological and behavioral methods such as cognitive modeling, neuroimaging, and eye tracking.\n\nWe developed the first comprehensive computational model simulating how programmers retrieve variable values during code comprehension. This model accurately predicts which parts of the code are harder to understand or error-prone, and a web-based demo is in progress to make these insights accessible for real-world use.\n\nWe conducted a series of EEG and fMRI studies that have revealed how expertise and cognitive strategies influence programming. For instance, skilled programmers process code with less cognitive effort. Interestingly, commonly used experience measures do not predict programmer efficacy well, but self-estimation and indicators of learning eagerness are fairly accurate.\n\nIn a series of eye-tracking studies, we explored how visual cues such as comments and type annotations affect code comprehension. While programmers perceive comments as helpful, their actual impact on understanding is context-dependent. Similarly, type annotations often do not enhance comprehension as much as expected.\n\nMost notably, we have discovered parallels between processing code and natural language, finding that programmers\u2019 brains respond to confusing code elements in ways similar to unexpected words in sentences, suggesting shared cognitive mechanisms.\n\nUsing large language models (LLMs), we demonstrated their potential to mirror human judgments about \u0022fuzzy\u0022 aspects of code, like smells and clarity, where traditional tools struggle. This work also highlights how LLMs improve with contextual information that benefits humans.\n\nAdditionally, we refined existing techniques for neuroimaging and eye-tracking studies. Notably, we identified better baselines for program comprehension tasks and called for standardization in eye-tracking data analysis to ensure robust and comparable results.\n\nThese insights pave the way for better programming tools, education, and metrics, fostering a deeper understanding of how we think and work with code.","finalResults":"Our project has achieved several results that go beyond the state of the art, with the potential to significantly impact programming research, education, and industry practices.\n\nOne of the most notable advances is the development of an ACT-R-based cognitive model for simulating how programmers understand simple code snippets. This model achieves a high level of predictive accuracy, enabling precise identification of error-prone or cognitively demanding sections of code. This breakthrough paves the way for developing empirically validated metrics to measure code comprehensibility, which could be applied in industry to enhance software quality and maintainability. While further research and refinement are needed to scale its application to complex code and real-world programming environments, the current model already establishes a new benchmark for understanding cognitive processes in programming.\n\nAnother major advance is the adaptation of event-related and fixation-related potentials (ERP\/FRP) from psycholinguistics to software engineering. This novel methodology revealed parallels between code comprehension and natural language processing, shedding light on how the brain handles confusing elements in code. These insights not only deepen our understanding of program comprehension but also demonstrate the potential of integrating neuroscience with software engineering. To ensure the continued uptake and success of this work, further studies are needed to expand its scope, refine the methodologies, and explore broader applications in education, hiring, and tool development. Supporting this effort will require ongoing collaboration, standardization of methodologies, and dissemination of findings to both academic and industry audiences.","periodNumber":"1","periodFrom":"2022-10-01","periodTo":"2025-03-31","reportTypeDescription":"Periodic Reporting for period 1","identifiers":{"reportId":"390605"},"sourceUpdateDate":"2025-06-17 07:52:51","contentCreationDate":"2025-06-23 13:53:15","contentUpdateDate":"2025-06-17 07:52:51","lastUpdateDate":"2025-07-16 10:59:53","relations":{"categories":[{"language":"en","availableLanguages":"de,en,es,fr,it,pl","code":"pubsum","title":"Report Summary","description":"Result: Publishable summary (FP7 SESAM) and Summary for publication (H2020 SyGMa)","displayCode":"\/Report Summary","attributes":{"classification":"collection","type":"belongsTo"}},{"language":"en","availableLanguages":"de,en,es,fr,it,pl","code":"corda","title":"CORDA","description":"RTD research data warehouse","displayCode":"\/CORDA","attributes":{"classification":"source","type":"isProvidedBy"}}],"associations":[{"availableLanguages":"en","rcn":"238536","id":"101052182","acronym":"Brains On Code","title":"A Neuroscientific Foundation of Program Comprehension","relations":{"categories":[{"language":"en","availableLanguages":"de,en,es,fr,it,pl","code":"project","title":"Project","description":"Project factsheets","displayCode":"\/Project","attributes":{"classification":"collection","type":"belongsTo"}},{"language":"en","availableLanguages":"de,en,es,fr,it,pl","code":"\/23\/49\/327","title":"neurobiology","displayCode":"\/natural sciences\/biological sciences\/neurobiology","attributes":{"classification":"euroSciVoc","type":"isInFieldOfScience"}},{"language":"en","availableLanguages":"de,en,es,fr,it,pl","code":"\/23\/47\/307","title":"software","displayCode":"\/natural sciences\/computer and information sciences\/software","attributes":{"classification":"euroSciVoc","type":"isInFieldOfScience"}},{"language":"en","availableLanguages":"de,en,es,fr,it,pl","code":"digitalAgenda","title":"Digital agenda","description":"This tracker monitors Horizon Europe\u2019s financial contribution to the development of digital technologies and the digitisation of the economy and society (known as \u2018Digital transition\u2019).","displayCode":"\/Digital agenda","attributes":{"weight":"0","classification":"policyPriorities","type":"marker"}},{"language":"en","availableLanguages":"de,en,es,fr,it,pl","code":"cleanAir","title":"Clean air","description":"This tracker monitors the Horizon Europe\u2019s financial contribution to the clean air policy (National Emission Ceiling Directive) aiming to improve ambient air quality and tackle air pollution, to protect the environment and human health.","displayCode":"\/Clean air","attributes":{"weight":"0","classification":"policyPriorities","type":"marker"}},{"language":"en","availableLanguages":"de,en,es,fr,it,pl","code":"ai","title":"Artificial intelligence","description":"This tracker monitors Horizon Europe\u2019s financial contribution to the development and deployment of AI-based technologies and solutions. Projects that develop AI-tools as part of their research method are included","displayCode":"\/Artificial intelligence","attributes":{"weight":"0","classification":"policyPriorities","type":"marker"}},{"language":"en","availableLanguages":"de,en,es,fr,it,pl","code":"climate","title":"Climate action","description":"This tracker monitors the Horizon Europe\u2019s financial contribution to both mitigating climate change (e.g., contributions to the reduction of greenhouse gas emissions) and adapting to climate change by building resilience (e.g., regarding floods, droughts, spatial planning and better governance, adaptation to changing climate in value chains, etc.).","displayCode":"\/Climate action","attributes":{"weight":"0","classification":"policyPriorities","type":"marker"}},{"language":"en","availableLanguages":"de,en,es,fr,it,pl","code":"biodiversity","title":"Biodiversity","description":"This tracker monitors the Horizon Europe\u2019s financial contribution to Europe\u2019s biodiversity\u2019s path to recovery including species protection, ecosystem conservation, and habitat rehabilitation, all essential for resilience in climate adaptation and addressing ecosystem services but also environmental crime and the health-environment connection.","displayCode":"\/Biodiversity","attributes":{"weight":"0","classification":"policyPriorities","type":"marker"}},{"language":"en","availableLanguages":"en","code":"HORIZON-ERC","title":"HORIZON ERC Grants","description":"HORIZON ERC Grants","displayCode":"\/HORIZON ERC Grants","attributes":{"classification":"projectFundingSchemeCategory","type":"relatedProjectFundingSchemeCategory"}},{"language":"en","availableLanguages":"de,en,es,fr,it,pl","code":"corda","title":"CORDA","description":"RTD research data warehouse","displayCode":"\/CORDA","attributes":{"classification":"source","type":"isProvidedBy"}}],"associations":[{"availableLanguages":"en","rcn":"705727","id":"HORIZON.1.1","code":"HORIZON.1.1","frameworkProgramme":"HORIZON","pga":"HORIZON.1.1","title":"European Research Council (ERC)","parent":{"rcn":"705726\/705725","code":"HORIZON.1\/HORIZON"},"relations":{"categories":[{"language":"en","availableLanguages":"de,en,es,fr,it,pl","code":"legalbasis","title":"Legal Basis","description":"Programme: Legal basis for research funding","displayCode":"\/Legal Basis","attributes":{"classification":"collection","type":"belongsTo"}},{"language":"en","availableLanguages":"de,en,es,fr,it,pl","code":"corda","title":"CORDA","description":"RTD research data warehouse","displayCode":"\/CORDA","attributes":{"classification":"source","type":"isProvidedBy"}}]},"contenttype":"programme","attributes":{"source":"corda","type":"relatedLegalBasis","uniqueProgrammePart":"true"}},{"availableLanguages":"en","rcn":"705892","id":"HORIZON_ERC-2021-ADG","code":"ERC-2021-ADG","frameworkProgramme":"HORIZON","title":"ERC ADVANCED GRANTS","parent":{"rcn":"20300","code":"HORIZON-Topics"},"relations":{"categories":[{"language":"en","availableLanguages":"de,en,es,fr,it,pl","code":"topic","title":"Topic","description":"Programme: Part of the Commission work programme implementing legal basis","displayCode":"\/Topic","attributes":{"classification":"collection","type":"belongsTo"}},{"language":"en","availableLanguages":"de,en,es,fr,it,pl","code":"corda","title":"CORDA","description":"RTD research data warehouse","displayCode":"\/CORDA","attributes":{"classification":"source","type":"isProvidedBy"}}]},"contenttype":"programme","attributes":{"source":"corda","type":"relatedTopic"}}]},"contenttype":"project","attributes":{"source":"corda","type":"relatedProject"}}]},"modelVersion":"132","icaVersion":"20.0.0-48f81e07"}