How does code readability change during software evolution?
- PDF / 1,267,080 Bytes
- 39 Pages / 439.642 x 666.49 pts Page_size
- 46 Downloads / 200 Views
How does code readability change during software evolution? Valentina Piantadosi1 · Fabiana Fierro1 · Simone Scalabrino1 · Alexander Serebrenik2 · Rocco Oliveto1
© Springer Science+Business Media, LLC, part of Springer Nature 2020
Abstract Code reading is one of the most frequent activities in software maintenance. Such an activity aims at acquiring information from the code and, thus, it is a prerequisite for program comprehension: developers need to read the source code they are going to modify before implementing changes. As the code changes, so does its readability; however, it is not clear yet how code readability changes during software evolution. To understand how code readability changes when software evolves, we studied the history of 25 open source systems. We modeled code readability evolution by defining four states in which a file can be at a certain point of time (non-existing, other-name, readable, and unreadable). We used the data gathered to infer the probability of transitioning from one state to another one. In addition, we also manually checked a significant sample of transitions to compute the performance of the state-of-the-art readability prediction model we used to calculate the transition probabilities. With this manual analysis, we found that the tool correctly classifies all the transitions in the majority of the cases, even if there is a loss of accuracy compared to the single-version readability estimation. Our results show that most of the source code files are created readable. Moreover, we observed that only a minority of the commits change the readability state. Finally, we manually carried out qualitative analysis to understand what makes code unreadable and what developers do to prevent this. Using our results we propose some guidelines (i) to reduce the risk of code readability erosion and (ii) to promote best practices that make code readable. Keywords Code readability · Software evolution · Mining software repositories
1 Introduction “Readability” is a fundamental and highly desirable property of the source code. Code reading is the very first step during incremental change (Bennett and Rajlich 2000; Rajlich and Communicated by: Meiyappan Nagappan Rocco Oliveto
[email protected]
Extended author information available on the last page of the article.
Empirical Software Engineering
Gosavi 2004), which is required to perform concept location, impact analysis and the corresponding change implementation/propagation. Assuring source code readability becomes an imperative in modern open source software development due to its collaborative and geographically distributed character. Erlikh (2000) has shown that during software evolution tasks developers spend plenty of time maintaining the existing code (often written by others), far more than writing code from scratch. Several facets have been reported as components that contribute to making code readable (Martin 2009; Oram and Wilson 2007; Beck 2007). Such components include complexity, usage of design concepts, formatti
Data Loading...