Computer Science > Software Engineering
[Submitted on 18 Mar 2014 (v1), revised 6 Feb 2016 (this version, v4), latest version 6 Mar 2017 (v5)]
Title:Autofolding for Source Code Summarization
View PDFAbstract: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 it as a subtree optimization problem, 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.
Submission history
From: Jaroslav Fowkes [view email][v1] Tue, 18 Mar 2014 15:29:08 UTC (473 KB)
[v2] Fri, 5 Sep 2014 22:06:08 UTC (361 KB)
[v3] Mon, 18 May 2015 13:14:05 UTC (109 KB)
[v4] Sat, 6 Feb 2016 15:41:34 UTC (108 KB)
[v5] Mon, 6 Mar 2017 11:10:50 UTC (633 KB)
Bibliographic and Citation Tools
Bibliographic Explorer (What is the Explorer?)
Litmaps (What is Litmaps?)
scite Smart Citations (What are Smart Citations?)
Code, Data and Media Associated with this Article
CatalyzeX Code Finder for Papers (What is CatalyzeX?)
DagsHub (What is DagsHub?)
Gotit.pub (What is GotitPub?)
Papers with Code (What is Papers with Code?)
ScienceCast (What is ScienceCast?)
Demos
Recommenders and Search Tools
Influence Flower (What are Influence Flowers?)
Connected Papers (What is Connected Papers?)
CORE Recommender (What is CORE?)
arXivLabs: experimental projects with community collaborators
arXivLabs is a framework that allows collaborators to develop and share new arXiv features directly on our website.
Both individuals and organizations that work with arXivLabs have embraced and accepted our values of openness, community, excellence, and user data privacy. arXiv is committed to these values and only works with partners that adhere to them.
Have an idea for a project that will add value for arXiv's community? Learn more about arXivLabs.