Seeing confusion through a new lens: on the impact of atoms of confusion on novices’ code comprehension

Empirical Software Engineering - Tập 28 - Trang 1-42 - 2023
José Aldo Silva da Costa1, Rohit Gheyi1, Fernando Castor2, Pablo Roberto Fernandes de Oliveira1, Márcio Ribeiro3, Baldoino Fonseca3
1Federal University of Campina Grande, Campina Grande, Brazil
2Utrecht University, Utrecht, Netherlands
3Federal University of Alagoas, Maceió, Brazil

Tóm tắt

Code comprehension is crucial for software maintenance and evolution, but it can be hindered by tiny code snippets that can confuse the developers, called atoms of confusion. Previous studies investigated how atoms impact code comprehension through the perspectives of time, accuracy, and opinions of developers. However, we need more studies evaluating other perspectives and the combination of these perspectives on a common ground through experiments. In our study, we evaluate how the eye tracking method can be used to gain new insights when we compare programs obfuscated by the atoms with functionally equivalent clarified versions. We conduct a controlled experiment with 32 novices in Python and measure their time, number of attempts, and visual effort with eye tracking through fixation duration, fixations count, and regressions count. We also conduct interviews and investigate the subjects’ difficulties with the programs. In our results, the clarified version of the code with Operator Precedence reduced the time spent in the region that contains the atom to the extent of 38.6%, and the number of answer attempts by 28%. Most subjects found the obfuscated version more difficult to solve than the clarified one, and they reported the order of precedence to be difficult to validate. By analyzing their visual effort, in the obfuscated version, we observed an increase of 47.3% in the horizontal regressions count in the atom region, making its reading more difficult. The additional atoms evaluated revealed other interesting nuances. Based on our findings, we encourage researchers to consider eye tracking combined with other perspectives to evaluate atoms of confusion and educators to favor patterns that do not impact the understanding and visual effort of undergraduates.

Tài liệu tham khảo

Binkley D, Davis M, Lawrie D, Maletic J, Morrell C, Sharif B (2013) The Impact of Identifier Style on Effort and Comprehension. Empir Softw Eng 18(2):219–276

Box G, Hunter JS, Hunter WG (2005) Statistics for Experimenters. Wiley-Interscience

Castor F (2018) Identifying Confusing Code in Swift Programs. In: Proceedings of the CBSoft Workshop on Visualization, Evolution, and Maintenance, VEM’18. ACM, São Carlos

da Costa JAS, Gheyi R, Castor F, Roberto P, Ribeiro M, Fonseca B (2023). Seeing Confusion Through a New Lens: On the Impact of Atoms of Confusion on Novices’ Code Comprehension (Artifacts). https://doi.org/10.5281/zenodo.7650076

de Oliveira B, Ribeiro M, da Costa JAS, Gheyi R, Amaral G, de Mello R, Oliveira A, Garcia A, Bonifácio R, Fonseca B (2020) Atoms of Confusion: The Eyes Do Not Lie. In: Proceedings of the Brazilian Symposium on Software Engineering, SBES’20, pp 243–252

Galley N, Betz D, Biniossek C (2015) Fixation Durations: Why are They so Highly Variable. Adv Vis Percept Res 93:83–106

Gopstein D, Zhou HH, Frankl P, Cappos J (2018) Prevalence of Confusing Code in Software Projects: Atoms of Confusion in the Wild. In: Proceedings of the International Conference on Mining Software Repositories, ICSMR’18, pp 281–291. Association for Computing Machinery, New York

Holmqvist K, Nyström M, Andersson R, Dewhurst R, Jarodzka H, Van de Weijer J (2011) Eye Tracking: A Comprehensive Guide to Methods and Measures. OUP Oxford

Sadun E, Gregor D (2015) Remove c-style for-loops with conditions and incrementers. Swift Programming Language Evolution, proposal SE-0007. https://github.com/apple/swift-evolution/blob/main/proposals/0007-remove-c-style-for-loops.md. Accessed 21 March 2023

Schulze S, Liebig J, Siegmund J, Apel S (2013) Does the Discipline of Preprocessor Annotations Matter?: A Controlled Experiment. In: Proceedings of the International Conference on Generative Programming: Concepts & Experiences, GPCE ’13, pp 65–74. Association for Computing Machinery, New York

Strauss A, Corbin J (1998) Basics of Qualitative Research Techniques. Citeseer