首页> 外文会议>Asia-Pacific Software Engineering Conference >Retrieving Self-Executable and Functionally Correct Code to Improve Source Code Search
【24h】

Retrieving Self-Executable and Functionally Correct Code to Improve Source Code Search

机译:检索可自行执行且功能正确的代码以改善源代码搜索

获取原文

摘要

Developers need to put lots of time and effort to reuse the code snippets retrieved by the existing code search engines. The reason is that these engines do not provide self-executable, functionally correct and easily understandable code snippets as search results. Developers manually resolve all the dependencies to make the code snippets executable in their development contexts. They have to write and execute the same test cases many times to check the correctness of the code fragments. In this paper, a technique has been proposed that converts each method in a code base into self-executable method (i.e., program slice) by resolving method calls, data and library dependencies. To ensure that the methods are functionally correct, automatic test scripts are generated and executed for each self-executable method based on the branch, statement, and path coverage. The understandability of the code fragments is increased by replacing irrelevant textual keywords with relevant words. All the self-executable code fragments are indexed using traditional Information Retrieval approach. So, when a user query is submitted, the technique will retrieve self-executable and functionally correct code snippets.
机译:开发人员需要花费大量时间和精力来重用现有代码搜索引擎检索到的代码片段。原因是这些引擎没有提供可自我执行,功能正确且易于理解的代码段作为搜索结果。开发人员手动解决所有依赖关系,以使代码段在其开发上下文中可执行。他们必须多次编写和执行相同的测试用例,以检查代码片段的正确性。在本文中,提出了一种通过解决方法调用,数据和库相关性将代码库中的每个方法转换为自可执行方法(即程序切片)的技术。为了确保这些方法在功能上正确无误,将根据分支,语句和路径覆盖率为每个自执行方法生成并执行自动测试脚本。通过将不相关的文本关键字替换为相关的单词,可以提高代码片段的可理解性。使用传统的信息检索方法对所有可自我执行的代码片段进行索引。因此,在提交用户查询时,该技术将检索可自动执行且功能正确的代码段。

著录项

相似文献

  • 外文文献
  • 中文文献
  • 专利
获取原文

客服邮箱:kefu@zhangqiaokeyan.com

京公网安备:11010802029741号 ICP备案号:京ICP备15016152号-6 六维联合信息科技 (北京) 有限公司©版权所有
  • 客服微信

  • 服务号