Automating the removal of obsolete TODO comments

TODO comments are very widely used by software developers to describe their pending tasks during software development. However, after performing the task developers sometimes neglect or simply forget to remove the TODO comment, resulting in obsolete TODO comments. These obsolete TODO comments can co...

Full description

Saved in:
Bibliographic Details
Main Authors: GAO, Zhipeng, XIA, Xin, LO, David, GRUNDY, John C., ZIMMERMANN, Thomas
Format: text
Language:English
Published: Institutional Knowledge at Singapore Management University 2021
Subjects:
Online Access:https://ink.library.smu.edu.sg/sis_research/6760
https://ink.library.smu.edu.sg/context/sis_research/article/7763/viewcontent/2108.05846.pdf
Tags: Add Tag
No Tags, Be the first to tag this record!
Institution: Singapore Management University
Language: English
id sg-smu-ink.sis_research-7763
record_format dspace
spelling sg-smu-ink.sis_research-77632022-01-27T10:40:44Z Automating the removal of obsolete TODO comments GAO, Zhipeng XIA, Xin LO, David GRUNDY, John C. ZIMMERMANN, Thomas TODO comments are very widely used by software developers to describe their pending tasks during software development. However, after performing the task developers sometimes neglect or simply forget to remove the TODO comment, resulting in obsolete TODO comments. These obsolete TODO comments can confuse development teams and may cause the introduction of bugs in the future, decreasing the software’s quality and maintainability. Manually identifying obsolete TODO comments is time-consuming and expensive. It is thus necessary to detect obsolete TODO comments and remove them automatically before they cause any unwanted side effects. In this work, we propose a novel model, named TDCleaner (TODO comment Cleaner), to identify obsolete TODO comments in software projects. TDCleaner can assist developers in just-intime checking of TODO comments status and avoid leaving obsolete TODO comments. Our approach has two main stages: offline learning and online prediction. During offline learning, we first automatically establish ⟨��������_��ℎ��������, ��������_��������������, ������������_������⟩ training samples and leverage three neural encoders to capture the semantic features of TODO comment, code change and commit message respectively. TDCleaner then automatically learns the correlations and interactions between different encoders to estimate the final status of the TODO comment. For online prediction, we check a TODO comment’s status by leveraging the offline trained model to judge the TODO comment’s likelihood of being obsolete. We built our dataset by collecting TODO comments from the top-10,000 Python and Java Github repositories and evaluated TDCleaner on them. Extensive experimental results show the promising performance of our model over a set of benchmarks. We also performed an in-the-wild evaluation with real-world software projects, we reported 18 obsolete TODO comments identified by TDCleaner to Github developers and 9 of them have already been confirmed and removed by the developers, demonstrating the practical usage of our approach. 2021-08-01T07:00:00Z text application/pdf https://ink.library.smu.edu.sg/sis_research/6760 info:doi/10.1145/3468264.3468553 https://ink.library.smu.edu.sg/context/sis_research/article/7763/viewcontent/2108.05846.pdf http://creativecommons.org/licenses/by-nc-nd/4.0/ Research Collection School Of Computing and Information Systems eng Institutional Knowledge at Singapore Management University TODO comment Obsolete comment Code-Comment Inconsistency Code-comment co-evolution BERT model Databases and Information Systems Software Engineering
institution Singapore Management University
building SMU Libraries
continent Asia
country Singapore
Singapore
content_provider SMU Libraries
collection InK@SMU
language English
topic TODO comment
Obsolete comment
Code-Comment Inconsistency
Code-comment co-evolution
BERT model
Databases and Information Systems
Software Engineering
spellingShingle TODO comment
Obsolete comment
Code-Comment Inconsistency
Code-comment co-evolution
BERT model
Databases and Information Systems
Software Engineering
GAO, Zhipeng
XIA, Xin
LO, David
GRUNDY, John C.
ZIMMERMANN, Thomas
Automating the removal of obsolete TODO comments
description TODO comments are very widely used by software developers to describe their pending tasks during software development. However, after performing the task developers sometimes neglect or simply forget to remove the TODO comment, resulting in obsolete TODO comments. These obsolete TODO comments can confuse development teams and may cause the introduction of bugs in the future, decreasing the software’s quality and maintainability. Manually identifying obsolete TODO comments is time-consuming and expensive. It is thus necessary to detect obsolete TODO comments and remove them automatically before they cause any unwanted side effects. In this work, we propose a novel model, named TDCleaner (TODO comment Cleaner), to identify obsolete TODO comments in software projects. TDCleaner can assist developers in just-intime checking of TODO comments status and avoid leaving obsolete TODO comments. Our approach has two main stages: offline learning and online prediction. During offline learning, we first automatically establish ⟨��������_��ℎ��������, ��������_��������������, ������������_������⟩ training samples and leverage three neural encoders to capture the semantic features of TODO comment, code change and commit message respectively. TDCleaner then automatically learns the correlations and interactions between different encoders to estimate the final status of the TODO comment. For online prediction, we check a TODO comment’s status by leveraging the offline trained model to judge the TODO comment’s likelihood of being obsolete. We built our dataset by collecting TODO comments from the top-10,000 Python and Java Github repositories and evaluated TDCleaner on them. Extensive experimental results show the promising performance of our model over a set of benchmarks. We also performed an in-the-wild evaluation with real-world software projects, we reported 18 obsolete TODO comments identified by TDCleaner to Github developers and 9 of them have already been confirmed and removed by the developers, demonstrating the practical usage of our approach.
format text
author GAO, Zhipeng
XIA, Xin
LO, David
GRUNDY, John C.
ZIMMERMANN, Thomas
author_facet GAO, Zhipeng
XIA, Xin
LO, David
GRUNDY, John C.
ZIMMERMANN, Thomas
author_sort GAO, Zhipeng
title Automating the removal of obsolete TODO comments
title_short Automating the removal of obsolete TODO comments
title_full Automating the removal of obsolete TODO comments
title_fullStr Automating the removal of obsolete TODO comments
title_full_unstemmed Automating the removal of obsolete TODO comments
title_sort automating the removal of obsolete todo comments
publisher Institutional Knowledge at Singapore Management University
publishDate 2021
url https://ink.library.smu.edu.sg/sis_research/6760
https://ink.library.smu.edu.sg/context/sis_research/article/7763/viewcontent/2108.05846.pdf
_version_ 1770576060123971584