Skip to main navigation Skip to search Skip to main content

Parameter Description Generation with the Code Parameter Flow

  • Qiuyuan Chen
  • , Zezhou Yang
  • , Zhongxin Liu*
  • , Shanping Li
  • , Cuiyun Gao
  • *Corresponding author for this work

Research output: Chapter in Book/Report/Conference proceedingConference contributionpeer-review

Abstract

Prior study shows that comprehending parameters can help developers understand the code's critical information (e.g., the argument) and enhance the comprehension of the functionality. However, commenting parameter is often ignored in practice. For example, a statistic of 18 popular open-source projects shows the ratio of methods with one or more parameters but lacking "@param"comment ranges from 31% to 97%, indicating the necessity of parameter comments.To fill this gap, we propose ParamDesGen to generate a descriptive code comment (description) for each parameter given a method with one or more formal parameters. ParamDesGen consists of (1) a code analysis component to identify the Parameter Flow and extract "parameter-related code parts"and (2) a machine-learning component to generate parameter comments. We build a large-scale dataset for the task and perform experiments on it to evaluate ParamDesGen. The evaluation results show that the proposed approach substantially outperforms the baselines in terms of BLEU-4 scores (22.54 absolute improvement and 138.79% relative improvement) and ROUGE-L scores (3.12 absolute improvement and 5.90% relative improvement). We further perform ablation experiments to prove the effectiveness of the Parameter Flow.

Original languageEnglish
Title of host publicationProceedings - 2022 IEEE 22nd International Conference on Software Quality, Reliability and Security, QRS 2022
PublisherInstitute of Electrical and Electronics Engineers Inc.
Pages884-895
Number of pages12
ISBN (Electronic)9781665477048
DOIs
StatePublished - 2022
Externally publishedYes
Event22nd IEEE International Conference on Software Quality, Reliability and Security, QRS 2022 - Virtual, Online, China
Duration: 5 Dec 20229 Dec 2022

Publication series

NameIEEE International Conference on Software Quality, Reliability and Security, QRS
Volume2022-December
ISSN (Print)2693-9177

Conference

Conference22nd IEEE International Conference on Software Quality, Reliability and Security, QRS 2022
Country/TerritoryChina
CityVirtual, Online
Period5/12/229/12/22

Keywords

  • Code Summarization
  • Comment Generation
  • Parameter Description
  • Parameter Flow

Fingerprint

Dive into the research topics of 'Parameter Description Generation with the Code Parameter Flow'. Together they form a unique fingerprint.

Cite this