Year: 2023
Type: dissertation
Abstract: Understanding source code is vital in software development, and developers spent be- tween 58% and 70% of their time to code comprehension. This comprehension relies on code legibility and readability, influenced by factors like formatting, code constructs, and naming conventions. Formatting elements, such as spacing, are factors that impact the legibility of the source code and, consequently, may affect the ability of developers to identify the elements of the code while reading it. Structural and semantic characteristics, such as programming constructs, impact the readability of the source code and may affect the ability of developers to understand it while reading the code. This thesis explores code alternatives for improving code legibility and readability through empirical studies and practical evidence. We conducted four distinct studies. In the first one, we performed a systematic literature review to identify how code legibility and readability are evaluated, revealing categories of tasks and response variables. In the second one, we conducted another review, but focused on formatting ele- ments, discovering 13 factors categorized into five groups that impact code legibility. A third review examined code elements, categorizing 20 factors into five groups affecting code read- ability. Finally, in the fourth study, we performed a survey of 2,401 code review comments where we found that over 42% aimed to improve code understandability. Also, we identified eight categories of code understandability smells where the 84.3% of improvement suggestions were accepted by developers. Based on these studies, we found limitations in the literature, which include a lack of replications, outdated studies, and insufficient power analyses. Despite these challenges, developers often adopt code alternatives suggested by research. Additionally, practical evidence highlights limitations of linters in code understandability where only 30% of the code understandability smells identified are flagged by linters. This thesis contributes a comprehensive catalog of code alternatives, aiding the creation of evidence-based coding guidelines and automated tools. We also presented a learning taxonomy adapted to program comprehension that simplifies research design in program comprehension. Moreover, we have available a dataset of code review comments and analysis of popular linters that serves as a valuable resource for researchers and developers, enabling the creation of automated tools to detect and repair code understandability smells.
Author: OLIVEIRA, Delano Hélio
Institution: Universidade Federal de Pernambuco
Language: English
Subfield: Information Systems
Field: Computer Science
Domain: Physical Sciences
Open Access status: green
OpenAlex ID: W7120667393
