当前位置: X-MOL 学术J. Syst. Softw. › 论文详情
Our official English website, www.x-mol.net, welcomes your feedback! (Note: you will need to create a separate account there.)
Enhancing Example-Based Code Search with Functional Semantics
Journal of Systems and Software ( IF 3.5 ) Pub Date : 2020-07-01 , DOI: 10.1016/j.jss.2020.110568
Zhengzhao Chen , Renhe Jiang , Zejun Zhang , Yu Pei , Minxue Pan , Tian Zhang , Xuandong Li

Abstract As the quality and quantity of open source code increase, effective and efficient search for code implementing certain semantics, or semantics-based code search, has become an emerging need for software developers to retrieve and reuse existing source code. Previous techniques in semantics-based code search encode the semantics of loop-free Java code snippets as constraints and utilize an SMT solver to find encoded snippets that match an input/output (IO) query. We present in this article the Quebio approach to semantics-based search for Java methods. Quebio advances the state-of-the-art by supporting important language features like invocation to library APIs and enabling the search to handle more data types like array/List, Set, and Map. Compared with existing approaches, Quebio also integrates a customized keyword-based search that uses as the input a textual, behavioral summary of the desired methods to quickly prune the methods to be checked against the IO examples. To evaluate the effectiveness and efficiency of Quebio, we constructed a repository of 14,792 methods from 723 open source Java projects hosted on GitHub and applied the approach to resolve 47 queries extracted from StackOverflow. Quebio was able to find methods correctly implementing the specified IO behaviors for 43 of the queries, significantly outperforming the existing semantics-based code search techniques. The average search time with Quebio was 213.2 seconds for each query.

中文翻译:

使用功能语义增强基于示例的代码搜索

摘要 随着开源代码质量和数量的增加,有效且高效地搜索实现特定语义的代码或基于语义的代码搜索已成为软件开发人员检索和重用现有源代码的新兴需求。基于语义的代码搜索中的先前技术将无循环 Java 代码片段的语义编码为约束,并利用 SMT 求解器查找与输入/输出 (IO) 查询匹配的编码片段。我们在本文中介绍了 Quebio 方法,用于基于语义的 Java 方法搜索。Quebio 通过支持重要的语言功能(如对库 API 的调用)以及使搜索能够处理更多数据类型(如数组/列表、集合和映射)来推进最先进的技术。与现有方法相比,Quebio 还集成了一个自定义的基于关键字的搜索,该搜索使用所需方法的文本行为摘要作为输入,以根据 IO 示例快速修剪要检查的方法。为了评估 Quebio 的有效性和效率,我们从 GitHub 上托管的 723 个开源 Java 项目中构建了一个包含 14,792 个方法的存储库,并应用该方法解决了从 StackOverflow 中提取的 47 个查询。Quebio 能够为 43 个查询找到正确实现指定 IO 行为的方法,显着优于现有的基于语义的代码搜索技术。Quebio 每次查询的平均搜索时间为 213.2 秒。为了评估 Quebio 的有效性和效率,我们从 GitHub 上托管的 723 个开源 Java 项目中构建了一个包含 14,792 个方法的存储库,并应用该方法解决了从 StackOverflow 中提取的 47 个查询。Quebio 能够为 43 个查询找到正确实现指定 IO 行为的方法,显着优于现有的基于语义的代码搜索技术。Quebio 每次查询的平均搜索时间为 213.2 秒。为了评估 Quebio 的有效性和效率,我们从 GitHub 上托管的 723 个开源 Java 项目中构建了一个包含 14,792 个方法的存储库,并应用该方法解决了从 StackOverflow 中提取的 47 个查询。Quebio 能够为 43 个查询找到正确实现指定 IO 行为的方法,显着优于现有的基于语义的代码搜索技术。Quebio 每次查询的平均搜索时间为 213.2 秒。显着优于现有的基于语义的代码搜索技术。Quebio 每次查询的平均搜索时间为 213.2 秒。显着优于现有的基于语义的代码搜索技术。Quebio 每次查询的平均搜索时间为 213.2 秒。
更新日期:2020-07-01
down
wechat
bug