Leveraging Informal Documentation to Summarize Classes and Methods in Context

Latifa Guerrouj, David Bourque, Peter C. Rigby · 2015

Critical information related to a software developer'scurrent task is trapped in technical developer discussions,bug reports, code reviews, and other software artefacts. Muchof this information pertains to the proper use of code elements(e.g., methods and classes) that capture vital problem domainknowledge. To understand the purpose of these code elements,software developers must either access documentation and onlineposts and understand the source code or peruse a substantialamount of text. In this paper, we use the context that surroundscode elements in StackOverflow posts to summarize the use andpurpose of code elements. To provide focus to our investigation,we consider the generation of summaries for library identifiersdiscussed in StackOverflow. Our automatic summarization approachwas evaluated on a sample of 100 randomly-selectedlibrary identifiers with respect to a benchmark of summariesprovided by two annotators. The results show that the approachattains an R-precision of 54%, which is appropriate given thediverse ways in which code elements can be used.

Read the paper · More papers on PaperTik