vix.ing · top · new · best · stats

An Empirical Study on Code Comment Completion

2021/07/22 by Antonio Mastropaolo, Emad Aghajani, Mastropaolo, Antonio +5 · 2 citations
Computer Science · #Artificial intelligence #Code (set theory) #Comprehension #Computer science #Empirical research #FOS: Computer and information sciences #Programming language #Scratch #Software Engineering (cs.SE) #Software Engineering Research #Software Reliability and Analysis Research #Software Testing and Debugging Techniques #Source code #Transformer #cs.SE

paper · pdf · doi:10.48550/arxiv.2107.10544

published in arXiv (Cornell University) (Cornell University) · Accepted for publication at the 37th International Conference on Software Maintenance and Evolution (ICSME 2021)

arxiv created 2021/07/22 · openalex publication_date 2021/07/22 · arxiv updated 2021/07/23 · openalex created_date 2025/10/10 · openalex updated_date 2026/08/04

Abstract

Code comments play a prominent role in program comprehension activities. However, source code is not always documented and code and comments not always co-evolve. To deal with these issues, researchers have proposed techniques to automatically generate comments documenting a given code at hand. The most recent works in the area applied deep learning (DL) techniques to support such a task. Despite the achieved advances, the empirical evaluations of these approaches show that they are still far from a performance level that would make them valuable for developers. We tackle a simpler and related problem: Code comment completion. Instead of generating a comment for a given code from scratch, we investigate the extent to which state-of-the-art techniques can help developers in writing comments faster. We present a large-scale study in which we empirically assess how a simple n-gram model and the recently proposed Text-To-Text Transfer Transformer (T5) architecture can perform in autocompleting a code comment the developer is typing. The achieved results show the superiority of the T5 model, despite the n-gram model being a competitive solution.

Cited by

Related