Analyzing the co-evolution of comments and source code

被引:0
|
作者
Beat Fluri
Michael Würsch
Emanuel Giger
Harald C. Gall
机构
[1] University of Zurich,Department of Informatics
来源
Software Quality Journal | 2009年 / 17卷
关键词
Software evolution analysis; Software repositories; Source code changes; Comment changes; Comment quality; Software maintenance;
D O I
暂无
中图分类号
学科分类号
摘要
Source code comments are a valuable instrument to preserve design decisions and to communicate the intent of the code to programmers and maintainers. Nevertheless, commenting source code and keeping comments up-to-date is often neglected for reasons of time or programmers obliviousness. In this paper, we investigate the question whether developers comment their code and to what extent they add comments or adapt them when they evolve the code. We present an approach to associate comments with source code entities to track their co-evolution over multiple versions. A set of heuristics are used to decide whether a comment is associated with its preceding or its succeeding source code entity. We analyzed the co-evolution of code and comments in eight different open source and closed source software systems. We found with statistical significance that (1) the relative amount of comments and source code grows at about the same rate; (2) the type of a source code entity, such as a method declaration or an if-statement, has a significant influence on whether or not it gets commented; (3) in six out of the eight systems, code and comments co-evolve in 90% of the cases; and (4) surprisingly, API changes and comments do not co-evolve but they are re-documented in a later revision. As a result, our approach enables a quantitative assessment of the commenting process in a software system. We can, therefore, leverage the results to provide feedback during development to increase the awareness of when to add comments or when to adapt comments because of source code changes.
引用
收藏
页码:367 / 394
页数:27
相关论文
共 50 条
  • [1] Analyzing the co-evolution of comments and source code
    Fluri, Beat
    Wuersch, Michael
    Giger, Emanuel
    Gall, Harald C.
    [J]. SOFTWARE QUALITY JOURNAL, 2009, 17 (04) : 367 - 394
  • [2] Co-Evolution of Source Code and the Build System
    Adams, Bram
    [J]. 2009 IEEE INTERNATIONAL CONFERENCE ON SOFTWARE MAINTENANCE, CONFERENCE PROCEEDINGS, 2009, : 461 - 464
  • [3] Co-evolution of Infrastructure and Source Code - An Empirical Study
    Jiang, Yujuan
    Adams, Bram
    [J]. 12TH WORKING CONFERENCE ON MINING SOFTWARE REPOSITORIES (MSR 2015), 2015, : 45 - 55
  • [4] Patterns of Co-evolution between Requirements and Source Code
    Rahimi, Mona
    Cleland-Huang, Jane
    [J]. 2015 IEEE FIFTH INTERNATIONAL WORKSHOP ON REQUIREMENTS PATTERNS (REPA), 2015, : 25 - 31
  • [5] Studying the Co-Evolution of Source Code and Acceptance Tests
    Yalcin, Ali Gorkem
    Tuglular, Tugkan
    [J]. INTERNATIONAL JOURNAL OF SOFTWARE ENGINEERING AND KNOWLEDGE ENGINEERING, 2023, 33 (07) : 1011 - 1037
  • [6] CO-EVOLUTION THEORY OF GENETIC CODE
    WONG, JTF
    [J]. PROCEEDINGS OF THE NATIONAL ACADEMY OF SCIENCES OF THE UNITED STATES OF AMERICA, 1975, 72 (05) : 1909 - 1912
  • [7] On the Co-evolution of ML Pipelines and Source Code - Empirical Study of DVC Projects
    Barrak, Amine
    Eghan, Ellis E.
    Adams, Bram
    [J]. 2021 IEEE INTERNATIONAL CONFERENCE ON SOFTWARE ANALYSIS, EVOLUTION AND REENGINEERING (SANER 2021), 2021, : 422 - 433
  • [8] Analyzing the Evolution of the Source Code Vocabulary
    Abebe, Surafel Lemma
    Haiduc, Sonia
    Marcus, Andrian
    Tonella, Paolo
    Antoniol, Giuliano
    [J]. 13TH EUROPEAN CONFERENCE ON SOFTWARE MAINTENANCE AND REENGINEERING: CSMR 2009, PROCEEDINGS, 2009, : 189 - 198
  • [9] Co-evolution of the genetic code and ribozyme replication
    Stevenson, DS
    [J]. JOURNAL OF THEORETICAL BIOLOGY, 2002, 217 (02) : 235 - 253
  • [10] Analyzing the Evolution of Source Code to Predict Vulnerabilities
    Ranasinghe, Kalana
    Keppitiyagama, Chamath
    [J]. 2022 22ND INTERNATIONAL CONFERENCE ON ADVANCES IN ICT FOR EMERGING REGIONS (ICTER), 2022,