CoChat

Just-In-Time Obsolete Comment Detection and Update

Open access
Liu, Zhongxin, Xia, Xin, Lo, David, Yan, Meng, Li, Shanping · 2023 · IEEE Transactions on Software Engineering
Cited by 33

The DOI matches its Crossref record; 3 of the 3 references it cites were found in a registry or an index.

Abstract

Comments are valuable resources for the development, comprehension and maintenance of software. However, while changing code, developers sometimes neglect the evolution of the corresponding comments, resulting in obsolete comments. Such obsolete comments can mislead developers and introduce bugs in the future, and are therefore detrimental. We notice that by detecting and updating obsolete comments in time with code changes, obsolete comments can be effectively reduced and even avoided. We refer to this task as Just-In-Time (JIT) Obsolete Comment Detection and Update. In this work, we propose a two-stage framework namedCUP$^\mathrm{2}$2(Two-stageCommentUPdater) to automate this task. CUP$^\mathrm{2}$consists two components, i.e., anObsoleteCommentDetector namedOCDand aCommentUPdater namedCUP, each of which relies on a distinct neural network model to perform detection (updates). Specifically, given a code change and a corresponding comment, CUP$^\mathrm{2}$first leverages OCD to predict whether this comment should be updated. If the answer is yes, CUP will be used to generate the new version of the comment automatically. To evaluate CUP$^\mathrm{2}$, we build a large-scale dataset with over 4 million code-comment change samples. Our dataset focuses on method-level code changes and updates on method header comments considering the importance and widespread use of such comments. Evaluation results show that 1) both OCD and CUP outperform their baselines by significant margins, and 2) CUP$^\mathrm{2}$performs better than a rule-based baseline. Specifically, the comments generated by CUP$^\mathrm{2}$are identical to the ground truth for 41.8% of the samples that are predicted to be positive by OCD. We believe CUP$^\mathrm{2}$can help developers detect obsolete comments, better understand where and how to update obsolete comments and reduce their edits on obsolete comment updates.

Overview

The claims and statistics of this paper haven’t been checked yet.

Free: it reads the open-access text and checks the first 5 claims that cite a source we can check. Create a free account to check every claim.

A few free checks a day · papers already verified open instantly · results are public

Integrity signals

Registry

Crossref · 10.1109/tse.2021.3138909

Cites

3 of 3 references verified0 citation errors · 0 not checkable

Statistics

Verification

Claims the paper makes

The claims and statistics of this paper haven’t been checked yet.

Free: it reads the open-access text and checks the first 5 claims that cite a source we can check. Create a free account to check every claim.

A few free checks a day · papers already verified open instantly · results are public

Self-check

Percentages, sums and reported differences re-computed from the paper’s own numbers.

The self-check needs the paper’s full text.

Citations

Cites

Show all 3 references

Research works printed but not linked: 61

  1. 10.1109/ICSE.2009.5070533 · DOI · Paper page
  2. 10.1109/ICPC.2013.6613836 · DOI · Paper page
  3. 10.1007/s10664-019-09694-w · DOI · Paper page
  4. Woodfield, The effect of modularization and comments on program comprehension, 215
  5. 10.1145/1083142.1083152 · DOI · Paper page
  6. 10.1145/1085313.1085331 · DOI · Paper page
  7. Tan, HotComments: How to make program comments more useful?, 1
  8. 10.1145/1294261.1294276 · DOI · Paper page
  9. 10.1007/978-3-642-15187-3_8 · DOI
  10. 10.1109/ICST.2012.106 · DOI · Paper page
  11. 10.1016/j.jss.2011.09.019 · DOI
  12. 10.1145/1985793.1985796 · DOI · Paper page
  13. 10.1145/2856636.2856638 · DOI
  14. 10.1109/ASE.2017.8115624 · DOI · Paper page
  15. 10.1109/COMPSAC.2018.00028 · DOI · Paper page
  16. Hu, Deep code comment generation, 200
  17. 10.1109/ICSE.2019.00021 · DOI · Paper page
  18. 10.1109/ASE.2019.00026 · DOI · Paper page
  19. 10.1145/3134667 · DOI
  20. 10.18653/v1/P18-1097 · DOI
  21. 10.1609/aaai.v32i1.12069 · DOI · Paper page
  22. 10.3115/v1/p15-2097 · DOI
  23. 10.1145/1137983.1138030 · DOI · Paper page
  24. 10.1109/WCRE.2007.21 · DOI · Paper page
  25. 10.1007/s11219-009-9075-x · DOI
  26. 10.1109/ASE.2015.67 · DOI
  27. 10.1109/ICPC.2019.00019 · DOI · Paper page
  28. 10.1109/ICSE.2017.11 · DOI · Paper page
  29. 10.1109/ICSM.2008.4658065 · DOI · Paper page
  30. 10.18653/v1/2020.acl-main.168 · DOI · Paper page
  31. 10.1109/ICPC.2013.6613830 · DOI · Paper page
  32. 10.1109/WCRE.2010.13 · DOI · Paper page
  33. 10.1109/SANER.2015.7081848 · DOI · Paper page
  34. 10.1007/s11390-016-1671-1 · DOI
  35. 10.18653/v1/P16-1195 · DOI · Paper page
  36. 10.1145/3238147.3238206 · DOI · Paper page
  37. 10.1109/ICSE.2019.00087 · DOI · Paper page
  38. 10.1007/s10664-019-09730-9 · DOI · Paper page
  39. 10.1016/j.jss.2019.07.087 · DOI
  40. 10.1145/3434280 · DOI
  41. Karampatsis, Big code!= big vocabulary: Open-vocabulary models for source code, 1073
  42. Yin, Learning to represent edits, 1
  43. Grave, Learning word vectors for 157 languages, 3483
  44. 10.18653/v1/D15-1166 · DOI · Paper page
  45. 10.1145/318372.318577 · DOI · Paper page
  46. 10.1145/2642937.2642982 · DOI · Paper page
  47. Levenshtein, 1966, Binary codes capable of correcting deletions, insertions, and reversals, Soviet Phys. Doklady, 10, 707
  48. 10.1109/ICSE.2009.5070531 · DOI · Paper page
  49. 10.1145/1806799.1806847 · DOI · Paper page
  50. 10.1145/3180155.3180206 · DOI · Paper page
  51. Pedregosa, 2011, Scikit-learn: Machine learning in python, J. Mach. Learn. Res., 12, 2825
  52. 10.1145/3238147.3238190 · DOI · Paper page
  53. 10.3115/1073083.1073135 · DOI · Paper page
  54. Kingma, Adam: A method for stochastic optimization, 1
  55. 10.1007/978-1-4612-4380-9_16 · DOI · Paper page
  56. 10.4324/9781315806730 · DOI · Paper page
  57. 10.1109/ICCV.2017.324 · DOI · Paper page
  58. Casas, Intentnet: Learning to predict intention from raw sensor data, 947
  59. 10.18653/v1/P18-1158 · DOI
  60. 10.1109/CVPR.2018.00981 · DOI · Paper page
  61. Gao, Automating the removal of obsolete todo comments, 1

Cited by

See all 33

Metadata

Authors
Liu, Z., Xia, X., Lo, D., Yan, M., & Li, S.
Venue
IEEE Transactions on Software Engineering
Published
2023-01-01
Volume
49
Issue
1
Pages
1-23
ISSN
  • 0098-5589 (ISSN-L)
  • 1939-3520
  • 2326-3881
OpenAlex
W4206738852
Cited by
33
References
3
FWCI
4.73
Type
journal article
Language
en
Open access
green

About these checks

Registry, retraction, Cites and statistics results are computed, not judged, with one exception: a printed reference that no index lists is read once by a model before it counts as a citation error. Claims are extracted by a model and kept only when their quote appears verbatim in the text; each cited source is then checked, with a model’s help, for whether it says what the claim relies on. Those verdicts can be wrong — read the claim’s quote and the cited source before relying on one.

Statistics and arithmetic are recomputed, not judged.

Confidence bands are shown only for fields calibrated on our annotated test set. None is calibrated yet, so no band is shown.

What counts as a claim ›How we measure confidence ›How we check this ›

Are you an author, or do you see a problem with this page? Request a review

How to cite

Cite CoChat for the checks on this page, and the paper for its own findings.

This page
CoChat. (2026). Citation check: Just-In-Time Obsolete Comment Detection and Update. https://app.cochat.ai/papers/10.1109/tse.2021.3138909
The paper
Liu, Z., Xia, X., Lo, D., Yan, M., & Li, S. (2023). Just-In-Time Obsolete Comment Detection and Update. IEEE Transactions on Software Engineering. https://doi.org/10.1109/tse.2021.3138909

Data sources

Bibliographic data: Semantic Scholar, OpenAlex, Crossref.

Contains information from the Semantic Scholar Academic Graph Datasets, made available under the ODC Attribution License (ODC-BY 1.0).

Semantic Scholar’s data is described in: Kinney, R., et al. (2023). The Semantic Scholar Open Data Platform. arXiv:2301.10140.