Source code documentation is an integral part of software development and maintenance, as it helps in understanding the code and facilitates communication among developers. However, existing documentation is often incomplete, outdated, or inaccurate, which can lead to misunderstandings and errors. In the era of large language models (LLMs), which are being extensively used for software engineering tasks, the quality of documentation becomes even more critical, as documentation provides important context for the models. In this paper, we introduce the notion of documentation-to-code equivalence, a novel property that captures whether documentation accurately and completely describes the code it documents. We present a novel approach, called Documentary, to automatically generate equivalent documentation for a given code snippet. Our evaluation shows that Documentary can generate equivalent documentation for 53.4% of the evaluated function-level code snippets. To show the benefits of documentation-to-code equivalence, we describe and evaluate two software engineering tasks: code understanding and code editing. Our results show that documentation-to-code equivalence allows an LLM to predict the output of a function with 12.8--24.5% higher accuracy, when compared to human-written documentation and documentation generated by a baseline approach. Furthermore, human developers consider documentation generated by Documentary to be more useful for understanding and editing code than the original human-written documentation.


翻译:暂无翻译

0
下载
关闭预览

相关内容

代码(Code)是专知网的一个重要知识资料文档板块,旨在整理收录论文源代码、复现代码,经典工程代码等,便于用户查阅下载使用。
《基于大型语言模型的软件工程自动化研究》最新264页
专知会员服务
39+阅读 · 2025年7月14日
COLING2024 | 面向编程的自然语言处理综述
专知会员服务
28+阅读 · 2024年4月23日
【知识图谱@ACL2020】Knowledge Graphs in Natural Language Processing
专知会员服务
66+阅读 · 2020年7月12日
中文自然语言处理数据集:ChineseNLPCorpus
AINLP
35+阅读 · 2019年6月21日
自然语言处理精品资料
人工智能前沿讲习班
14+阅读 · 2019年3月13日
资源 | 《自然语言处理综论》中文版 PDF 高清版
AI科技评论
104+阅读 · 2019年2月23日
disentangled-representation-papers
CreateAMind
26+阅读 · 2018年9月12日
自然语言处理(NLP)数据集整理
论智
20+阅读 · 2018年4月8日
国家自然科学基金
0+阅读 · 2017年12月31日
国家自然科学基金
3+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
5+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
国家自然科学基金
8+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
Arxiv
0+阅读 · 6月16日
Arxiv
0+阅读 · 6月8日
Arxiv
12+阅读 · 2022年1月26日
Arxiv
17+阅读 · 2022年1月11日
VIP会员
最新内容
边缘计算的军事应用
专知会员服务
7+阅读 · 8月9日
一种考虑资源机动性的武器目标分配混合算法
专知会员服务
9+阅读 · 8月8日
《多域冲突比较支持模型》60页
专知会员服务
14+阅读 · 8月7日
相关VIP内容
《基于大型语言模型的软件工程自动化研究》最新264页
专知会员服务
39+阅读 · 2025年7月14日
COLING2024 | 面向编程的自然语言处理综述
专知会员服务
28+阅读 · 2024年4月23日
【知识图谱@ACL2020】Knowledge Graphs in Natural Language Processing
专知会员服务
66+阅读 · 2020年7月12日
相关资讯
中文自然语言处理数据集:ChineseNLPCorpus
AINLP
35+阅读 · 2019年6月21日
自然语言处理精品资料
人工智能前沿讲习班
14+阅读 · 2019年3月13日
资源 | 《自然语言处理综论》中文版 PDF 高清版
AI科技评论
104+阅读 · 2019年2月23日
disentangled-representation-papers
CreateAMind
26+阅读 · 2018年9月12日
自然语言处理(NLP)数据集整理
论智
20+阅读 · 2018年4月8日
相关基金
国家自然科学基金
0+阅读 · 2017年12月31日
国家自然科学基金
3+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
5+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
国家自然科学基金
8+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员