DocumentCode
1607281
Title
How Can I Use This Method?
Author
Moreno, Laura ; Bavota, Gabriele ; Di Penta, Massimiliano ; Oliveto, Rocco ; Marcus, Andrian
Author_Institution
Univ. of Texas at Dallas, Dallas, TX, USA
Volume
1
fYear
2015
Firstpage
880
Lastpage
890
Abstract
Code examples are small source code fragments whose purpose is to illustrate how a programming language construct, an API, or a specific function/method works. Since code examples are not always available in the software documentation, researchers have proposed techniques to automatically extract them from existing software or to mine them from developer discussions. In this paper we propose MUSE (Method USage Examples), an approach for mining and ranking actual code examples that show how to use a specific method. MUSE combines static slicing (to simplify examples) with clone detection (to group similar examples), and uses heuristics to select and rank the best examples in terms of reusability, understandability, and popularity. MUSE has been empirically evaluated using examples mined from six libraries, by performing three studies involving a total of 140 developers to: (i) evaluate the selection and ranking heuristics, (ii) provide their perception on the usefulness of the selected examples, and (iii) perform specific programming tasks using the MUSE examples. The results indicate that MUSE selects and ranks examples close to how humans do, most of the code examples (82%) are perceived as useful, and they actually help when performing programming tasks.
Keywords
program slicing; programming languages; software engineering; source code (software); MUSE; clone detection; method usage examples; programming language; software development; software documentation; source code fragment; static slicing; Cloning; Context; Data mining; Documentation; Libraries; Measurement; Software; Code examples; Empirical studies; Software documentation; Static software analysis;
fLanguage
English
Publisher
ieee
Conference_Titel
Software Engineering (ICSE), 2015 IEEE/ACM 37th IEEE International Conference on
Conference_Location
Florence
Type
conf
DOI
10.1109/ICSE.2015.98
Filename
7194634
Link To Document