Relationship-Aware Code Search for JavaScript Frameworks | |
Li, Xuan ; Wang, Zerui ; Wang, Qianxiang ; Yang, Shoumeng ; Xie, Tao ; Mei, Hong | |
2016 | |
关键词 | Code search JavaScript code mining natural language processing |
英文摘要 | JavaScript frameworks, such as jQuery, are widely used for developing web applications. To facilitate using these JavaScript frameworks to implement a feature (e.g., functionality), a large number of programmers often search for code snippets that implement the same or similar feature. However, existing code search approaches tend to be ineffective, without taking into account the fact that JavaScript code snippets often implement a feature based on various relationships (e.g., sequencing, condition, and callback relationships) among the invoked framework API methods. To address this issue, we present a novel Relationship Aware Code Search (RACS) approach for finding code snippets that use JavaScript frameworks to implement a specific feature. In advance, RACS collects a large number of code snippets that use some JavaScript frameworks, mines API usage patterns from the collected code snippets, and represents the mined patterns with method call relationship (MCR) graphs, which capture framework API methods' signatures and their relationships. Given a natural language (NL) search query issued by a programmer, RACS conducts NL processing to automatically extract an action relationship (AR) graph, which consists of actions and their relationships inferred from the query. In this way, RACS reduces code search to the problem of graph search: finding similar MCR graphs for a given AR graph. We conduct evaluations against representative real-world jQuery questions posted on Stack Overflow, based on 308,294 code snippets collected from over 81,540 files on the Internet. The evaluation results show the effectiveness of RACS: the top 1 snippet produced by RACS matches the target code snippet for 46% questions, compared to only 4% achieved by a relationship-oblivious approach.; CPCI-S(ISTP); lixuan12@sei.pku.edu.cn; wangzr13@sei.pku.edu.cn; wqx@sei.pku.edu.cn; shoumeng.yan@intel.com; taoxie@illinois.edu; meih@sei.pku.edu.cn; 690-701 |
语种 | 英语 |
出处 | 24th ACM SIGSOFT International Symposium on Foundations of Software Engineering (FSE) |
DOI标识 | 10.1145/2950290.2950341 |
内容类型 | 其他 |
源URL | [http://ir.pku.edu.cn/handle/20.500.11897/459857] |
专题 | 信息科学技术学院 |
推荐引用方式 GB/T 7714 | Li, Xuan,Wang, Zerui,Wang, Qianxiang,et al. Relationship-Aware Code Search for JavaScript Frameworks. 2016-01-01. |
个性服务 |
查看访问统计 |
相关权益政策 |
暂无数据 |
收藏/分享 |
除非特别说明,本系统中所有内容都受版权保护,并保留所有权利。
修改评论