Skip to main content

Advertisement

Log in

How does code readability change during software evolution?

  • Published:
Empirical Software Engineering Aims and scope Submit manuscript

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.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Institutional subscriptions

Fig. 1
Fig. 2
Fig. 3
Fig. 4
Fig. 5
Fig. 6
Fig. 7

Similar content being viewed by others

Notes

  1. https://dibt.unimol.it/report/readability/

  2. Commit c69c7b in the project android_packages_apps_Settings.

  3. Book-App-Java-Servlet-Ejb-Jpa-Jpql, commit 36861: https://git.io/fjLfp

  4. Undertow, commit f8fcc: https://git.io/Jf1pt

  5. LinkedIn ParSeq, commit f3d9c: https://git.io/JfiqM

  6. >LinkedIn ParSeq, commit ce2ae: https://git.io/Jf6jp

  7. LinkedIn ParSeq, commit fc27e: https://git.io/Jfim5

  8. LinkedIn ParSeq, commit 8d7a3: https://git.io/JfwPs

  9. LinkedIn ParSeq, commit a9758: https://git.io/JfwXR

  10. Apache Tomcat, commit 7d99e: https://git.io/fjLRw

  11. Apache Beam, commit 7126f: https://git.io/fjLR9

  12. Apache Qpid-broker-j, commit 2d90e: https://git.io/fjLRl

  13. Apache Deltaspike, commit 36861: https://git.io/fhHpp

  14. Apache Incubator Skywalking, commit ca90b: https://git.io/JeB5z

  15. The ones by Oracle, http://www.oracle.com/technetwork/java/codeconventions-150003.pdf, and the ones by Google, https://google.github.io/styleguide/javaguide.html

  16. Apache Incubator Skywalking, commit d4333: https://git.io/JeB9a

  17. Apache Falcon, commit 3769e: https://git.io/JeBbW

  18. Apache Incubator Skywalking, commit bc38a: https://git.io/JeB50

  19. Reactive RxJava, commit 0499c: https://git.io/JeREW

  20. Apache Tomcat, commit 7d99e: https://git.io/fjLR2

  21. Apache Hadoop, commit 34cc2: https://git.io/JeRZK

References

  • Bavota G, De Lucia A, Di Penta M, Oliveto R, Palomba F (2015) An experimental investigation on the innate relationship between quality and refactoring. J Syst Softw 107:1–14

    Article  Google Scholar 

  • Beck K (2007) Implementation patterns, Addison Wesley

  • Benjamini Y, Hochberg Y (1995) Controlling the false discovery rate: a practical and powerful approach to multiple testing. Journal of the Royal statistical society: series B (Methodological) 57(1):289–300

    MathSciNet  MATH  Google Scholar 

  • Bennett KH, Rajlich VT (2000) Software maintenance and evolution: A roadmap. In: Proceedings of the Conference on The Future of Software Engineering, pp 73–87

  • Bird C, Rigby PC, Barr ET, Hamilton DJ, Germán DM, Devanbu PT (2009) The promises and perils of mining git. In: Godfrey M W, Whitehead J (eds) Proceedings of the 6th International Working Conference on Mining Software Repositories, MSR 2009 (Co-located with ICSE), Vancouver, BC, Canada, May 16-17, 2009, Proceedings. IEEE Computer Society, pp 1–10

  • Boehm BW, Brown JR, Kaspar H, Lipow M, Macleod GJ, Merrit MJ (1978) Characteristics of software quality TRW series of software technology Elsevier, 1

  • Buse RPL, Weimer WR (2008) A metric for software readability. In: Proceedings of the 2008 international symposium on Software testing and analysis, ACM, pp 121–130

  • Buse RPL, Weimer WR (2010) Learning a metric for code readability. IEEE Trans Softw Eng 36(4):546–558

    Article  Google Scholar 

  • Businge J, Serebrenik A, van den Brand MGJ (2015) Eclipse API usage: the good and the bad. Softw Qual J 23(1):107–141. https://doi.org/10.1007/s11219-013-9221-3

    Article  Google Scholar 

  • Capiluppi A, Morisio M, Lago P (2004) Evolution of understandability in oss projects. In: Eighth European Conference on Software Maintenance and Reengineering, 2004. CSMR 2004. Proceedings., IEEE, pp 58–66

  • Chatzigeorgiou A, Manakos A (2014) Investigating the evolution of code smells in object-oriented systems. Innov Syst Softw Eng 10(1):3–18

    Article  Google Scholar 

  • Chen C, Alfayez R, Srisopha K, Shi L, Boehm B (2016) Evaluating human-assessed software maintainability metrics. In: National Software Application Conference, Springer, pp 120–132

  • Chernick MR (2011) Bootstrap methods: A guide for practitioners and researchers, John Wiley & Sons, vol 619

  • Cliff N (1993) Dominance statistics: Ordinal analyses to answer ordinal questions. Psychol Bull 114(3):494

    Article  Google Scholar 

  • Cunningham W (1993) The wycash portfolio management system. OOPS Messenger 4(2):29–30

    Article  Google Scholar 

  • DiCiccio TJ, Efron B (1996) Bootstrap confidence intervals. Stat sci 82:189–212

    MathSciNet  MATH  Google Scholar 

  • Dorn J (2012) A general software readability model, Master’s Thesis, University of Virginia, http://www.cs.virginia.edu/~weimer/students/dorn-mcs-paper.pdf

  • Duvall PM, Matyas S, Glover A (2007) Continuous integration: improving software quality and reducing risk, Pearson Education

  • Easterbrook S, Singer J, Storey M-A, Damian D (2008) Selecting empirical methods for software engineering research. In: Shull F, Singer J, Sjøberg D I K (eds) Guide to Advanced Empirical Software Engineering. Springer, pp 285–311

  • Ebert F, Castor F, Novielli N, Serebrenik A (2019) Confusion in code reviews: Reasons, impacts, and coping strategies. In: Wang X, Lo D, Shihab E (eds) 26th IEEE International Conference on Software Analysis, Evolution and Reengineering, SANER 2019, Hangzhou, China, February 24-27, 2019. IEEE, pp 49–60

  • Erlikh L (2000) Leveraging legacy system dollars for e-business. IT Professional 2(3):17–23. https://doi.org/10.1109/6294.846201

    Article  Google Scholar 

  • Fakhoury S, Roy D, Hassan S, Arnaoudova V (2019) Improving source code readability: theory and practice. In: 2019 IEEE/ACM 27th International Conference on Program Comprehension (ICPC), pp 2–12

  • Fowler M, Foemmel M (2006) Continuous integration. Thought-Works 122:14. http://www.thoughtworks.com/ContinuousIntegration.pdf

    Google Scholar 

  • Grady RB (1992) Practical software metrics for project management and process improvement, Prentice-Hall, Inc.

  • Graves TL, Karr AF, Marron JS, Siy H (2000) Predicting fault incidence using software change history. IEEE Trans Softw Eng 26(7):653–661

    Article  Google Scholar 

  • Halstead MH (1977) Elements of software science Operating and programming systems series Elsevier 7

  • Hubert M, Vandervieren E (2008) An adjusted boxplot for skewed distributions. Computational statistics & data analysis 52(12):5186–5201

    Article  MathSciNet  Google Scholar 

  • Kalliamvakou E, Gousios G, Blincoe K, Singer L, Germán D M, Damian D E (2016) An in-depth study of the promises and perils of mining GitHub. Empir Softw Eng 21(5):2035–2071. https://doi.org/10.1007/s10664-015-9393-5

    Article  Google Scholar 

  • Lee T, Lee J-B, In H P (2015) Effect analysis of coding convention violations on readability of post-delivered code. IEICE Transactions 98-D(7):1286–1296. https://doi.org/10.1587/transinf.2014EDP7327

    Article  Google Scholar 

  • Letouzey J-L, Coq T (2010) The sqale analysis model: An analysis model compliant with the representation condition for assessing the quality of software source code. In: IEEE Second International Conference on Advances in System Testing and Validation Lifecycle, pp 43–48

  • Likert R (1932) A technique for the measurement of attitudes Archives of psychology

  • Maldonado ES, Abdalkareem R, Shihab E, Serebrenik A (2017) An empirical study on the removal of self-admitted technical debt. In: 2017 IEEE International Conference on Software Maintenance and Evolution (ICSME), IEEE, pp 238–248

  • Martin RC (2009) Clean code: A handbook of agile sofware craftsmanship Prentice Hall

  • McCabe TJ (1976) A complexity measure. IEEE Trans Softw Eng SE-2(4):308–320. https://doi.org/10.1109/TSE.1976.233837

    Article  MathSciNet  Google Scholar 

  • McCall JA, Richards PK, Walters GF (1977) Factors in software quality: Vol. 1: Concepts and definitions of software quality General Electric

  • Misra S, Akman I (2008) Comparative study of cognitive complexity measures. In: IEEE 2008 23rd International Symposium on Computer and Information Sciences, pp 1–4

  • Munaiah N, Camilo F, Wigham W, Meneely A, Nagappan M (2017) Do bugs foreshadow vulnerabilities? an in-depth study of the chromium project. Empir Softw Eng 22(3):1305–1347. https://doi.org/10.1007/s10664-016-9447-3

    Article  Google Scholar 

  • Murphy-Hill E, Black AP (2008) Refactoring tools: Fitness for purpose. IEEE Softw 25(5):38–44

    Article  Google Scholar 

  • Oram A, Wilson G (2007) Beautiful code: Leading programmers explain how they think O’reilly

  • Palomba F, Tamburri DA, Fontana FA, Oliveto R, Zaidman A, Serebrenik A (2018) Beyond technical aspects: How do community smells influence the intensity of code smells?, IEEE Trans Softw Eng

  • Pantiuchina J, Lanza M, Bavota G (2018) Improving code: The (mis) perception of quality metrics. In: 2018 IEEE International Conference on Software Maintenance and Evolution (ICSME), pp 80–91

  • Piantadosi V, Fierro F, Scalabrino S, Serebrenik A, Oliveto R (2020) Replication package. https://dibt.unimol.it/report/readability-evolution-emse

  • Posnett D, Hindle A, Devanbu P (2011) A simpler model of software readability. In: ACM Proceedings of the 8th Working Conference on Mining Software Repositories, pp 73–82

  • Potdar A, Shihab E (2014) An exploratory study on self-admitted technical debt. In: 30th IEEE International Conference on Software Maintenance and Evolution, Victoria, BC, Canada, September 29 - October 3, 2014. IEEE Computer Society, pp 91–100. https://doi.org/10.1109/ICSME.2014.31

  • Purushothaman R, Perry DE (2005) Toward understanding the rhetoric of small source code changes. IEEE Trans Softw Eng 31(6):511–526

    Article  Google Scholar 

  • Rajlich V, Gosavi P (2004) Incremental change in object-oriented programming. IEEE Softw. 21(4):62–69. https://doi.org/10.1109/MS.2004.17

    Article  Google Scholar 

  • Runeson P, Höst M, Rainer A, Regnell B (2012) Case study research in software engineering - guidelines and examples Wiley, http://eu.wiley.com/WileyCDA/WileyTitle/productCd-1118104358.html

  • Scalabrino S, Bavota G, Vendome C, Linares-Vásquez M, Poshyvanyk D, Oliveto R (2017) Automatically assessing code understandability: How far are we?. In: Proceedings of the 32nd IEEE/ACM International Conference on Automated Software Engineering, IEEE Press, pp 417–427

  • Scalabrino S, Bavota G, Vendome C, Poshyvanyk D, Oliveto R (2019) Automatically assessing code understandability, IEEE Trans Softw Eng

  • Scalabrino S, Linares-Vásquez M, Oliveto R, Poshyvanyk D (2018) A comprehensive model for code readability. Journal of Software: Evolution and Process 30(6):1958. https://doi.org/10.1002/smr.1958

    Article  Google Scholar 

  • Scalabrino S, Linares-Vásquez M, Poshyvanyk D, Oliveto R (2016) Improving code readability models with textual features. In: IEEE Program Comprehension (ICPC), 2016 IEEE 24th International Conference on, pp 1–10

  • Sheskin D J (2007) Handbook of parametric and nonparametric statistical procedures 4 Chapman & Hall/CRC

  • Siegmund J, Kästner C, Liebig J, Apel S, Hanenberg S (2014) Measuring and modeling programming experience. Empir Softw Eng 19(5):1299–1334. https://doi.org/10.1007/s10664-013-9286-4

    Article  Google Scholar 

  • Silva D, Tsantalis N, Valente MT (2016) Why we refactor? confessions of GitHub contributors ACM Proceedings of the 2016 24th ACM SIGSOFT International Symposium on Foundations of Software Engineering, pp 858–870

  • Spinellis D, Louridas P, Kechagia M (2016) The evolution of C programming practices: a study of the unix operating system 1973-2015. In: Dillon L K, Visser W, Williams L (eds) Proceedings of the 38th International Conference on Software Engineering, ICSE 2016, Austin, TX, USA, May 14-22, 2016. ACM, pp 748–759

  • Thongmak M, Muenchaisri P (2011) Measuring understandability of aspect-oriented code. In: International Conference on Digital Information and Communication Technology and Its Applications, Springer, pp 43–54

  • Trockman A, Cates K, Mozina M, Nguyen T, Kästner C, Vasilescu B (2018) Automatically assessing code understandability reanalyzed: combined metrics matter. In: ACM Proceedings of the 15th International Conference on Mining Software Repositories, pp 314–318

  • Tufano M, Palomba F, Bavota G, Oliveto R, Di Penta M, De Lucia A, Poshyvanyk D (2017) When and why your code starts to smell bad (and whether the smells go away). IEEE Trans Softw Eng 43(11):1063–1088

    Article  Google Scholar 

  • Vasilescu B, Serebrenik A, van den Brand M G J (2011) By no means: a study on aggregating software metrics. In: Concas G, Tempero E D, Zhang H, Di Penta M (eds) Proceedings of the 2nd International Workshop on Emerging Trends in Software Metrics, WETSoM 2011, Waikiki, Honolulu, HI, USA, May 24, 2011. ACM, pp 23–26. https://doi.org/10.1145/1985374.1985381

  • Vasilescu B, Serebrenik A, van den Brand M G J (2011) You can’t control the unfamiliar: A study on the relations between aggregation techniques for software metrics. In: IEEE 27th international conference on software maintenance, ICSM 2011, williamsburg, va, usa, september 25-30, 2011. IEEE Computer Society, pp 313–322. https://doi.org/10.1109/ICSM.2011.6080798

  • Weyuker EJ (1988) Evaluating software complexity measures. IEEE transactions on Software Engineering 14(9):1357–1365

    Article  MathSciNet  Google Scholar 

  • Wilcoxon F (1945) Individual comparisons by ranking methods. biometrics bulletin 1, 6 (1945), 80–83, http://www.jstor.org/stable/3001968

  • Zampetti F, Noiseux C, Antoniol G, Khomh F, Di Penta M (2017) Recommending when design technical debt should be self-admitted. In: 2017 IEEE International Conference on Software Maintenance and Evolution, ICSME 2017, Shanghai, China, September 17-22, 2017. IEEE Computer Society, pp 216–226. https://doi.org/10.1109/ICSME.2017.44

  • Zampetti F, Serebrenik A, Penta M D (2018) Was self-admitted technical debt removal a real removal?: an in-depth perspective. In: Zaidman A, Kamei Y, Hill E (eds) Proceedings of the 15th International Conference on Mining Software Repositories, MSR 2018, Gothenburg, Sweden, May 28-29, 2018. ACM, pp 526–536. https://doi.org/10.1145/3196398.3196423

  • Zhao Y, Serebrenik A, Zhou Y, Filkov V, Vasilescu B (2017) The impact of continuous integration on other software development practices: a large-scale empirical study. In: IEEE Press Proceedings of the 32nd IEEE/ACM International Conference on Automated Software Engineering, pp 60–71

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Rocco Oliveto.

Additional information

Communicated by: Meiyappan Nagappan

Publisher’s note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Rights and permissions

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Piantadosi, V., Fierro, F., Scalabrino, S. et al. How does code readability change during software evolution?. Empir Software Eng 25, 5374–5412 (2020). https://doi.org/10.1007/s10664-020-09886-9

Download citation

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s10664-020-09886-9

Keywords

Navigation