Mining API Usage Examples from Test Code

ICSME(2014)

引用 40|浏览43
暂无评分
摘要
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.
更多
查看译文
关键词
public domain software,junit test code,api usage example mining,api, usage example, test code, code patterns, code slicing,application program interfaces,program testing,code patterns,open source software libraries,usage example cluster,heuristic slicing approach,code slicing,usage example,exoadoc,eclipse plugin tool,test code patterns,data mining,api,software libraries,test code,usetec,object-oriented methods
AI 理解论文
溯源树
样例
生成溯源树,研究论文发展脉络
Chat Paper
正在生成论文摘要