How does code readability change during software evolution?

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.

[1]  Raymond P. L. Buse,et al.  A metric for software readability , 2008, ISSTA '08.

[2]  R. Likert “Technique for the Measurement of Attitudes, A” , 2022, The SAGE Encyclopedia of Research Design.

[3]  Maurice H. Halstead,et al.  Elements of software science (Operating and programming systems series) , 1977 .

[4]  Gabriele Bavota,et al.  When and Why Your Code Starts to Smell Bad (and Whether the Smells Go Away) , 2015, IEEE Transactions on Software Engineering.

[5]  Mia Hubert,et al.  An adjusted boxplot for skewed distributions , 2008, Comput. Stat. Data Anal..

[6]  Nicole Novielli,et al.  Confusion in Code Reviews: Reasons, Impacts, and Coping Strategies , 2019, 2019 IEEE 26th International Conference on Software Analysis, Evolution and Reengineering (SANER).

[7]  Denys Poshyvanyk,et al.  A comprehensive model for code readability , 2018, J. Softw. Evol. Process..

[8]  Alexander Serebrenik,et al.  Was Self-Admitted Technical Debt Removal a Real Removal? An In-Depth Perspective , 2018, 2018 IEEE/ACM 15th International Conference on Mining Software Repositories (MSR).

[9]  Austen Rainer,et al.  Case Study Research in Software Engineering - Guidelines and Examples , 2012 .

[10]  Hoh Peter In,et al.  Effect Analysis of Coding Convention Violations on Readability of Post-Delivered Code , 2015, IEICE Trans. Inf. Syst..

[11]  Eirini Kalliamvakou,et al.  An in-depth study of the promises and perils of mining GitHub , 2016, Empirical Software Engineering.

[12]  Yuming Zhou,et al.  The impact of continuous integration on other software development practices: A large-scale empirical study , 2017, 2017 32nd IEEE/ACM International Conference on Automated Software Engineering (ASE).

[13]  Alexander Serebrenik,et al.  Poster: How Do Community Smells Influence Code Smells? , 2018, 2018 IEEE/ACM 40th International Conference on Software Engineering: Companion (ICSE-Companion).

[14]  Gabriele Bavota,et al.  An experimental investigation on the innate relationship between quality and refactoring , 2015, J. Syst. Softw..

[15]  Mario Linares Vásquez,et al.  Improving code readability models with textual features , 2016, 2016 IEEE 24th International Conference on Program Comprehension (ICPC).

[16]  N. Cliff Dominance statistics: Ordinal analyses to answer ordinal questions. , 1993 .

[17]  Mario Cortina-Borja,et al.  Handbook of Parametric and Nonparametric Statistical Procedures, 5th edn , 2012 .

[18]  Pornsiri Muenchaisri,et al.  Measuring Understandability of Aspect-Oriented Code , 2011, DICTAP.

[19]  David J. Sheskin,et al.  Handbook of Parametric and Nonparametric Statistical Procedures , 1997 .

[20]  B. Efron,et al.  Bootstrap confidence intervals , 1996 .

[21]  Michael R Chernick,et al.  Bootstrap Methods: A Guide for Practitioners and Researchers , 2007 .

[22]  Venera Arnaoudova,et al.  Improving Source Code Readability: Theory and Practice , 2019, 2019 IEEE/ACM 27th International Conference on Program Comprehension (ICPC).

[23]  Václav Rajlich,et al.  Incremental change in object-oriented programming , 2004, IEEE Software.

[24]  Elaine J. Weyuker,et al.  Evaluating Software Complexity Measures , 2010, IEEE Trans. Software Eng..

[25]  L. Erlikh,et al.  Leveraging legacy system dollars for e-business , 2000 .

[26]  Emad Shihab,et al.  An Exploratory Study on Self-Admitted Technical Debt , 2014, 2014 IEEE International Conference on Software Maintenance and Evolution.

[27]  Premkumar T. Devanbu,et al.  A simpler model of software readability , 2011, MSR '11.

[28]  Y. Benjamini,et al.  Controlling the false discovery rate: a practical and powerful approach to multiple testing , 1995 .

[29]  Alexander Serebrenik,et al.  By no means: a study on aggregating software metrics , 2011, WETSoM '11.

[30]  Sven Apel,et al.  Measuring and modeling programming experience , 2013, Empirical Software Engineering.

[31]  Robert B. Grady,et al.  Practical Software Metrics for Project Management and Process Improvement , 1992 .

[32]  Dewayne E. Perry,et al.  Toward understanding the rhetoric of small source code changes , 2005, IEEE Transactions on Software Engineering.

[33]  Marco Tulio Valente,et al.  Why we refactor? confessions of GitHub contributors , 2016, SIGSOFT FSE.

[34]  Tauno Kekäle,et al.  Beautiful Code. Leading Programmers Explain How They Think , 2009 .

[35]  Andrew Meneely,et al.  Do bugs foreshadow vulnerabilities? An in-depth study of the chromium project , 2016, Empirical Software Engineering.

[36]  E. Murphy-Hill,et al.  Refactoring Tools: Fitness for Purpose , 2006, IEEE Software.

[37]  Ward Cunningham,et al.  The WyCash portfolio management system , 1992, OOPSLA '92.

[38]  Thierry Coq,et al.  The SQALE Analysis Model: An Analysis Model Compliant with the Representation Condition for Assessing the Quality of Software Source Code , 2010, 2010 Second International Conference on Advances in System Testing and Validation Lifecycle.

[39]  Kent Beck Implementation Patterns , 2007 .

[40]  Alexander Serebrenik,et al.  Beyond Technical Aspects: How Do Community Smells Influence the Intensity of Code Smells? , 2018, IEEE Transactions on Software Engineering.

[41]  Anas N. Al-Rabadi,et al.  A comparison of modified reconstructability analysis and Ashenhurst‐Curtis decomposition of Boolean functions , 2004 .

[42]  Westley Weimer,et al.  Learning a Metric for Code Readability , 2010, IEEE Transactions on Software Engineering.

[43]  Alexander Chatzigeorgiou,et al.  Investigating the evolution of code smells in object-oriented systems , 2014, Innovations in Systems and Software Engineering.

[44]  Gabriele Bavota,et al.  Automatically Assessing Code Understandability , 2019, IEEE Transactions on Software Engineering.

[45]  F. Wilcoxon Individual Comparisons by Ranking Methods , 1945 .

[46]  Alexander Serebrenik,et al.  An Empirical Study on the Removal of Self-Admitted Technical Debt , 2017, 2017 IEEE International Conference on Software Maintenance and Evolution (ICSME).

[47]  Gabriele Bavota,et al.  Improving Code: The (Mis) Perception of Quality Metrics , 2018, 2018 IEEE International Conference on Software Maintenance and Evolution (ICSME).

[48]  Tuan Nguyen,et al.  "Automatically Assessing Code Understandability" Reanalyzed: Combined Metrics Matter , 2018, 2018 IEEE/ACM 15th International Conference on Mining Software Repositories (MSR).

[49]  Maurizio Morisio,et al.  Evolution of understandability in OSS projects , 2004, Eighth European Conference on Software Maintenance and Reengineering, 2004. CSMR 2004. Proceedings..

[50]  Andy Oram,et al.  Beautiful Code: Leading Programmers Explain How They Think (Theory in Practice (O'Reilly)) , 2007 .

[51]  Alexander Serebrenik,et al.  You can't control the unfamiliar: A study on the relations between aggregation techniques for software metrics , 2011, 2011 27th IEEE International Conference on Software Maintenance (ICSM).

[52]  Keith H. Bennett,et al.  Software maintenance and evolution: a roadmap , 2000, ICSE '00.

[53]  Alexander Serebrenik,et al.  Eclipse API usage: the good and the bad , 2013, Software Quality Journal.

[54]  Harvey P. Siy,et al.  Predicting Fault Incidence Using Software Change History , 2000, IEEE Trans. Software Eng..

[55]  Jim A. McCall,et al.  Factors in Software Quality. Volume I. Concepts and Definitions of Software Quality , 1977 .

[56]  M. Hubert,et al.  An adjusted boxplot for skewed distributions , 2008, Comput. Stat. Data Anal..

[57]  Daniel M. Germán,et al.  The promises and perils of mining git , 2009, 2009 6th IEEE International Working Conference on Mining Software Repositories.

[58]  Andrew Glover,et al.  Continuous Integration: Improving Software Quality and Reducing Risk (The Addison-Wesley Signature Series) , 2007 .

[59]  CunninghamWard The WyCash portfolio management system , 1992 .

[60]  Robert C. Martin Clean Code - a Handbook of Agile Software Craftsmanship , 2008 .

[61]  Barry Boehm,et al.  Evaluating Human-Assessed Software Maintainability Metrics , 2016 .

[62]  Jonathan Dorn A General Software Readability Model , 2012 .

[63]  Daniela E. Damian,et al.  Selecting Empirical Methods for Software Engineering Research , 2008, Guide to Advanced Empirical Software Engineering.

[64]  Diomidis Spinellis,et al.  The Evolution of C Programming Practices: A Study of the Unix Operating System 1973-2015 , 2016, 2016 IEEE/ACM 38th International Conference on Software Engineering (ICSE).

[65]  Foutse Khomh,et al.  Recommending when Design Technical Debt Should be Self-Admitted , 2017, 2017 IEEE International Conference on Software Maintenance and Evolution (ICSME).

[66]  S. Misra,et al.  Comparative study of cognitive complexity measures , 2008, 2008 23rd International Symposium on Computer and Information Sciences.

[67]  Gabriele Bavota,et al.  Automatically assessing code understandability: How far are we? , 2017, 2017 32nd IEEE/ACM International Conference on Automated Software Engineering (ASE).