Autofolding for Source Code Summarization
By Jaroslav M. Fowkes, Pankajan Chanthirasegaran, Razvan Ranca, Miltiadis Allamanis, Mirella Lapata, Charles Sutton. 2014
57 citations recorded by the source corpus.
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 percent 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.
Subfields: Artificial Intelligence, Information Systems, Natural Language Processing
How researchers see this paper
The researchers whose trusted networks rank it highest, strongest advocate first. Every researcher gets a different order.
In Artificial Intelligence
- Miltiadis Allamanis
- Charles Sutton
- Earl T. Barr
- Premkumar T. Devanbu
- Bogdan Vasilescu
- Casey Casalnuovo
- Michael Pradel
- Eran Yahav
In Information Systems
- Miltiadis Allamanis
- Charles Sutton
- Earl T. Barr
- Premkumar T. Devanbu
- Michael Pradel
- Bogdan Vasilescu
- Koushik Sen
- Rishabh Singh
In Natural Language Processing
- Charles Sutton
- Premkumar T. Devanbu
- Miltiadis Allamanis
- Earl T. Barr
- Bogdan Vasilescu
- Michael Pradel
- Casey Casalnuovo
- Rishabh Singh
Citations in the corpus
- A Survey of Machine Learning for Big Code and Naturalness (2017, background): “stributed — White et al. [187]∗ Token + AST — Distributed Clone Detection Zaremba and Sutskever [197] Characters Execution Trace Distributed — application-specific measures. For example, Fowkes et al. [62] run a user study to directly assess the quality of their summarization method. 5 APPLICATIONS P”
- Recovering clear, natural identifiers from obfuscated JS names (2017, background): “There have been substantial further applications of statistical models for code, in areas such as coding standards mining and checking [1], code summarization [17], idiom mining [3, 37], and bug localization [41].”