Attributes Influencing the Reading and Comprehension of Source Code – Discussing Contradictory Evidence

Authors

DOI:

https://doi.org/10.19153/cleiej.21.1.5

Keywords:

Source code quality, Readability, Comprehensibility, Experimental Software Engineering

Abstract

Background: Coding guidelines can be contradictory despite their intention of providing a universal perspective on source code quality. For instance, five attributes (code size, semantic complexity, internal documentation, layout style, and identifier length) out of 13 presented contradictions regarding their influence (positive or negative) on the source code readability and comprehensibility. Aims: To investigate source code attributes and their influence on readability and comprehensibility. Method: A literature review was used to identify source code attributes impacting the source code reading and comprehension, and an empirical study was performed to support the assessment of four attributes that presented empirical contradictions in the technical literature. Results: Regardless participants’ experience; all participants showed more positive comprehensibility perceptions for Python snippets with more lines of code. However, their readability perceptions regarding code size were contradictory. The less experienced participants preferred more lines of code while the more experienced ones preferred fewer lines of code. Long and complete-word identifiers presented better readability and comprehensibility according to both novices and experts. Comments contribute to better comprehension. Furthermore, four indentation spaces dominated the code reading preference. Conclusions: Coding guidelines contradictions still demand further investigation to provide indications on possible confounding factors explaining some of the inconclusive results.

Author Biographies

Talita Vieira Ribeiro, Federal University of Rio de Janeiro

Talita Vieira Ribeiro is a D.Sc. student working in the Experimental Software Engineering Group at the Federal University of Rio de Janeiro (UFRJ). She holds a masters degree in Systems Engineering and Computer Science from UFRJ, and a B.Sc. degree in Computer Science from the Federal University of Para (UFPA). Her current research interest are Evidence-based Software Engineering, and Source Code Review and Quality. Her work involves Knowledge Translation in the Software Engineering field.

Guilherme Horta Travassos, Federal University of Rio de Janeiro

Guilherme Horta Travassos (GHT) is a Professor of Software Engineering at COPPE/UFRJ and a CNPq (Brazilian Research Council) 1D Researcher. He holds a D.Sc. in Systems Engineering and Computer Science from COPPE/UFRJ, with a post-doc in Experimental Software Engineering at the University of Maryland/ College Park - USA. He heads the Experimental Software Engineering Group at COPPE/UFRJ and is a member of ISERN, SBC and ACM. Apart from that, he is an associate editor of Elsevier - Information and Software Technology (IST), and takes part in the editorial board of World Scientific – International Journal of Software Engineering and Knowledge Engineering (IJSEKE), Springer Open - Journal of Software Engineering Research and Development (JSERD), and e-Informatica Software Engineering Journal (EISEJ). Further information regarding his research interests and publications can be obtained at http://www.cos.ufrj.br/~ght.

References

[1] B. Kitchenham and S. L. Pfleeger, "Software quality: the elusive target," IEEE Software, vol. 1, no. 13, pp. 12-21, January 1996.
[2] B. Boehm and V. R. Basili, "Software defect reduction top 10 list," Computer, vol. 34, no. 1, pp. 135-137, January 2001.
[3] T. V. Ribeiro and G. H. Travassos, "On the alignment of source code quality perspectives through experimentation: an industrial case," in Proceedings of the 3rd International Workshop on Conducting Empirical Studies in Industry (CESI/ICSE 2015), Florence, Italy, 2015.
[4] R. P. L. Buse and W. R. Weimer, "Learning a metric for code readability," IEEE Transactions on Software Engineering, vol. 36, no. 4, pp. 546-558, 2010.
[5] J. Börstler and B. Paech, "The role of method chains and comments in software readability and comprehension - An experiment," IEEE Transactions on Software Engineering, vol. 9, pp. 886-898, 2016.
[6] P. Oman and C. Cook, "A paradigm for programming style research," ACM SIGPLAN Notices, vol. 23, no. 12, pp. 69-78, 1988.
[7] T. V. Ribeiro and G. H. Travassos, "Who is right? Evaluating empirical contradictions in the readability and comprehensibility of source code," in Proceedings of the XX Ibero-American Conference on Software Engineering, Buenos Aires, 2017.
[8] J. Kreimer, "Adaptive detection of design flaws," Electronic Notes in Theoretical Computer Science, vol. 141, no. 4, p. 117–136, 2005.
[9] M. Alshayeb, "Empirical investigation of refactoring effect on software quality," Information and Software Technology, vol. 51, no. 9, pp. 1319-1326, 2009.
[10] J. Rilling and S. P. Mudur, "3D visualization techniques to support slicing-based program comprehension," Computers and Graphics, vol. 29, no. 3, pp. 311-329, 2005.
[11] R. Novais, C. Nunes, C. Lima, E. Cirilo, F. Dantas, A. Garcia and M. Mendonca, "On the proactive and interactive visualization for feature evolution comprehension: an industrial investigation," in Proceedings of the 34th International Conference on Software Engineering, Zurich, 2012.
[12] G. K. Rambally, "The influence of color on program readability and comprehensibility," in Proceedings of the Seventeenth SIGCSE Technical Symposium on Computer Science Education, New York, 1986.
[13] D. Lawrie, C. Morrell, H. Feild and D. Binkley, "What's in a name? A study of identifiers," in Proceedings of the 14th IEEE International Conference on Program Comprehension, Athens, 2006.
[14] D. Lawrie, C. Morrell, H. Feild and D. Binkley, "Effective identifier names for comprehension and memory," Innovations in Systems and Software Engineering, vol. 3, no. 4, pp. 303-318, 2007.
[15] R. P. L. Buse and W. R. Weimer, "A metric for software readability," in Proceedings of the 2008 International Symposium on Software Testing and Analysis, New York, 2008.
[16] D. Posnett, A. Hindle, and P. Devanbu, "A simpler model of software readability," in Proceedings of the 8th Working Conference on Mining Software Repositories, New York, 2011.
[17] J. Biolchini, P. G. Mian, A. C. C. Natali and G. H. Travassos, "Systematic review in software engineering," Rio de Janeiro, 2005.
[18] T. Ribeiro, Alinhando perspectivas de qualidade em código fonte a partir de estudos experimentais – um caso na indústria, Master Dissertation: COPPE / Universidade Federal do Rio de Janeiro, 2014, p. 161.
[19] A. A. Takang, P. A. Grubb, and R. D. Macredie, "The effects of comments and identifier names on program comprehensibility: an experimental investigation," Journal of Programming Languages, vol. 4, pp. 143-167, 1996.
[20] D. Malbaski, A. Kupusinac, and S. Popov, "The impact of coding style on the readability of C programs," Technics Technologies Education Management, vol. 6, no. 4, pp. 1073-1082, 2011.
[21] G. E. DeYoung and G. R. Kampen, "Program factors as predictors of program readability," in Proceedings of the Third IEEE Computer Society's International Computer Software and Applications Conference, 1979.
[22] A. H. Jørgensen, "A methodology for measuring the readability and modifiability of computer programs," BIT Numerical Mathematics, vol. 20, pp. 393-405, 1980.
[23] S. Woodfield, H. Dunsmore and V. Shen, "Effect of modularization and comments on program comprehension," in Proceedings of the 5th International Conference on Software Engineering, Piscataway, 1981.
[24] R. J. Miara, J. A. Musselman, J. A. Navarro and B. Shneiderman, "Program indentation and comprehensibility," Communications of the ACM, vol. 26, no. 11, pp. 861-867, 1983.
[25] T. Tenny, "Program readability: procedures versus comments," IEEE Transactions on Software Engineering, vol. 14, no. 9, pp. 1271-1279, 1988.
[26] B. Teasley, "The effects of naming style and expertise on program comprehension," International Journal of Human-Computer Studies, vol. 40, no. 5, pp. 757-770, 1994.
[27] D. Binkley, M. B. Davis, D. A. Lawrie and C. A. Morrell, "To camelcase or under_score," in Proceedings of the 17th IEEE International Conference on Program Comprehension, Vancouver, 2009.
[28] B. Sharif and J. Maletic, "An eye-tracking study on camelCase and under_score identifier styles," in Proceedings of the IEEE 18th International Conference on Program Comprehension, Braga, 2010.
[29] S. Butler, M. Wermelinger, Y. Yu and H. Sharp, "Exploring the influence of identifier names on code quality: An empirical study," in Proceedings of 14th European Conference on Software Maintenance and Reengineering, Madrid, 2011.
[30] J. Feigenspan, S. Apel, J. Liebig and C. Kästner, "Exploring software measures to assess program comprehension," in Proceedings of the International Symposium on Empirical Software Engineering and Measurement, Banff, 2011.
[31] Z. Sharafi, Z. Soh, Y.-g. Guéhéneuc and G. Antoniol, "Women and men - different but equal: on the impact of identifier style on source code reading," in Proceedings of the IEEE 20th International Conference on Program Comprehension, Passau, 2012.
[32] D. A. Binkley, M. C. Davis, D. A. Lawrie, J. I. D. Maletic, C. B. Morrell and B. E. Sharif, "The impact of identifier style on effort and comprehension," Empirical Software Engineering, vol. 18, no. 2, pp. 219-276, 2013.
[33] T. Lee, J. Lee and H. In, "A study of different coding styles affecting code readability," International Journal of Software Engineering and Its Applications, vol. 7, no. 5, pp. 413-422, 2013.
[34] Y. Sasaki, Y. Higo and S. Kusumoto, "Reordering program statements for improving readability," in Proceedings of the 17th European Conference on Software Maintenance and Reengineering, Genova, 2013.
[35] Y. Tashtoush, Z. Odat, I. Alsmadi, and M. Yatim, "Impact of Programming Features on Code Readability," International Journal of Software Engineering and Its Applications, vol. 7, no. 6, pp. 441-458, 2013.
[36] T. Lee, J. Lee and H. In, "Effect analysis of coding convention violations on readability of post-delivered code," IEICE Transactions on Information and Systems, Vols. E98-D, no. 7, pp. 1286-1296, 2015.
[37] A. Dunsmore and M. Roper, "A comparative evaluation of program comprehension measures," The Journal of Systems and Software, vol. 52, no. 3, pp. 121-129, June 2000.
[38] J. Siegmund, C. Kästner, S. A. Jörg Liebig and S. Hanenberg, "Measuring and modeling programming experience," Empirical Software Engineering, vol. 19, no. 5, pp. 1299-1334, 2014.
[39] H. Zhang, M. A. Babar and P. Tell, "Identifying relevant studies in software engineering," Journal Information and Software Technology, vol. 53, no. 6, pp. 625-637, 2011.

Downloads

Published

2018-04-01