arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 1403.4503cs.SE
收藏

自动折叠用于Source Code汇总

Autofolding for Source Code Summarization

Jaroslav Fowkes, Pankajan Chanthirasegaran, Razvan Ranca, Miltiadis Allamanis, Mirella Lapata, Charles Sutton

摘要:

开发人员花费大量时间阅读和浏览源代码,为摘要方法提供了新的机会。事实上,现代代码编辑器提供了代码折叠,允许有选择地隐藏代码块。然而,这是不切实际的使用,因为折叠决定必须手动或基于简单的规则。我们引入了自动折叠问题,即通过折叠信息量较少的代码区域来自动创建代码摘要。我们提出了一个新的解决方案,制定了一系列的AST折叠决策的问题,利用范围的主题模型的代码令牌。在一组受欢迎的开源项目的注释,我们表明,我们的总结优于简单的基线,产生28%的错误减少。此外,我们通过案例研究发现,我们的总结器是有经验的开发人员强烈的首选。更广泛地说,我们希望这项工作将通过将代码折叠变成一个可用的和有价值的工具来帮助程序理解。

英文摘要:

Developers spend much of their time reading and browsing source code, raising new opportunities for summarization methods. Indeed, modern code editors provide code folding, which allows one to selectively hide blocks of code. However this is impractical to use as folding decisions must be made manually or based on simple rules. We introduce the autofolding problem, which is to automatically create a code summary by folding less informative code regions. We present a novel solution by formulating the problem as a sequence of AST folding decisions, leveraging a scoped topic model for code tokens. On an annotated set of popular open source projects, we show that our summarizer outperforms simpler baselines, yielding a 28% error reduction. Furthermore, we find through a case study that our summarizer is strongly preferred by experienced developers. More broadly, we hope this work will aid program comprehension by turning code folding into a usable and valuable tool.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑