1
|
Medeiros J, Bernardes A, Couceiro R, Oliveira P, Madeira H, Teixeira C, Carvalho P. Optimal frequency bands for pupillography for maximal correlation with HRV. Sci Rep 2025; 15:3361. [PMID: 39870665 PMCID: PMC11772668 DOI: 10.1038/s41598-025-85663-2] [Citation(s) in RCA: 0] [Impact Index Per Article: 0] [Reference Citation Analysis] [Abstract] [Key Words] [MESH Headings] [Grants] [Track Full Text] [Journal Information] [Subscribe] [Scholar Register] [Received: 03/28/2024] [Accepted: 01/06/2025] [Indexed: 01/29/2025] Open
Abstract
Assessing cognitive load using pupillography frequency features presents a persistent challenge due to the lack of consensus on optimal frequency limits. This study aims to address this challenge by exploring pupillography frequency bands and seeking clarity in defining the most effective ranges for cognitive load assessment. From a controlled experiment involving 21 programmers performing software bug inspection, our study pinpoints the optimal low-frequency (0.06-0.29 Hz) and high-frequency (0.29-0.49 Hz) bands. Correlation analysis yielded a geometric mean of 0.238 compared to Heart Rate Variability features, with individual correlations for low-frequency, high-frequency, and their ratio at 0.279, 0.168, and 0.286, respectively. Extending the study to 51 participants, including a different experiment focusing on mental arithmetic tasks, validated the previous findings and further refined bands, maintaining effectiveness with a geometric mean correlation of 0.236 and surpassing common frequency bands reported in the existing literature. This study represents a pivotal step toward converging and establishing a coherent framework for frequency band definition to be used in pupillography analysis. Furthermore, based on this, it also contributes insights into the importance of more integration and adoption of eye-tracking with pupillography technology into authentic software development contexts for cognitive load assessment at a very fine level of granularity.
Collapse
Affiliation(s)
- Júlio Medeiros
- Centre for Informatics and Systems of the University of Coimbra, Department of Informatics Engineering, University of Coimbra, Coimbra, Portugal.
| | - André Bernardes
- Centre for Informatics and Systems of the University of Coimbra, Department of Informatics Engineering, University of Coimbra, Coimbra, Portugal
| | - Ricardo Couceiro
- Centre for Informatics and Systems of the University of Coimbra, Department of Informatics Engineering, University of Coimbra, Coimbra, Portugal
| | - Paulo Oliveira
- Department of Mathematics, University of Coimbra, Coimbra, Portugal
| | - Henrique Madeira
- Centre for Informatics and Systems of the University of Coimbra, Department of Informatics Engineering, University of Coimbra, Coimbra, Portugal
| | - César Teixeira
- Centre for Informatics and Systems of the University of Coimbra, Department of Informatics Engineering, University of Coimbra, Coimbra, Portugal
| | - Paulo Carvalho
- Centre for Informatics and Systems of the University of Coimbra, Department of Informatics Engineering, University of Coimbra, Coimbra, Portugal
| |
Collapse
|
2
|
Medeiros J, Simões M, Castelhano J, Abreu R, Couceiro R, Henriques J, Castelo-Branco M, Madeira H, Teixeira C, de Carvalho P. EEG as a potential ground truth for the assessment of cognitive state in software development activities: A multimodal imaging study. PLoS One 2024; 19:e0299108. [PMID: 38452019 PMCID: PMC10919648 DOI: 10.1371/journal.pone.0299108] [Citation(s) in RCA: 0] [Impact Index Per Article: 0] [Reference Citation Analysis] [Abstract] [MESH Headings] [Grants] [Track Full Text] [Journal Information] [Subscribe] [Scholar Register] [Received: 07/22/2022] [Accepted: 02/06/2024] [Indexed: 03/09/2024] Open
Abstract
Cognitive human error and recent cognitive taxonomy on human error causes of software defects support the intuitive idea that, for instance, mental overload, attention slips, and working memory overload are important human causes for software bugs. In this paper, we approach the EEG as a reliable surrogate to MRI-based reference of the programmer's cognitive state to be used in situations where heavy imaging techniques are infeasible. The idea is to use EEG biomarkers to validate other less intrusive physiological measures, that can be easily recorded by wearable devices and useful in the assessment of the developer's cognitive state during software development tasks. Herein, our EEG study, with the support of fMRI, presents an extensive and systematic analysis by inspecting metrics and extracting relevant information about the most robust features, best EEG channels and the best hemodynamic time delay in the context of software development tasks. From the EEG-fMRI similarity analysis performed, we found significant correlations between a subset of EEG features and the Insula region of the brain, which has been reported as a region highly related to high cognitive tasks, such as software development tasks. We concluded that despite a clear inter-subject variability of the best EEG features and hemodynamic time delay used, the most robust and predominant EEG features, across all the subjects, are related to the Hjorth parameter Activity and Total Power features, from the EEG channels F4, FC4 and C4, and considering in most of the cases a hemodynamic time delay of 4 seconds used on the hemodynamic response function. These findings should be taken into account in future EEG-fMRI studies in the context of software debugging.
Collapse
Affiliation(s)
- Júlio Medeiros
- Department of Informatics Engineering, CISUC-Centre for Informatics and Systems of the University of Coimbra, University of Coimbra, Coimbra, Portugal
| | - Marco Simões
- Department of Informatics Engineering, CISUC-Centre for Informatics and Systems of the University of Coimbra, University of Coimbra, Coimbra, Portugal
| | - João Castelhano
- ICNAS-Institute of Nuclear Sciences Applied to Health, University of Coimbra, Coimbra, Portugal
| | - Rodolfo Abreu
- ICNAS-Institute of Nuclear Sciences Applied to Health, University of Coimbra, Coimbra, Portugal
| | - Ricardo Couceiro
- Department of Informatics Engineering, CISUC-Centre for Informatics and Systems of the University of Coimbra, University of Coimbra, Coimbra, Portugal
| | - Jorge Henriques
- Department of Informatics Engineering, CISUC-Centre for Informatics and Systems of the University of Coimbra, University of Coimbra, Coimbra, Portugal
| | - Miguel Castelo-Branco
- ICNAS-Institute of Nuclear Sciences Applied to Health, University of Coimbra, Coimbra, Portugal
| | - Henrique Madeira
- Department of Informatics Engineering, CISUC-Centre for Informatics and Systems of the University of Coimbra, University of Coimbra, Coimbra, Portugal
| | - César Teixeira
- Department of Informatics Engineering, CISUC-Centre for Informatics and Systems of the University of Coimbra, University of Coimbra, Coimbra, Portugal
| | - Paulo de Carvalho
- Department of Informatics Engineering, CISUC-Centre for Informatics and Systems of the University of Coimbra, University of Coimbra, Coimbra, Portugal
| |
Collapse
|
3
|
Hao G, Hijazi H, Durães J, Medeiros J, Couceiro R, Lam CT, Teixeira C, Castelhano J, Castelo Branco M, Carvalho P, Madeira H. On the accuracy of code complexity metrics: A neuroscience-based guideline for improvement. Front Neurosci 2023; 16:1065366. [PMID: 36825214 PMCID: PMC9942489 DOI: 10.3389/fnins.2022.1065366] [Citation(s) in RCA: 1] [Impact Index Per Article: 0.5] [Reference Citation Analysis] [Abstract] [Key Words] [Track Full Text] [Figures] [Journal Information] [Subscribe] [Scholar Register] [Received: 10/09/2022] [Accepted: 12/09/2022] [Indexed: 02/10/2023] Open
Abstract
Complexity is the key element of software quality. This article investigates the problem of measuring code complexity and discusses the results of a controlled experiment to compare different views and methods to measure code complexity. Participants (27 programmers) were asked to read and (try to) understand a set of programs, while the complexity of such programs is assessed through different methods and perspectives: (a) classic code complexity metrics such as McCabe and Halstead metrics, (b) cognitive complexity metrics based on scored code constructs, (c) cognitive complexity metrics from state-of-the-art tools such as SonarQube, (d) human-centered metrics relying on the direct assessment of programmers' behavioral features (e.g., reading time, and revisits) using eye tracking, and (e) cognitive load/mental effort assessed using electroencephalography (EEG). The human-centered perspective was complemented by the subjective evaluation of participants on the mental effort required to understand the programs using the NASA Task Load Index (TLX). Additionally, the evaluation of the code complexity is measured at both the program level and, whenever possible, at the very low level of code constructs/code regions, to identify the actual code elements and the code context that may trigger a complexity surge in the programmers' perception of code comprehension difficulty. The programmers' cognitive load measured using EEG was used as a reference to evaluate how the different metrics can express the (human) difficulty in comprehending the code. Extensive experimental results show that popular metrics such as V(g) and the complexity metric from SonarSource tools deviate considerably from the programmers' perception of code complexity and often do not show the expected monotonic behavior. The article summarizes the findings in a set of guidelines to improve existing code complexity metrics, particularly state-of-the-art metrics such as cognitive complexity from SonarSource tools.
Collapse
Affiliation(s)
- Gao Hao
- Faculty of Applied Sciences, Macao Polytechnic University, Macao, Macao SAR, China
| | - Haytham Hijazi
- Center for Informatics and Systems of the University of Coimbra (CISUC), University of Coimbra, Coimbra, Portugal
| | - João Durães
- Center for Informatics and Systems of the University of Coimbra (CISUC), Polytechnic Institute of Coimbra, Coimbra, Portugal
| | - Júlio Medeiros
- Center for Informatics and Systems of the University of Coimbra (CISUC), University of Coimbra, Coimbra, Portugal
| | - Ricardo Couceiro
- Center for Informatics and Systems of the University of Coimbra (CISUC), University of Coimbra, Coimbra, Portugal
| | - Chan Tong Lam
- Faculty of Applied Sciences, Macao Polytechnic University, Macao, Macao SAR, China
| | - César Teixeira
- Center for Informatics and Systems of the University of Coimbra (CISUC), University of Coimbra, Coimbra, Portugal
| | - João Castelhano
- Institute of Nuclear Science Applied to Health (ICNAS)/Coimbra Institute for Biomedical Imaging and Translational Research (CIBIT), University of Coimbra, Coimbra, Portugal
| | - Miguel Castelo Branco
- Institute of Nuclear Science Applied to Health (ICNAS)/Coimbra Institute for Biomedical Imaging and Translational Research (CIBIT), University of Coimbra, Coimbra, Portugal
| | - Paulo Carvalho
- Center for Informatics and Systems of the University of Coimbra (CISUC), University of Coimbra, Coimbra, Portugal
| | - Henrique Madeira
- Center for Informatics and Systems of the University of Coimbra (CISUC), University of Coimbra, Coimbra, Portugal,*Correspondence: Henrique Madeira,
| |
Collapse
|