CodeKernel: A Graph Kernel based Approach to the Selection of API Usage Examples
Developers often want to find out how to use a certain API (e.g., FileReader.read in JDK library). API usage examples are very helpful in this regard. Over the years, many automated methods have been proposed to generate code examples by clustering and summarizing relevant code snippets extracted from a code corpus. These approaches simplify source code as method invocation sequences or feature vectors. Such simplifications only model partial aspects of the code and tend to produce inaccurate examples.
We propose CodeKernel, a graph kernel based approach to the selection of API usage examples. Instead of approximating source code as method invocation sequences or feature vectors, CodeKernel represents source code as object usage graphs. Then, it clusters graphs by embedding them into a continuous space using a graph kernel. Finally, it outputs code examples by selecting a representative graph from each cluster using designed ranking metrics. Our empirical evaluation shows that CodeKernel selects more accurate code examples than MUSE and eXoaDocs. A user study involving 25 developers in a multinational company also confirms the usefulness of CodeKernel in selecting API usage examples.
Wed 13 Nov Times are displayed in time zone: (GMT-07:00) Tijuana, Baja California change
|16:00 - 16:20|
Xiaodong GuThe Hong Kong University of Science and Technology, Hongyu ZhangThe University of Newcastle, Sunghun KimHong Kong University of Science and TechnologyPre-print
|16:20 - 16:40|
Lin Jiangbeijing university of posts and telecommunication, Hui LiuBeijing Institute of Technology, He JiangSchool of Software, Dalian University of TechnologyLink to publication Pre-print
|16:40 - 17:00|
Daye NamCarnegie Mellon University, Amber HorvathCarnegie Mellon University, Andrew MacveanGoogle, Inc., Brad MyersCarnegie Mellon University, Bogdan VasilescuCarnegie Mellon UniversityPre-print
|17:00 - 17:20|
Jeremy LacomisCarnegie Mellon University, Pengcheng YinCarnegie Mellon University, Edward J. SchwartzCarnegie Mellon University Software Engineering Institute, Miltiadis AllamanisMicrosoft Research, Cambridge, Claire Le GouesCarnegie Mellon University, Graham NeubigCarnegie Mellon University, Bogdan VasilescuCarnegie Mellon UniversityPre-print Media Attached
|17:20 - 17:40|
Seonah LeeGyeongsang National University, Rongxin WuDepartment of Computer Science and Engineering, The Hong Kong University of Science and Technology, Shing-Chi CheungDepartment of Computer Science and Engineering, The Hong Kong University of Science and Technology, Sungwon KangKorea Advanced Institute of Science and TechnologyLink to publication