Nothing Special   »   [go: up one dir, main page]

skip to main content
10.1109/ICPC.2019.00014acmconferencesArticle/Chapter ViewAbstractPublication PagesicseConference Proceedingsconference-collections
research-article

Improving source code readability: theory and practice

Published: 25 May 2019 Publication History

Abstract

There are several widely accepted metrics to measure code quality that are currently being used in both research and practice to detect code smells and to find opportunities for code improvement. Although these metrics have been proposed as a proxy of code quality, recent research suggests that more often than not, state-of-the-art code quality metrics do not successfully capture quality improvements in the source code as perceived by developers. More specifically, results show that there may be inconsistencies between, on the one hand, the results from metrics for cohesion, coupling, complexity, and readability, and, on the other hand, the interpretation of these metrics in practice. As code improvement tools rely on these metrics, there is a clear need to identify and resolve the aforementioned inconsistencies. This will allow for the creation of tools that are more aligned with developers' perception of quality, and can more effectively help source code improvement efforts.
In this study, we investigate 548 instances of source code readability improvements, as explicitly stated by internal developers in practice, from 63 engineered software projects. We show that current readability models fail to capture readability improvements. We also show that tools to calculate additional metrics, to detect refactorings, and to detect style problems are able to capture characteristics that are specific to readability changes and thus should be considered by future readability models.

References

[1]
Checkstyle. http://checkstyle.sourceforge.net/, last accessed on March 15, 2019.
[2]
Replication package. https://github.com/Smfakhoury/Improving-Source-Code-Readability-Theory-and-Practice.
[3]
Venera Arnaoudova, Laleh Eshkevari, Massimiliano Di Penta, Rocco Oliveto, Giuliano Antoniol, and Yann-Gaël Guéhéneuc. REPENT: Analyzing the nature of identifier renamings. IEEE Transactions on Software Engineering (TSE), 40(5):502--532, 2014.
[4]
Gabriele Bavota, Bogdan Dit, Rocco Oliveto, Massimiliano Di Penta, Denys Poshyvanyk, and Andrea De Lucia. An empirical study on the developers' perception of software coupling. In Proceedings of the International Conference on Software Engineering (ICSE), pages 692--701, 2013.
[5]
Steven Bird, Ewan Klein, and Edward Loper. Natural language processing with Python: analyzing text with the natural language toolkit. " O'Reilly Media, Inc.", 2009.
[6]
Raymond P.L. Buse and Westley R. Weimer. Learning a metric for code readability. IEEE Transactions on Software Engineering (TSE), 36(4):546--558, July 2010.
[7]
Steve Counsell, Stephen Swift, Allan Tucker, and Emilia Mendes. Object-oriented cohesion subjectivity amongst experienced and novice developers: an empirical study. ACM SIGSOFT Software Engineering Notes, 31(5):1--10, September 2006.
[8]
Jonathan Dorn. A general software readability model. Master's thesis, University of Virginia, 2012.
[9]
Beat Fluri and Harald C. Gall. Classifying change types for qualifying change couplings. In Proceedings of the International Conference on Program Comprehension (ICPC), pages 35--45, 2006.
[10]
Beat Fluri, Michael Wuersch, Martin PInzger, and Harald Gall. Change distilling: Tree differencing for fine-grained source code change extraction. IEEE Transactions on software engineering, 33(11), 2007.
[11]
Robert J. Grissom and John J. Kim. Effect sizes for research: A broad practical approach. Lawrence Earlbaum Associates, 2nd edition edition, 2005.
[12]
Tibor Gyimóthy, Rudolf Ferenc, and István Siket. Empirical validation of object-oriented metrics on open source software for fault prediction. IEEE Transactions on Software Engineering (TSE), 31(10):897--910, October 2005.
[13]
Maurice H Halstead. Elements of software science. 1977.
[14]
Matthew Honnibal and Mark Johnson. An improved non-monotonic transition system for dependency parsing. In Proceedings of the 2015 Conference on Empirical Methods in Natural Language Processing, pages 1373--1378, Lisbon, Portugal, September 2015. Association for Computational Linguistics.
[15]
Michele Lanza and Radu Marinescu. Object-oriented metrics in practice: using software metrics to characterize, evaluate, and improve the design of object-oriented systems. Springer Science & Business Media, 2007.
[16]
FrontEndART Software Ltd. Sourcemeter. https://www.sourcemeter.com/, last accessed on March 15, 2019.
[17]
Andrian Marcus, Denys Poshyvanyk, and Rudolf Ferenc. Using the conceptual cohesion of classes for fault prediction in object-oriented systems. IEEE Transactions on Software Engineering (TSE), 34(2):287--30, 2008.
[18]
Thomas J. McCabe. A complexity measure. IEEE Transactions on Software Engineering (TSE), SE-2(4):308--320, 1976.
[19]
Mohamed Wiem Mkaouer, Marouane Kessentini, Slim Bechikh, Mel Ó Cinnéide, and Kalyanmoy Deb. On the use of many quality attributes for software refactoring: a many-objective search-based software engineering approach. Empirical Software Engineering, 21(6):2503--2545, 2016.
[20]
Naouel Moha, Yann-Gaël Guéhéneuc, Laurence Duchien, and Anne-Françoise Le Meur. DECOR: A method for the specification and detection of code and design smells. IEEE Transactions on Software Engineering (TSE), 36(1):20--36, January-February 2010.
[21]
Nuthan Munaiah, Steven Kroh, Craig Cabrey, and Meiyappan Nagappan. Curating github for engineered software projects. Empirical Software Engineering, 22(6):3219--3253, 2017.
[22]
Jevgenija Pantiuchina, Michele Lanza, and Gabriele Bavota. Improving code: The (mis) perception of quality metrics. In 2018 IEEE International Conference on Software Maintenance and Evolution (ICSME), pages 80--91. IEEE, 2018.
[23]
Martin F Porter. An algorithm for suffix stripping. Program, 14(3):130--137, 1980.
[24]
Daryl Posnett, Abram Hindle, and Premkumar Devanbu. A simpler model of software readability. In Proceedings of the Working Conference on Mining Software Repositories (MSR), pages 73--82, 2011.
[25]
Kata Praditwong, Mark Harman, and Xin Yao. Software module clustering as a multi-objective search problem. IEEE Transactions on Software Engineering, 37(2):264--282, 2011.
[26]
Meghan Revelle, Malcom Gethers, and Denys Poshyvanyk. Using structural and textual information to capture feature coupling in object-oriented software. Empirical Software Engineering (EMSE), 16(6):773--811, December 2011.
[27]
Simone Scalabrino, Gabriele Bavota, Christopher Vendome, Mario Linares-Vasquez, Denys Poshyvanyk, and Rocco Oliveto. Automatically assessing code understandability. IEEE Transactions on Software Engineering, pages 1--1, 2019.
[28]
Simone Scalabrino, Mario Linares-Vásquez, Rocco Oliveto, and Denys Poshyvanyk. A comprehensive model for code readability. Journal of Software: Evolution and Process, 30(6):e1958, 2018.
[29]
Simone Scalabrino, Mario Linares-Vasquez, Denys Poshyvanyk, and Rocco Oliveto. Improving code readability models with textual features. In Proceedings of the International Conference on Program Comprehension (ICPC), pages 1--10, 2016.
[30]
Nikolaos Tsantalis, Matin Mansouri, Laleh M Eshkevari, Davood Mazinanian, and Danny Dig. Accurate and efficient refactoring detection in commit history. pages 483--494, 2018.
[31]
Arie van Deursen. Think twice before using the 'maintainability index'. https://avandeursen.com/2014/08/29/think-twice-before-using-the-maintainability-index/.
[32]
Claes Wohlin, Per Runeson, Höst Martin, Magnus C. Ohlsson, Björn Regnell, and Anders Wesslén. Experimentation in Software Engineering - An Introduction. Kluwer Academic Publishers, 2000.
[33]
Robert K. Yin. Case Study Research: Design and Methods. Sage Publications, 2nd edition, 1994.
[34]
Thomas Zimmermann and Nachiappan Nagappan. Predicting defects using network analysis on dependency graphs. In Proceedings of the International Conference on Software Engineering (ICSE), pages 531--540. ACM, 2008.

Cited By

View all
  • (2024)R2I: A Relative Readability Metric for Decompiled CodeProceedings of the ACM on Software Engineering10.1145/36437441:FSE(383-405)Online publication date: 12-Jul-2024
  • (2023)From Code Complexity Metrics to Program ComprehensionCommunications of the ACM10.1145/354657666:5(52-61)Online publication date: 21-Apr-2023
  • (2023)It's Never too Early to Learn About Code QualityProceedings of the 54th ACM Technical Symposium on Computer Science Education V. 110.1145/3545945.3569829(792-798)Online publication date: 2-Mar-2023
  • Show More Cited By

Recommendations

Comments

Please enable JavaScript to view thecomments powered by Disqus.

Information & Contributors

Information

Published In

cover image ACM Conferences
ICPC '19: Proceedings of the 27th International Conference on Program Comprehension
May 2019
400 pages

Sponsors

Publisher

IEEE Press

Publication History

Published: 25 May 2019

Check for updates

Author Tags

  1. code quality metrics
  2. developers'perception
  3. readability

Qualifiers

  • Research-article

Conference

ICSE '19
Sponsor:

Upcoming Conference

ICSE 2025

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)21
  • Downloads (Last 6 weeks)2
Reflects downloads up to 17 Nov 2024

Other Metrics

Citations

Cited By

View all
  • (2024)R2I: A Relative Readability Metric for Decompiled CodeProceedings of the ACM on Software Engineering10.1145/36437441:FSE(383-405)Online publication date: 12-Jul-2024
  • (2023)From Code Complexity Metrics to Program ComprehensionCommunications of the ACM10.1145/354657666:5(52-61)Online publication date: 21-Apr-2023
  • (2023)It's Never too Early to Learn About Code QualityProceedings of the 54th ACM Technical Symposium on Computer Science Education V. 110.1145/3545945.3569829(792-798)Online publication date: 2-Mar-2023
  • (2023)An empirical study on software understandability and its dependence on code characteristicsEmpirical Software Engineering10.1007/s10664-023-10396-728:6Online publication date: 15-Nov-2023
  • (2022)An empirical investigation on the trade-off between smart contract readability and gas consumptionProceedings of the 30th IEEE/ACM International Conference on Program Comprehension10.1145/3524610.3529157(214-224)Online publication date: 16-May-2022
  • (2021)Reflections onACM SIGSOFT Software Engineering Notes10.1145/3468744.346875446:3(30-32)Online publication date: 21-Jul-2021
  • (2020)On the Relationship Between Developer Experience and RefactoringProceedings of the IEEE/ACM 42nd International Conference on Software Engineering Workshops10.1145/3387940.3392193(342-349)Online publication date: 27-Jun-2020
  • (2020)A Model to Detect Readability Improvements in Incremental ChangesProceedings of the 28th International Conference on Program Comprehension10.1145/3387904.3389255(25-36)Online publication date: 13-Jul-2020
  • (2020)On Assuring Learning About Code QualityProceedings of the Twenty-Second Australasian Computing Education Conference10.1145/3373165.3373175(86-94)Online publication date: 3-Feb-2020
  • (2019)Does the Introduction of Lambda Expressions Improve the Comprehension of Java Programs?Proceedings of the XXXIII Brazilian Symposium on Software Engineering10.1145/3350768.3350791(187-196)Online publication date: 23-Sep-2019
  • Show More Cited By

View Options

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media