goldset
收藏资源简介:
Goldset 是一个经过验证的 bug-fix 记录数据集,专门用于评估编码代理(coding agents)。数据集包含 896 条记录,来自 352 个 Python 项目,修复提交时间范围为 2010-06-13 至 2026-08-17。每条记录对应一个真实的软件缺陷,包括作者编写的修复代码以及一个在修复前失败、修复后通过的测试用例。记录仅当两次运行(失败和通过)均被观察到后才保留,确保是可靠的可重现记录。数据集支持缺陷修复、缺陷检测、工具与脚手架评估等多种任务。数据结构包含 26 个字段,如 repo、source_before、source_after、test_file、fail_to_pass 等。构建流程仅从宽松许可证项目中查找同时修改源代码和测试文件的提交,运行作者测试并验证,约 10% 候选记录通过验证,全程不使用语言模型。验证方法通过独立脚本交叉验证。局限性包括测试通过不等于修复正确、不是缺陷随机样本、仅限 Python、可能存在污染。未发布部分保留记录,公开部分采用 CC BY 4.0 许可证。
Goldset is a validated bug-fix record dataset specifically designed for evaluating coding agents. It contains 896 records from 352 Python projects, with fix commit dates ranging from 2010-06-13 to 2026-08-17. Each record corresponds to a real software defect, including the authors fix code and a test case that fails before the fix and passes after the fix. Records are retained only when both runs (fail and pass) are observed, ensuring reliable reproducible records. The dataset supports multiple tasks such as bug fixing, bug detection, and tool/scaffold evaluation. Each record has 26 fields, including repo, source_before, source_after, test_file, fail_to_pass, etc. The construction process only looks for commits that modify both source code and test files from permissively licensed projects, runs the authors tests (must fail before fix and pass after fix), and only retains records that can be isolated to a single function or entire file. About 10% of candidate records pass verification. No language model is used in the entire process. The validation method uses an independent script to re-clone repos, check out two commits, and re-run tests for cross-validation. Limitations include: passing tests does not guarantee correct fixes, records are not a random sample of defects, only Python, and potential contamination. A portion of records is withheld from public release; the public part is released under CC BY 4.0 license.
Goldset 数据集概述
基本信息
- 数据集名称:Goldset
- 许可证:CC BY 4.0
- 语言:英语(单语)
- 数据规模:896条记录(N<1K),来自352个Python项目
- 任务类别:文本生成(text2text-generation)、文本生成(text-generation)
- 标签:代码、软件工程、程序修复、缺陷修复、评估、基准测试、Python
数据内容
Goldset 是一个经过验证的缺陷修复记录数据集,每条记录包含:
- 真实软件中的实际缺陷
- 作者编写的修复代码
- 修复前失败、修复后通过的测试用例
- 记录仅在实际运行验证通过后发布,提供的是可复现的验证结果而非未经证实的声明
时间范围
修复提交时间介于2010年6月13日至2026年8月17日之间。
数据结构
数据集包含以下主要字段:
- 仓库信息:
repo、repo_url - 单元信息:
unit、module、units_changed - 粒度类型:
granularity(function表示单函数隔离,file表示整个变更文件) - 规格说明:
spec、spec_source(来自docstring或提交信息) - 代码变更:
source_before(修复前)、source_after(修复后) - 测试信息:
test_file、fail_to_pass(pytest节点ID) - 提交信息:
commit、parent、commit_url - 日期信息:
committed_at、parent_at - 许可证信息:
license、license_file、also_in - 身份标识:
fingerprint、id - 规模指标:
diff_lines、n_tests - 审计信息:
validated_at、validator
数据划分
- 单一测试集(test split):896条示例
- 文件名:oracles.parquet
支持任务
- 缺陷修复:向模型提供修复前代码和规格说明,要求生成修复方案,并用测试用例作为奖励信号
- 缺陷检测:判断代码是否包含缺陷,以修复后代码作为ground truth
- 脚手架和模型评估:通过可执行测试来测量模型本身与外部工具/代理框架对评分贡献的差异
记录构建流程
- 仅在一许可证的开源项目中寻找同时修改源码和测试的提交
- 运行提交前的测试,必须失败
- 运行修复后的测试,必须通过
- 保留变更函数及其docstring,或无法干净隔离时保留整个文件
- 约十分之一的候选记录通过验证
- 整个流程无需使用语言模型
验证方法
提供独立的验证脚本(verify.py),该脚本与生成语料的流水线无共享代码,会重新克隆项目、检出两个提交、重新应用修复提交的测试并再次运行,以独立验证记录的正确性。
局限性
- 测试通过不等于修复正确,仅表示记录的测试通过
- 非缺陷的随机样本,仅包含同一提交中附带回归测试并能缩减到单个单元或文件的真实修复
- 仅支持Python
- 可能存在数据污染风险(每条记录都来自公共仓库,可能已在模型预训练数据中),因此每条记录都附带日期
许可证与归属
- 源代码摘录保留原项目许可证
- 验证结果、架构和整理层以CC BY 4.0发布
- 许可证分布:MIT(629条)、Apache-2.0(117条)、BSD-3-Clause(81条)、BSD-2-Clause(64条)、PSF-2.0(4条)、ISC(1条)
数据集链接
- 官方网站:https://goldset.dev
- 代码和验证器:https://github.com/andysalvo/goldset




