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
16:00 - 17:40: Papers - API and Renaming at Cortez 2&3 Chair(s): Massimiliano Di PentaUniversity of Sannio | ||||||||||||||||||||||||||||||||||||||||||
16:00 - 16:20 Talk | CodeKernel: A Graph Kernel based Approach to the Selection of API Usage Examples Xiaodong GuThe Hong Kong University of Science and Technology, Hongyu ZhangThe University of Newcastle, Sunghun KimHong Kong University of Science and Technology Pre-print | |||||||||||||||||||||||||||||||||||||||||
16:20 - 16:40 Talk | Machine Learning Based Automated Method Name Recommendation: How Far Are We Lin Jiangbeijing university of posts and telecommunication, Hui LiuBeijing Institute of Technology, He JiangSchool of Software, Dalian University of Technology Link to publication Pre-print | |||||||||||||||||||||||||||||||||||||||||
16:40 - 17:00 Talk | MARBLE: Mining for Boilerplate Code to Identify API Usability Problems Daye NamCarnegie Mellon University, Amber HorvathCarnegie Mellon University, Andrew MacveanGoogle, Inc., Brad MyersCarnegie Mellon University, Bogdan VasilescuCarnegie Mellon University Pre-print | |||||||||||||||||||||||||||||||||||||||||
17:00 - 17:20 Talk | DIRE: A Neural Approach to Decompiled Identifier Renaming 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 University Pre-print Media Attached | |||||||||||||||||||||||||||||||||||||||||
17:20 - 17:40 Talk | Automatic Detection and Update Suggestion for Outdated API Names in Documentation 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 Technology Link to publication |