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.
翻译:重新使用其他程序员在 {A 论坛上共享的代码片断( 如 StackOverflow) 共享的代码片断的代码片断中共享的代码片断。 然而,软件开发者通常遵循的是软件开发者所遵循的一种常见做法。 但是,对于借出代码片断的标识器中完全合格的名称( FQN) 缺乏足够的信息, 导致严重的编译错误。 程序设计者要么必须手动搜索正确的 FQN 标识器的正确的 FQN, 这是一种烦琐和易出错的过程, 要么使用开发的工具自动识别正确的 FQN 。 尽管研究人员努力在代码片断中自动识别 FQN, 但当前的方法在实践时却缺乏准确性。 此外,这些工具侧重于在代码片断中解决 FQN 的标识器标识器, 但他们在寻找正确的第三方库( 即依赖性) 执行 FQN 时会留下挑战。 使用不正确的依赖性或不正确的依赖性版本, 可能导致一个无法被编译者探测到的语义错误。 因此, 在运行时会造成严重的损坏。 在本文中, 我们引入 DResp- ND 的版本中, 一个工具中, 将使用一个用于搜索 Q 。