Cargando…

Evaluating refactorings for disciplining #ifdef annotations: An eye tracking study with novices

The C preprocessor is widely used in practice. Conditional compilation with #ifdef annotations allows developers to flexibly introduce variability in their programs. Developers can use disciplined annotations, entirely enclosing full statements with preprocessor directives, or undisciplined ones, en...

Descripción completa

Detalles Bibliográficos
Autores principales: da Costa, José Aldo Silva, Gheyi, Rohit, Ribeiro, Márcio, Apel, Sven, Alves, Vander, Fonseca, Baldoino, Medeiros, Flávio, Garcia, Alessandro
Formato: Online Artículo Texto
Lenguaje:English
Publicado: Springer US 2021
Materias:
Acceso en línea:https://www.ncbi.nlm.nih.gov/pmc/articles/PMC8262123/
https://www.ncbi.nlm.nih.gov/pubmed/34248397
http://dx.doi.org/10.1007/s10664-021-10002-8
_version_ 1783719127924342784
author da Costa, José Aldo Silva
Gheyi, Rohit
Ribeiro, Márcio
Apel, Sven
Alves, Vander
Fonseca, Baldoino
Medeiros, Flávio
Garcia, Alessandro
author_facet da Costa, José Aldo Silva
Gheyi, Rohit
Ribeiro, Márcio
Apel, Sven
Alves, Vander
Fonseca, Baldoino
Medeiros, Flávio
Garcia, Alessandro
author_sort da Costa, José Aldo Silva
collection PubMed
description The C preprocessor is widely used in practice. Conditional compilation with #ifdef annotations allows developers to flexibly introduce variability in their programs. Developers can use disciplined annotations, entirely enclosing full statements with preprocessor directives, or undisciplined ones, enclosing only parts of the statements. Despite some debate, there is no consensus on whether a developer should use exclusively disciplined annotations. While one prior study found undisciplined annotations more time-consuming and error-prone, another study found no difference between disciplined and undisciplined annotations regarding task completion time and accuracy. In this article, we evaluate whether three fine-grained refactorings to discipline #ifdef annotations correlate with improvements in code comprehension and visual effort with an eye tracker. We conduct a controlled experiment with 64 human subjects who were majoritarily novices in the C programming language. We observed statistically significant differences for two refactorings to discipline annotations with respect to the analyzed metrics (time, fixation duration, fixation count, and regressions count) in the code regions changed by each refactoring.
format Online
Article
Text
id pubmed-8262123
institution National Center for Biotechnology Information
language English
publishDate 2021
publisher Springer US
record_format MEDLINE/PubMed
spelling pubmed-82621232021-07-07 Evaluating refactorings for disciplining #ifdef annotations: An eye tracking study with novices da Costa, José Aldo Silva Gheyi, Rohit Ribeiro, Márcio Apel, Sven Alves, Vander Fonseca, Baldoino Medeiros, Flávio Garcia, Alessandro Empir Softw Eng Article The C preprocessor is widely used in practice. Conditional compilation with #ifdef annotations allows developers to flexibly introduce variability in their programs. Developers can use disciplined annotations, entirely enclosing full statements with preprocessor directives, or undisciplined ones, enclosing only parts of the statements. Despite some debate, there is no consensus on whether a developer should use exclusively disciplined annotations. While one prior study found undisciplined annotations more time-consuming and error-prone, another study found no difference between disciplined and undisciplined annotations regarding task completion time and accuracy. In this article, we evaluate whether three fine-grained refactorings to discipline #ifdef annotations correlate with improvements in code comprehension and visual effort with an eye tracker. We conduct a controlled experiment with 64 human subjects who were majoritarily novices in the C programming language. We observed statistically significant differences for two refactorings to discipline annotations with respect to the analyzed metrics (time, fixation duration, fixation count, and regressions count) in the code regions changed by each refactoring. Springer US 2021-07-07 2021 /pmc/articles/PMC8262123/ /pubmed/34248397 http://dx.doi.org/10.1007/s10664-021-10002-8 Text en © The Author(s), under exclusive licence to Springer Science+Business Media, LLC, part of Springer Nature 2021 This article is made available via the PMC Open Access Subset for unrestricted research re-use and secondary analysis in any form or by any means with acknowledgement of the original source. These permissions are granted for the duration of the World Health Organization (WHO) declaration of COVID-19 as a global pandemic.
spellingShingle Article
da Costa, José Aldo Silva
Gheyi, Rohit
Ribeiro, Márcio
Apel, Sven
Alves, Vander
Fonseca, Baldoino
Medeiros, Flávio
Garcia, Alessandro
Evaluating refactorings for disciplining #ifdef annotations: An eye tracking study with novices
title Evaluating refactorings for disciplining #ifdef annotations: An eye tracking study with novices
title_full Evaluating refactorings for disciplining #ifdef annotations: An eye tracking study with novices
title_fullStr Evaluating refactorings for disciplining #ifdef annotations: An eye tracking study with novices
title_full_unstemmed Evaluating refactorings for disciplining #ifdef annotations: An eye tracking study with novices
title_short Evaluating refactorings for disciplining #ifdef annotations: An eye tracking study with novices
title_sort evaluating refactorings for disciplining #ifdef annotations: an eye tracking study with novices
topic Article
url https://www.ncbi.nlm.nih.gov/pmc/articles/PMC8262123/
https://www.ncbi.nlm.nih.gov/pubmed/34248397
http://dx.doi.org/10.1007/s10664-021-10002-8
work_keys_str_mv AT dacostajosealdosilva evaluatingrefactoringsfordiscipliningifdefannotationsaneyetrackingstudywithnovices
AT gheyirohit evaluatingrefactoringsfordiscipliningifdefannotationsaneyetrackingstudywithnovices
AT ribeiromarcio evaluatingrefactoringsfordiscipliningifdefannotationsaneyetrackingstudywithnovices
AT apelsven evaluatingrefactoringsfordiscipliningifdefannotationsaneyetrackingstudywithnovices
AT alvesvander evaluatingrefactoringsfordiscipliningifdefannotationsaneyetrackingstudywithnovices
AT fonsecabaldoino evaluatingrefactoringsfordiscipliningifdefannotationsaneyetrackingstudywithnovices
AT medeirosflavio evaluatingrefactoringsfordiscipliningifdefannotationsaneyetrackingstudywithnovices
AT garciaalessandro evaluatingrefactoringsfordiscipliningifdefannotationsaneyetrackingstudywithnovices