Making sense of online code snippets

  • Authors:
  • Siddharth Subramanian;Reid Holmes

  • Affiliations:
  • University of Waterloo, Canada;University of Waterloo, Canada

  • Venue:
  • Proceedings of the 10th Working Conference on Mining Software Repositories
  • Year:
  • 2013

Quantified Score

Hi-index 0.00

Visualization

Abstract

Stack Overflow contains a large number of high quality source code snippets. The quality of these snippets has been verified by users marking them as solving a specific problem. Stack Overflow treats source code snippets as plain text and searches surface snippets as they would any other text. Unfortunately, plain text does not capture the structural qualities of these snippets; for example, snippets frequently refer to specific API (e.g., Android), but by treating the snippets as text, linkage to the Android API is not always apparent. We perform snippet analysis to extract structural information from short plain-text snippets that are often found in Stack Overflow. This analysis is able to identify 253,137 method calls and type references from 21,250 Stack Overflow code snippets. We show how identifying these structural relationships from snippets could perform better than lexical search over code blocks in practice.