arrow
Return

Automating TODO-missed Methods Detection and Patching

delete2024-12-19
delete0
delete
OA
AI
Z
Zhipeng Gao
Y
Yanqi Su
X
Xing Hu *
X
Xin Xia
DOI:10.1145/3700793delete
deleteOriginal
deleteOriginal request for help
deleteShare
deleteSave
Abstract

Abstract

En 中文
TODO comments are widely used by developers to remind themselves or others about incomplete tasks. In other words, TODO comments are usually associated with temporary or suboptimal solutions. In practice, all the equivalent suboptimal implementations should be updated (e.g., adding TODOs) simultaneously. However, due to various reasons (e.g., time constraints or carelessness), developers may forget or even are unaware of adding TODO comments to all necessary places, which results in the TODO-missed methods. These hidden suboptimal implementations in TODO-missed methods may hurt the software quality and maintainability in the long-term. Therefore, in this article, we propose the novel task of TODO-missed methods detection and patching and develop a novel model, namely TODO-comment Patcher (TDPATCIER), to automatically patch TODO comments to the TODO-missed methods in software projects. Our model has two main stages: offline learning and online inference. During the offline learning stage, TDPATCIER employs the GraphCodeBERT and contrastive learning for encoding the TODO comment (natural language) and its suboptimal implementation (code fragment) into vector representations. For the online inference stage, we can identify the TODOmissed methods and further determine their patching position by leveraging the offline trained model. We built our dataset by collecting TODO-introduced methods from the top-10,000 Python GitHub repositories and evaluated TDPATCIER on them. Extensive experimental results show the promising performance of our model over a set of benchmarks. We further conduct an in-the-wild evaluation that successfully detects 26 TODO-missed methods from 50 GitHub repositories.
Keywords:
TODO comment
SATD
technical debt
software inconsistency
contrastive learning

Journal

A
ACM Transactions on Software Engineering and Methodology
IF:
6.2
Papers:
1.2K
Citations:
3.4K

Organization

H
huawei technologies
Scholars:
3.3K
Papers: 2.9K
Citations: 1
A
Australian National University
Scholars:
2.1W
Papers: 2.3W
Citations: 3.9W
Z
zhejiang university
Scholars:
17.7W
Papers: 12.1W
Citations: 152
researcher View more organizations
Cited Papers

Cited Papers

Long noncoding RNA hypoxia-inducible factor 1 alpha-antisense RNA 1 promotes tumor necrosis factor-α-induced apoptosis through caspase 3 in Kupffer cells
err2018-01-01
err0
errOAAI
errYanghe Wu; Jiguang Ding; Qingfeng Sun; Ke Zhou; Weiwei Zhang; Qingwei Du; Tingyan Xu; Wangwang Xu
errShare
errSave
Identifying self-admitted technical debt through code comment analysis with a contextualized vocabulary
err2020-05-01
err21
PREAI
errde Freitas Farias, Mario Andre; de Mendonca Neto, Manoel Gomes; Kalinowski, Marcos; Spinola, Rodrigo Oliveira
errShare
errSave
Automating Change-Level Self-Admitted Technical Debt Determination
err2019-12-01
err51
errOAAI
errYan, Meng; Xia, Xin; Shihab, Emad; Lo, David; Yin, Jianwei; Yang, Xiaohu
errShare
errSave
Self-admitted technical debt practices: a comparison between industry and open-source
err2021-09-27
err31
errOAAI
errZampetti, Fiorella; Fucci, Gianmarco; Serebrenik, Alexander; Di Penta, Massimiliano
errShare
errSave
Caveolin-1 and -2 regulate cell motility in castration-resistant prostate cancer
err2018-10-01
err0
errOAAI
errToyoharu Kamibeppu; Koji Yamasaki; Kozue Nakahara; Takahiro Nagai; Naoki Terada; Hiromasa Tsukino; Shoichiro Mukai; Toshiyuki Kamoto
errShare
errSave
err
IF0
err
err0
PREAI
err
errShare
errSave
researcher View more