Just-In-Time TODO-missed commits detection
Publication Type
Journal Article
Publication Date
11-2024
Abstract
TODO comments play an important role in helping developers to manage their tasks and communicate with other team members. TODO comments are often introduced by developers as a type of technical debt, such as a reminder to add/remove features or a request to optimize the code implementations. These can all be considered as notifications for developers to revisit regarding the current suboptimal solutions. TODO comments often bring short-term benefits – higher productivity or shorter development cost – and indicate attention needs to be paid for the long-term software quality. Unfortunately, due to their lack of knowledge or experience and/or the time constraints, developers sometimes may forget or even not be aware of suboptimal implementations. The loss of the TODO comments for these suboptimal solutions may hurt the software quality and reliability in the long-term. Therefore it is beneficial to remind the developers of the suboptimal solutions whenever they change the code. In this work, we refer this problem to the task of detecting TODO-missed commits , and we propose a novel approach named TDReminder ( T O D O comment Reminder ) to address the task. With the help of TDReminder , developers can identify possible missing TODO commits just-in-time when submitting a commit. Our approach has two phases: offline training and online inference. We first embed code change and commit message into contextual vector representations using two neural encoders respectively. The association between these representations is learned by our model automatically. In the online inference phase, TDReminder leverages the trained model to compute the likelihood of a commit being a TODO-missed commit . We evaluate TDReminder on datasets crawled from 10k popular Python and Java repositories in GitHub respectively. Our experimental results show that TDReminder outperforms a set of benchmarks by a large margin in TODO-missed commits detection. Moreover, to better help developers use TDReminder in practice, we have incorporated Large Language Models (LLMs) with our approach to provide explainable recommendations. The user study shows that our tool can effectively inform developers not only “when” to add TODOs, but also “where” and “what” TODOs should be added, verifying the value of our tool in practical application.
Keywords
Technical debt, TODO comment, Code-comment inconsistency, Suboptimal implementation
Discipline
Databases and Information Systems
Research Areas
Software and Cyber-Physical Systems
Publication
IEEE Transactions on Software Engineering
Volume
50
Issue
11
First Page
2732
Last Page
2752
ISSN
0098-5589
Identifier
10.1109/TSE.2024.3405005
Publisher
Institute of Electrical and Electronics Engineers
Citation
WANG, Haoye; GAO, Zhipeng; HU, Xing; LO, David; GRUNDY, John; and WANG, Xinyu.
Just-In-Time TODO-missed commits detection. (2024). IEEE Transactions on Software Engineering. 50, (11), 2732-2752.
Available at: https://ink.library.smu.edu.sg/sis_research/9916
Additional URL
https://doi.org/10.1109/TSE.2024.3405005