Generating API-usage Example for Project Developers
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 APIusage and summarized some test code patterns,then a heuristic slice algorithm are proposed to extract referential test code as APIusage 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.
Software reuse usage example test code test scenario
Zixiao Zhu Yanzhen Zou Yong Jin Bing Xie
Software Institute,School of Electronics Engineering and Computer Science,Peking University;Key Laboratory of High Confidence Software Technologies,Ministry of Education Beijing,100871,China
国际会议
长沙
英文
199-202
2013-10-23(万方平台首次上网日期,不代表论文的发表时间)