The Role of Method Chains and Comments in Software Readability and Comprehension—An Experiment

Software readability and comprehension are important factors in software maintenance. There is a large body of research on software measurement, but the actual factors that make software easier to read or easier to comprehend are not well understood. In the present study, we investigate the role of method chains and code comments in software readability and comprehension. Our analysis comprises data from 104 students with varying programming experience. Readability and comprehension were measured by perceived readability, reading time and performance on a simple cloze test. Regarding perceived readability, our results show statistically significant differences between comment variants, but not between method chain variants. Regarding comprehension, there are no significant differences between method chain or comment variants. Student groups with low and high experience, respectively, show significant differences in perceived readability and performance on the cloze tests. Our results do not show any significant relationships between perceived readability and the other measures taken in the present study. Perceived readability might therefore be insufficient as the sole measure of software readability or comprehension. We also did not find any statistically significant relationships between size and perceived readability, reading time and comprehension.

[1]  Curtis R. Cook,et al.  A preliminary investigation of the use of the cloze procedure as a measure of program understanding , 1984, Inf. Process. Manag..

[2]  Richard Taffler,et al.  Readability and Understandability: Different Measures of the Textual Complexity of Accounting Narrative , 1992 .

[3]  Dietmar Pfahl,et al.  Reporting Experiments in Software Engineering , 2008, Guide to Advanced Empirical Software Engineering.

[4]  Robert D. Macredie,et al.  The effects of comments and identifier names on program comprehensibility: an experimental investigation , 1996, J. Program. Lang..

[5]  John R. Foster Cost factors in software maintenance , 1993 .

[6]  Donald E. Knuth,et al.  Literate Programming , 1984, Comput. J..

[7]  William H. DuBay The Principles of Readability. , 2004 .

[8]  Cristina Marinescu,et al.  Are the Clients of Flawed Classes (Also) Defect Prone? , 2011, 2011 IEEE 11th International Working Conference on Source Code Analysis and Manipulation.

[9]  Scott N. Woodfield,et al.  The effect of modularization and comments on program comprehension , 1981, ICSE '81.

[10]  Mauricio A. Saca Refactoring improving the design of existing code , 2017, 2017 IEEE 37th Central America and Panama Convention (CONCAPAN XXXVII).

[11]  Herb Sutter,et al.  C++ Coding Standards: 101 Rules, Guidelines, and Best Practices (C++ in Depth Series) , 2004 .

[12]  Siw Elisabeth Hove,et al.  The impact of UML documentation on software maintenance: an experimental evaluation , 2006, IEEE Transactions on Software Engineering.

[13]  Ted Tenny,et al.  Program Readability: Procedures Versus Comments , 1988, IEEE Trans. Software Eng..

[14]  Margaret-Anne D. Storey,et al.  Theories, tools and research methods in program comprehension: past, present and future , 2006, Software Quality Journal.

[15]  Thomas D. LaToza,et al.  Maintaining mental models: a study of developer work habits , 2006, ICSE.

[16]  Karl J. Lieberherr,et al.  Assuring good style for object-oriented programs , 1989, IEEE Software.

[17]  Yijun Yu,et al.  Exploring the Influence of Identifier Names on Code Quality: An Empirical Study , 2010, 2010 14th European Conference on Software Maintenance and Reengineering.

[18]  Felix Hueber The Elements Of Java Style , 2016 .

[19]  B. J. Ferro Castro,et al.  Pattern-Oriented Software Architecture: A System of Patterns , 2009 .

[20]  E. Nurvitadhi,et al.  Do class comments aid Java program understanding? , 2003, 33rd Annual Frontiers in Education, 2003. FIE 2003..

[21]  W. Kintsch,et al.  Reading comprehension and readability in educational practice and psychological theory , 1979 .

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

[23]  ZimmermannThomas,et al.  An Empirical Study of RefactoringChallenges and Benefits at Microsoft , 2014 .

[24]  Claes Wohlin,et al.  Experimentation in Software Engineering , 2000, The Kluwer International Series in Software Engineering.

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

[26]  Gretchen Hargis,et al.  Readability and computer documentation , 2000, AJCD.

[27]  Kai Petersen ImplemenTIng leAn And AgIle SofTwARe developmenT In InduSTRy , 2010 .

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

[29]  Vu Nguyen,et al.  Improved size and effort estimation models for software maintenance , 2010, 2010 IEEE International Conference on Software Maintenance.

[30]  Joshua Kerievsky,et al.  Refactoring to Patterns , 2004, XP/Agile Universe.

[31]  Dawn J. Lawrie,et al.  The impact of identifier style on effort and comprehension , 2012, Empirical Software Engineering.

[32]  Sun-Jen Huang,et al.  An empirical analysis of the impact of software development problem factors on software maintainability , 2009, J. Syst. Softw..

[33]  Lionel E. Deimel,et al.  Reading Computer Programs: Instructor's Guide to Exercises , 1990 .

[34]  Anneliese Amschler Andrews,et al.  Program Comprehension During Software Maintenance and Evolution , 1995, Computer.

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

[36]  Marie Nordström,et al.  Beauty and the Beast--Toward a Measurement Framework for Example Program Quality , 2007 .

[37]  Janice Singer,et al.  How software engineers use documentation: the state of the practice , 2003, IEEE Software.

[38]  Bjarne Stroustrup,et al.  C++ Programming Language , 1986, IEEE Softw..

[39]  Michael Marcotty,et al.  Improving computer program readability to aid modification , 1982, CACM.

[40]  W. Taha,et al.  Plenary talk III Domain-specific languages , 2008, 2008 International Conference on Computer Engineering & Systems.

[41]  Aruna Raja,et al.  Domain Specific Languages , 2010 .

[42]  Curtis R. Cook,et al.  A programming style taxonomy , 1991, J. Syst. Softw..

[43]  Tom Lam,et al.  A software maintenance survey , 1994, Proceedings of 1st Asia-Pacific Software Engineering Conference.

[44]  Marie Nordström,et al.  Beauty and the Beast: on the readability of object-oriented example programs , 2015, Software Quality Journal.

[45]  Miryung Kim,et al.  An Empirical Study of RefactoringChallenges and Benefits at Microsoft , 2014, IEEE Transactions on Software Engineering.

[46]  Brian W. Kernighan,et al.  Elements of Programming Style , 1974 .

[47]  Diomidis Spinellis Code Documentation , 2010, IEEE Software.

[48]  Françoise Détienne,et al.  Software Design — Cognitive Aspects , 2001, Practitioner Series.

[49]  Yi Guo,et al.  An Empirical Validation of the Benefits of Adhering to the Law of Demeter , 2011, 2011 18th Working Conference on Reverse Engineering.

[50]  A. F. Norcio Indentation, documentation and programmer comprehension , 1982, CHI '82.

[51]  Ralph Johnson,et al.  design patterns elements of reusable object oriented software , 2019 .

[52]  Arthur J. Riel,et al.  Object-Oriented Design Heuristics , 1996 .

[53]  Stuart H. Zweben,et al.  The cloze procedure and software comprehensibility measurement , 1986, IEEE Transactions on Software Engineering.

[54]  Janice Singer,et al.  Guide to Advanced Empirical Software Engineering , 2007 .

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

[56]  David W. Binkley,et al.  Quantifying identifier quality: an analysis of trends , 2006, Empirical Software Engineering.

[57]  George R. Klare,et al.  Readable computer documentation , 2000, AJCD.