Controversy Corner: On the relationship between comment update practices and Software Bugs

  • Authors:
  • Walid M. Ibrahim;Nicolas Bettenburg;Bram Adams;Ahmed E. Hassan

  • Affiliations:
  • Software Analysis and Intelligence Lab (SAIL), School of Computing, Queen's University, Ontario, Canada;Software Analysis and Intelligence Lab (SAIL), School of Computing, Queen's University, Ontario, Canada;Software Analysis and Intelligence Lab (SAIL), School of Computing, Queen's University, Ontario, Canada;Software Analysis and Intelligence Lab (SAIL), School of Computing, Queen's University, Ontario, Canada

  • Venue:
  • Journal of Systems and Software
  • Year:
  • 2012

Quantified Score

Hi-index 0.00

Visualization

Abstract

When changing source code, developers sometimes update the associated comments of the code (a consistent update), while at other times they do not (an inconsistent update). Similarly, developers sometimes only update a comment without its associated code (an inconsistent update). The relationship of such comment update practices and software bugs has never been explored empirically. While some (in)consistent updates might be harmless, software engineering folklore warns of the risks of inconsistent updates between code and comments, because these updates are likely to lead to out-of-date comments, which in turn might mislead developers and cause the introduction of bugs in the future. In this paper, we study comment update practices in three large open-source systems written in C (FreeBSD and PostgreSQL) and Java (Eclipse). We find that these practices can better explain and predict future bugs than other indicators like the number of prior bugs or changes. Our findings suggest that inconsistent changes are not necessarily correlated with more bugs. Instead, a change in which a function and its comment are suddenly updated inconsistently, whereas they are usually updated consistently (or vice versa), is risky (high probability of introducing a bug) and should be reviewed carefully by practitioners.