An Empirical Study on Code Comment Completion

Antonio Mastropaolo, Emad Aghajani, Luca Pascarella, Gabriele Bavota
7/22/2021
cs.SE

Official code: antonio-mastropaolo/ICSME2021-Completion (0 stars, Jupyter Notebook, MIT, last commit 2022-01-19).

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.

Show full abstract

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.

View on arXivView PDF

Code Implementations(1)

MIT
00Jupyter Notebook, PythonJun 16, 20214 years agoMIT

Similar Papers

Cite this paper

@article{mastropaolo2021empirical,
  title  = {An Empirical Study on Code Comment Completion},
  author = {Antonio Mastropaolo and Emad Aghajani and Luca Pascarella and Gabriele Bavota},
  year   = {2021},
  eprint = {2107.10544},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2107.10544}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2107.10544.svg)](https://codeofpaper.com/paper/2107.10544)

Discussion