arrow
返回

Completing Function Documentation Comments Using Structural Information

delete2023-05-23
delete0
delete
OA
AI
A
Adelina Ciurumelea *
C
Carol V. Alexandru
H
Harald C. Gall
S
Sebastian Proksch
DOI:10.1007/s10664-022-10284-6delete
delete原文链接
delete原文求助
delete分享
delete收藏
摘要

摘要

En 中文
Source code comments are a cornerstone of software documentation facilitating feature development and maintenance. Well-defined documentation formats, like Javadoc, make it easy to include structural metadata used to, for example, generate documentation manuals. However, the actual usage of structural elements in source code comments has not been studied yet. We investigate to which extent these structural elements are used in practice and whether the added information can be leveraged to improve tools assisting developers when writing comments. Existing research on comment generation traditionally focuses on automatic generation of summaries. However, recent works have shown promising results when supporting comment authoring through a next-word prediction. In this paper, we present an in-depth analysis of commenting practice in more than 18K open-source projects written in Python and Java showing that many structural elements, particularly parameter and return value descriptions are indeed widely used. We discover that while a majority are rather short at about 6 to 9 words, many are several hundred words in length. We further find that Python comments tend to be significantly longer than Java comments, possibly due to the weakly-typed nature of the former. Following the empirical analysis, we extend an existing language model with support for structural information, substantially improving the Top-1 accuracy of predicted words (Python 9.6%, Java 7.8%).
Keyword:
Comment completion
Python documentation strings
Javadocs
Neural language models

期刊

Empirical Software Engineering 封面图
Empirical Software Engineering
IF:
3.6
论文数:
2.0K
被引数:
5.3K

机构

D
Delft University of Technology
学者数:
2.6W
论文数: 2.5W
被引数: 3.8W
U
university of zurich
学者数:
5.1W
论文数: 4.0W
被引数: 65
引用论文

引用论文

err
IF0
err
err0
errOAAI
err
err分享
err收藏
Homeobox Gene Involvement in Normal Hematopoiesis and in the Pathogenesis of Childhood Leukemias
err2017-01-01
err0
PREAI
errMaria Adamaki; Maria Goulielmaki; Ioannis Christodoulou; Spiros Vlahopoulos; Vassilis Zoumpourlis
err分享
err收藏
Establishment and characterization of a new triple-negative canine mammary cancer cell line
err2018-10-01
err0
PREAI
errHong Zhang; Shimin Pei; Bin Zhou; Huanan Wang; Hongchao Du; Di Zhang; Degui Lin
err分享
err收藏
Measuring Program Comprehension: A Large-Scale Field Study with Professionals
err2018-10-01
err195
errOAAI
errXia, Xin; Bao, Lingfeng; Lo, David; Xing, Zhenchang; Hassan, Ahmed E.; Li, Shanping
err分享
err收藏
Urinary retention following routine neurosurgical spine procedures
err2001-01-01
err0
PREAI
errNicholas M Boulis; Farukh S Mian; David Rodriguez; Edward Cho; Julian T Hoff
err分享
err收藏
学者 查看更多内容