Skip to main navigation Skip to search Skip to main content

Just-In-Time TODO-Missed Commits Detection

  • Haoye Wang
  • , Zhipeng Gao
  • , Xing Hu
  • , David Lo
  • , John Grundy
  • , Xinyu Wang

Research output: Contribution to journalArticleResearchpeer-review

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 &#x2013; higher productivity or shorter development cost &#x2013; 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 <italic>TODO-missed commits</italic>, and we propose a novel approach named TDR<sc>eminder</sc> (<bold>T</bold>O<bold>D</bold>O comment <bold>Reminder</bold>) to address the task. With the help of TDR<sc>eminder</sc>, 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, TDR<sc>eminder</sc> leverages the trained model to compute the likelihood of a commit being a <italic>TODO-missed commit</italic>. We evaluate TDR<sc>eminder</sc> on datasets crawled from 10k popular Python and Java repositories in GitHub respectively. Our experimental results show that TDR<sc>eminder</sc> outperforms a set of benchmarks by a large margin in <italic>TODO-missed commits</italic> detection. Moreover, to better help developers use TDR<sc>eminder</sc> 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 &#x201C;when&#x201D; to add TODOs, but also &#x201C;where&#x201D; and &#x201C;what&#x201D; TODOs should be added, verifying the value of our tool in practical application.

Original languageEnglish
Pages (from-to)2732-2752
Number of pages21
JournalIEEE Transactions on Software Engineering
Volume50
Issue number11
DOIs
Publication statusPublished - Nov 2024

Keywords

  • Codes
  • Python
  • Software development management
  • Software quality
  • Stars
  • Task analysis
  • Training

Cite this