Please use this identifier to cite or link to this item: https://hdl.handle.net/10316/113871
DC FieldValueLanguage
dc.contributor.authorHao, Gao-
dc.contributor.authorHijazi, Haytham-
dc.contributor.authorDurães, João-
dc.contributor.authorMedeiros, Julio-
dc.contributor.authorCouceiro, Ricardo-
dc.contributor.authorLam, Chan Tong-
dc.contributor.authorTeixeira, César A.-
dc.contributor.authorCastelhano, João-
dc.contributor.authorCastelo-Branco, Miguel-
dc.contributor.authorCarvalho, Paulo de-
dc.contributor.authorMadeira, Henrique-
dc.date.accessioned2024-03-07T12:49:49Z-
dc.date.available2024-03-07T12:49:49Z-
dc.date.issued2022-
dc.identifier.issn1662-4548pt
dc.identifier.urihttps://hdl.handle.net/10316/113871-
dc.description.abstractComplexity 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.pt
dc.language.isoengpt
dc.publisherFrontiers Media S.A.pt
dc.relationThis work was funded in part by the BASE (Biofeedback Augmented Software Engineering) project under Grant POCI- 01-0145-FEDER-031581, by the Centro de Informática e Sistemas da Universidade de Coimbra (CISUC), and in part by Coimbra Institute for Biomedical Imaging and Translational Research (CIBIT), Institute of Nuclear Sciences Applied to Health (ICNAS), and the University of Coimbra under Grant PTDC/PSI-GER/30852/2017 | CONNECT-BCI.pt
dc.rightsopenAccesspt
dc.rights.urihttp://creativecommons.org/licenses/by/4.0/pt
dc.subjectcode complexity metricspt
dc.subjectcode comprehensionpt
dc.subjectEEGpt
dc.subjectcognitive loadpt
dc.subjectmental effortpt
dc.subjectcode refactoringpt
dc.subjectcode constructspt
dc.titleOn the accuracy of code complexity metrics: A neuroscience-based guideline for improvementpt
dc.typearticle-
degois.publication.firstPage1065366pt
degois.publication.titleFrontiers in Neurosciencept
dc.peerreviewedyespt
dc.identifier.doi10.3389/fnins.2022.1065366pt
degois.publication.volume16pt
dc.date.embargo2022-01-01*
uc.date.periodoEmbargo0pt
item.languageiso639-1en-
item.grantfulltextopen-
item.fulltextCom Texto completo-
item.openairecristypehttp://purl.org/coar/resource_type/c_18cf-
item.openairetypearticle-
item.cerifentitytypePublications-
crisitem.author.researchunitCISUC - Centre for Informatics and Systems of the University of Coimbra-
crisitem.author.researchunitCIBIT - Coimbra Institute for Biomedical Imaging and Translational Research-
crisitem.author.researchunitCISUC - Centre for Informatics and Systems of the University of Coimbra-
crisitem.author.researchunitCISUC - Centre for Informatics and Systems of the University of Coimbra-
crisitem.author.parentresearchunitFaculty of Sciences and Technology-
crisitem.author.parentresearchunitFaculty of Sciences and Technology-
crisitem.author.parentresearchunitFaculty of Sciences and Technology-
crisitem.author.orcid0000-0002-4981-3649-
crisitem.author.orcid0000-0003-2852-6285-
crisitem.author.orcid0000-0001-9396-1211-
crisitem.author.orcid0000-0002-8996-1515-
crisitem.author.orcid0000-0003-4364-6373-
crisitem.author.orcid0000-0002-9847-0590-
crisitem.author.orcid0000-0001-8146-4664-
Appears in Collections:I&D CIBIT - Artigos em Revistas Internacionais
I&D ICNAS - Artigos em Revistas Internacionais
I&D CISUC - Artigos em Revistas Internacionais
Show simple item record

Page view(s)

59
checked on Sep 11, 2024

Download(s)

14
checked on Sep 11, 2024

Google ScholarTM

Check

Altmetric

Altmetric


This item is licensed under a Creative Commons License Creative Commons