论文标题
关于嫁给杜松子酒和PMD的实用程序,以改善堆栈溢出代码片段
On the Utility of Marrying GIN and PMD for Improving Stack Overflow Code Snippets
论文作者
论文摘要
软件开发人员越来越依赖于问答门户和用于编码解决方案的博客。尽管此类接口提供了有用的信息,但担心此处托管的代码通常是不正确的,不安全的或不完整的。以前的工作确实通过使用静态分析检测到堆栈溢出的代码中的一系列故障。静态分析可能会在快速建立在线可用的软件代码的健康方面走得很大。此外,实现快速自动化程序改进的机制可能会增强此类代码。因此,我们提供了此概念证明。我们使用PMD静态分析工具来检测堆栈溢出Java代码片段样本的性能故障,然后使用杜松子酒在这些片段上执行突变。然后,我们在杜松子酒突变后重新分析这些片段中的性能故障。杜松子酒的随机抽动器用于在3,034个片段上执行17,986条独特的线条和语句补丁,其中从770个修补版本中删除了PMD违规行为。我们的结果表明,静态分析技术可以与自动化的程序改进方法相结合,以增强资源需求很少的公开代码。我们在这方面讨论了我们计划的研究议程。
Software developers are increasingly dependent on question and answer portals and blogs for coding solutions. While such interfaces provide useful information, there are concerns that code hosted here is often incorrect, insecure or incomplete. Previous work indeed detected a range of faults in code provided on Stack Overflow through the use of static analysis. Static analysis may go a far way towards quickly establishing the health of software code available online. In addition, mechanisms that enable rapid automated program improvement may then enhance such code. Accordingly, we present this proof of concept. We use the PMD static analysis tool to detect performance faults for a sample of Stack Overflow Java code snippets, before performing mutations on these snippets using GIN. We then re-analyse the performance faults in these snippets after the GIN mutations. GIN's RandomSampler was used to perform 17,986 unique line and statement patches on 3,034 snippets where PMD violations were removed from 770 patched versions. Our outcomes indicate that static analysis techniques may be combined with automated program improvement methods to enhance publicly available code with very little resource requirements. We discuss our planned research agenda in this regard.