DocumentCode :
176168
Title :
Mining API Usage Examples from Test Code
Author :
Zixiao Zhu ; Yanzhen Zou ; Bing Xie ; Yong Jin ; Zeqi Lin ; Lu Zhang
Author_Institution :
Sch. of Electron. Eng. & Comput. Sci., Peking Univ., Beijing, China
fYear :
2014
fDate :
Sept. 29 2014-Oct. 3 2014
Firstpage :
301
Lastpage :
310
Abstract :
Lack of effective usage examples in API documents has been proven to be a great obstacle to API learning. To deal with this issue, several approaches have been proposed to automatically extract usage examples from client code or related web pages, which are unfortunately not available for newly released API libraries. In this paper, we propose a novel approach to mining API usage examples from test code. Although test code can be a good source of usage examples, the issue of multiple test scenarios might lead to repetitive and interdependent API usages in a test method, which make it complicated and difficult to extract API usage examples. To address this issue, we study the JUnit test code and summarize a set of test code patterns. We employ a code pattern based heuristic slicing approach to separate test scenarios into code examples. Then we cluster the similar usage examples for recommendation. An evaluation on four open source software libraries demonstrates that the accuracy of our approach is much higher than the state-of-art approach eXoaDoc on test code. Furthermore, we have developed an Eclipse plug in tool Use Tec.
Keywords :
application program interfaces; data mining; object-oriented methods; program testing; public domain software; software libraries; API usage example mining; Eclipse plugin tool; JUnit test code; UsETeC; eXoaDoc; heuristic slicing approach; open source software libraries; test code patterns; usage example cluster; Arrays; Classification algorithms; Clustering algorithms; Data mining; Libraries; Web pages; API; code patterns; code slicing; test code; usage example;
fLanguage :
English
Publisher :
ieee
Conference_Titel :
Software Maintenance and Evolution (ICSME), 2014 IEEE International Conference on
Conference_Location :
Victoria, BC
ISSN :
1063-6773
Type :
conf
DOI :
10.1109/ICSME.2014.52
Filename :
6976096
Link To Document :
بازگشت