DepRes:一个解析完全限定名及其重复性的工具
DepRes: A Tool for Resolving Fully Qualified Names and Their Dependencies
摘要:
重用其他程序员在Q&A论坛上共享的代码片段(例如,StackOverflow)是软件开发人员遵循的常见做法。但是,如果缺少关于借用代码段中标识符的完全限定名(FullyQualified Name,简称CQN)的足够信息,则会导致严重的编译错误。程序员要么必须手动搜索标识符的正确序列号,这是一个繁琐且容易出错的过程,要么使用开发的工具来自动识别正确的序列号。尽管研究人员努力自动识别代码片段中的CSN,但目前的方法在实践中的准确性很低。此外,虽然这些工具专注于解析代码片段中标识符的CNON,但它们留下了找到正确的第三方库(即,依赖性)实现未解决的CSDN。使用不正确的依赖项或依赖项的不正确版本可能会导致编译器无法检测到的语义错误。因此,它可能会在运行时造成严重损害。在本文中,我们将介绍DepRes,这是一个利用基于草图的方法来解析基于Java的代码片段中的CDN的工具,并为每个CDN推荐正确的依赖关系。DepRes工具的源代码、文档以及演示视频可从其代码库https://github.com/SoftwareDesignLab/DepRes-Tool获得。
英文摘要:
Reusing code snippets shared by other programmers on Q&A forums (e.g., StackOverflow) is a common practice followed by software developers. However, lack of sufficient information about the fully qualified name (FQN) of identifiers in borrowed code snippets, results in serious compile errors. Programmers either have to manually search for the correct FQN of identifiers which is a tedious and error-prone process, or use tools developed to automatically identify correct FQNs. Despite the efforts made by researchers to automatically identify FQNs in code snippets, the current approaches suffer from low accuracy when it comes to practice. Moreover, while these tools focus on resolving the FQN for an identifier in a code snippet, they leave the challenge of finding the correct third-party library (i.e., dependency) implementing that FQN unresolved. Using an incorrect dependency or incorrect version of a dependency might lead to a semantic error which is not detectable by compilers. Therefore, it can result in serious damages in the run-time. In this paper, we introduce DepRes, a tool that leverages a sketch-based approach to resolve FQNs in java-based code snippets and recommend the correct dependency for each FQN. The source code, documentation, as well as a demo video of DepRes tool is available from its code repository at https://github.com/SoftwareDesignLab/DepRes-Tool.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。