Automating the Removal of Obsolete TODO Comments

08/12/2021
by   Zhipeng Gao, et al.
0

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. 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-in-time 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 <code_change, todo_comment, commit_msg> 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.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
03/30/2022

A First Look at Duplicate and Near-duplicate Self-admitted Technical Debt Comments

Self-admitted technical debt (SATD) refers to technical debt that is int...
research
08/25/2021

RepliComment: Identifying Clones in Code Comments

Code comments are the primary means to document implementation and facil...
research
07/30/2018

Automatic Clone Recommendation for Refactoring Based on the Present and the Past

When many clones are detected in software programs, not all clones are e...
research
08/06/2018

Executable Trigger-Action Comments

Natural language elements, e.g., todo comments, are frequently used to c...
research
12/23/2022

Warnings: Violation Symptoms Indicating Architecture Erosion

As a software system evolves, its architecture tends to degrade, and gra...
research
08/25/2023

Human-in-the-loop online just-in-time software defect prediction

Online Just-In-Time Software Defect Prediction (O-JIT-SDP) uses an onlin...
research
09/18/2023

ACWRecommender: A Tool for Validating Actionable Warnings with Weak Supervision

Static analysis tools have gained popularity among developers for findin...

Please sign up or login with your details

Forgot password? Click here to reset