arrow
返回

Learning to Generate Structured Code Summaries From Hybrid Code Context

delete2024-10-01
delete0
PRE
AI
Z
Ziyi Zhou
M
Mingchen Li
余
余慧群 (Huiqun Yu)
G
Guisheng Fan *
P
Penghui Yang
Z
Zijie Huang
DOI:10.1109/TSE.2024.3439562delete
delete原文链接
delete分享
delete收藏
摘要

摘要

En 中文
Code summarization aims to automatically generate natural language descriptions for code, and has become a rapidly expanding research area in the past decades. Unfortunately, existing approaches mainly focus on the one-to-one mapping from methods to short descriptions, which hinders them from becoming practical tools: 1) The program context is ignored, so they have difficulty in predicting keywords outside the target method; 2) They are typically trained to generate brief function descriptions with only one sentence in length, and therefore have difficulty in providing specific information. These drawbacks are partially due to the limitations of public code summarization datasets. In this paper, we first build a large code summarization dataset including different code contexts and summary content annotations, and then propose a deep learning framework that learns to generate structured code summaries from hybrid program context, named StructCodeSum. It provides both an LLM-based approach and a lightweight approach which are suitable for different scenarios. Given a target method, StructCodeSum predicts its function description, return description, parameter description, and usage description through hybrid code context, and ultimately builds a Javadoc-style code summary. The hybrid code context consists of path context, class context, documentation context and call context of the target method. Extensive experimental results demonstrate: 1) The hybrid context covers more than 70% of the summary tokens in average and significantly boosts the model performance; 2) When generating function descriptions, StructCodeSum outperforms the state-of-the-art approaches by a large margin; 3) According to human evaluation, the quality of the structured summaries generated by our approach is better than the documentation generated by Code Llama.
Keyword:
Codes
Hybrid power systems
Documentation
Task analysis
Annotations
Source coding
Context modeling
Code summarization
program comprehension
deep learning
Esale: Enhancing Code-Summary Alignment Learning for Source Code SummarizationEsale: 用于源代码摘要的增强代码摘要对齐学习
err2024-08-01
err2
PREAI
errFang, Chunrong; Sun, Weisong; Chen, Yuchen; Chen, Xiao; Wei, Zhao; Zhang, Quanjun; You, Yudu; Luo, Bin; Liu, Yang; Chen, Zhenyu
err分享
err收藏
ClassSum: a deep learning model for class-level code summarization
err2022-10-10
err0
PREAI
errMingchen Li; Huiqun Yu; Guisheng Fan; Ziyi Zhou; Jiawen Huang
err分享
err收藏
err分享
err收藏
Context-aware code summary generation上下文感知代码摘要生成
err2025-08-06
err0
PREAI
errChia-Yi Su; Aakash Bansal; Yu Huang; Toby Jia-Jun Li; Collin McMillan
err分享
err收藏
Autofolding for Source Code Summarization用于源代码摘要的自动折叠
err2017-12-01
err37
errOAAI
errFowkes, Jaroslav; Chanthirasegaran, Pankajan; Ranca, Razvan; Allamanis, Miltiadis; Lapata, Mirella; Sutton, Charles
err分享
err收藏
Summarizing source code with hierarchical code representation用分层代码表示总结源代码
err2022-03-01
err14
PREAI
errZhou, Ziyi; Yu, Huiqun; Fan, Guisheng; Huang, Zijie; Yang, Xingguang
err分享
err收藏
Function Call Graph Context Encoding for Neural Source Code Summarization
err2023-09-01
err5
PREAI
errBansal, Aakash; Eberhart, Zachary; Karas, Zachary; Huang, Yu; Mcmillan, Collin
err分享
err收藏

期刊

IEEE Transactions on Software Engineering 封面图
IEEE Transactions on Software Engineering
IF:
5.6
论文数:
3.0K
被引数:
1.3W

机构

暂无机构信息
引用论文

引用论文

err
IF0
err
err0
PREAI
err
err分享
err收藏
Towards Retrieval-Based Neural Code Summarization: A Meta-Learning Approach
err2023-04-01
err6
PREAI
errZhou, Ziyi; Yu, Huiqun; Fan, Guisheng; Huang, Zijie; Yang, Kang
err分享
err收藏
Usage and usefulness of technical software documentation: An industrial case study
err2015-01-01
err45
PREAI
errGarousi, Golara; Garousi-Yusifoglu, Vahid; Ruhe, Guenther; Zhi, Junji; Moussavi, Mahmoud; Smith, Brian
err分享
err收藏
Caveolin-1 and -2 regulate cell motility in castration-resistant prostate cancer
err2018-10-01
err0
errOAAI
errToyoharu Kamibeppu; Koji Yamasaki; Kozue Nakahara; Takahiro Nagai; Naoki Terada; Hiromasa Tsukino; Shoichiro Mukai; Toshiyuki Kamoto
err分享
err收藏
Molecular carcinogenesis in equine penile cancer: A potential animal model for human penile cancer
err2018-12-01
err0
PREAI
errAlejandro Suárez-Bonnet; Claire Willis; Rachel Pittaway; Ken Smith; Tim Mair; Simon L. Priestnall
err分享
err收藏
Effect of easily metabolizable sugars in the production of xylanase by Aspergillus tamarii in solid-state fermentation
err2001-03-01
err0
PREAI
errDaniela Farani de Souza; Cristina Giatti Marques de Souza; Rosane Marina Peralta
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收藏
学者 查看更多内容