DocumentCode
2442143
Title
Automatic parameter recommendation for practical API usage
Author
Zhang, Cheng ; Yang, Juyuan ; Zhang, Yi ; Fan, Jing ; Zhang, Xin ; Zhao, Jianjun ; Ou, Peizhao
Author_Institution
Dept. of Comput. Sci. & Eng., Shanghai Jiao Tong Univ., Shanghai, China
fYear
2012
fDate
2-9 June 2012
Firstpage
826
Lastpage
836
Abstract
Programmers extensively use application programming interfaces (APIs) to leverage existing libraries and frameworks. However, correctly and efficiently choosing and using APIs from unfamiliar libraries and frameworks is still a non-trivial task. Programmers often need to ruminate on API documentations (that are often incomplete) or inspect code examples (that are often absent) to learn API usage patterns. Recently, various techniques have been proposed to alleviate this problem by creating API summarizations, mining code examples, or showing common API call sequences. However, few techniques focus on recommending API parameters. In this paper, we propose an automated technique, called Precise, to address this problem. Differing from common code completion systems, Precise mines existing code bases, uses an abstract usage instance representation for each API usage example, and then builds a parameter usage database. Upon a request, Precise queries the database for abstract usage instances in similar contexts and generates parameter candidates by concretizing the instances adaptively. The experimental results show that our technique is more general and applicable than existing code completion systems, specially, 64% of the parameter recommendations are useful and 53% of the recommendations are exactly the same as the actual parameters needed. We have also performed a user study to show our technique is useful in practice.
Keywords
application program interfaces; data mining; learning (artificial intelligence); query processing; recommender systems; API call sequences; API documentations; API summarizations; API usage pattern learning; Precise; abstract usage instance representation; application programming interfaces; automatic parameter recommendation; code base mining; code completion systems; code example mining; database querying; inspect code examples; parameter usage database; practical API usage; Abstracts; Arrays; Complexity theory; Context; Documentation; Indexes; API; argument; code completion; parameter; recommendation;
fLanguage
English
Publisher
ieee
Conference_Titel
Software Engineering (ICSE), 2012 34th International Conference on
Conference_Location
Zurich
ISSN
0270-5257
Print_ISBN
978-1-4673-1066-6
Electronic_ISBN
0270-5257
Type
conf
DOI
10.1109/ICSE.2012.6227136
Filename
6227136
Link To Document