Generating API-usage Example for Project Developers

Zixiao Zhu,Yanzhen Zou,Yong Jin,Bing Xie
DOI: https://doi.org/10.1145/2532443.2532470
2013-01-01
Abstract:Usage examples have been shown very helpful for API learning in software reuse. Nowadays, many approaches have been proposed to automatically extract usage examples from client code or web pages for API users. However, they overlooked the benefit of API developers in example publishing and few works paid attention to help API developers to generate usage examples automatically. In this paper, we proposed an approach to generate API-usage example based on test code before the project are released. It analyzed which parts in test code are important for indicating API-usage and summarized some test code patterns, then a heuristic slice algorithm are proposed to extract referential test code as API-usage example based on these patterns. In the experiments, we gave some case studies on the commons-lang3 open source software library. It proved that our approach can provide good assistance for developers in APIs usage example generation.
What problem does this paper attempt to address?