Bug datasets are vital for enabling deep learning techniques to address software maintenance tasks related to bugs. However, existing bug datasets suffer from precise and scale limitations: they are either small-scale but precise with manual validation or large-scale but imprecise with simple commit message processing. In this paper, we introduce PreciseBugCollector, a precise, multi-language bug collection approach that overcomes these two limitations. PreciseBugCollector is based on two novel components: a) A bug tracker to map the codebase repositories with external bug repositories to trace bug type information, and b) A bug injector to generate project-specific bugs by injecting noise into the correct codebases and then executing them against their test suites to obtain test failure messages. We implement PreciseBugCollector against three sources: 1) A bug tracker that links to the national vulnerability data set (NVD) to collect general-wise vulnerabilities, 2) A bug tracker that links to OSS-Fuzz to collect general-wise bugs, and 3) A bug injector based on 16 injection rules to generate project-wise bugs. To date, PreciseBugCollector comprises 1057818 bugs extracted from 2968 open-source projects. Of these, 12602 bugs are sourced from bug repositories (NVD and OSS-Fuzz), while the remaining 1045216 project-specific bugs are generated by the bug injector. Considering the challenge objectives, we argue that a bug injection approach is highly valuable for the industrial setting, since project-specific bugs align with domain knowledge, share the same codebase, and adhere to the coding style employed in industrial projects.
翻译:缺陷数据集对于应用深度学习技术解决与缺陷相关的软件维护任务至关重要。然而,现有缺陷数据集存在精准性与规模的双重局限:要么通过人工验证实现小规模但精准的缺陷标注,要么通过简单的提交信息处理获得大规模但不够精准的数据集。本文提出PreciseBugCollector——一种突破上述局限的精准多语言缺陷收集方法。该方法基于两个创新组件:a) 缺陷追踪器,通过代码仓库与外部缺陷仓库的映射关系追溯缺陷类型信息;b) 缺陷注入器,通过向正确代码库注入噪声生成项目特定缺陷,并利用测试套件执行获取测试失败信息。我们通过三个数据源实现PreciseBugCollector:1) 关联国家漏洞数据库(NVD)的缺陷追踪器,用于收集通用型漏洞;2) 关联OSS-Fuzz的缺陷追踪器,用于收集通用型缺陷;3) 基于16种注入规则的缺陷注入器,用于生成项目特定缺陷。目前PreciseBugCollector已包含从2968个开源项目中提取的1,057,818个缺陷。其中12,602个缺陷来源于缺陷仓库(NVD和OSS-Fuzz),其余1,045,216个项目特定缺陷由缺陷注入器生成。考虑到挑战目标,我们认为缺陷注入方法在工业场景中极具价值,因为项目特定缺陷既符合领域知识、共享相同代码库,又遵循工业项目的编码规范。