xrepotest
收藏资源简介:
XRepoTest是一个多语言仓库级单元测试生成基准数据集,用于评估代码生成模型在真实开源仓库上下文中生成单元测试的能力。该数据集包含从Go、Rust、Julia、PHP、Ruby五种语言的真实开源仓库中提取的函数,每个任务项为一个待测函数,并配备其所在文件的完整源代码、函数结构信息和元数据。数据集分为三个版本:基础版(base)包含标准任务项;LSP增强版(lsp)包含经过语言服务器协议增强的任务项;检索增强版(rag)包含基于BM25或UnixCoder检索的上下文窗口任务项。主要字段包括任务ID、函数名、文件路径、待测函数代码(focal_code)、文件完整内容(file_content)、函数组件及元数据。该数据集适用于单元测试生成、代码补全、仓库级代码理解等任务,并支持通过Docker容器在真实代码库上执行和评分生成的测试。数据集采用MIT许可证发布,但原始源仓库保留各自许可证。
XRepoTest is a multilingual repository-level unit test generation benchmark dataset for evaluating the ability of code generation models to generate unit tests in the context of real open-source repositories. The dataset contains functions extracted from real open-source repositories in five languages: Go, Rust, Julia, PHP, and Ruby. Each task item is a function under test, accompanied by the complete source code of its file, function structure information, and metadata. The dataset is divided into three versions: the base version (base) contains standard task items; the LSP-enhanced version (lsp) contains task items enhanced by the Language Server Protocol; the retrieval-augmented version (rag) contains context window task items retrieved based on BM25 or UnixCoder. Main fields include task ID, function name, file path, focal code (focal_code), full file content (file_content), function components, and metadata. The dataset is suitable for tasks such as unit test generation, code completion, and repository-level code understanding, and supports executing and scoring generated tests on real codebases via Docker containers. The dataset is released under the MIT license, while the original source repositories retain their respective licenses.
XRepoTest 数据集概述
基本信息
- 名称: XRepoTest
- 许可协议: MIT
- 语言: 英语、代码
- 任务类别: 文本生成、其他
- 标签: 单元测试生成、仓库级别、代码生成、基准测试
核心定位
XRepoTest 是一个多语言、仓库级别的单元测试生成基准测试数据集(EMNLP 2026 主会论文数据),每项任务是从真实开源仓库中提取的一个函数,要求模型利用周围仓库上下文为该函数生成单元测试,生成的测试将在 Docker 容器内的真实代码库上执行并评分。
数据组织结构
| 文件夹 | 内容 | 对应流水线 |
|---|---|---|
data/base |
按语言划分的任务项 {lang}_functions.jsonl |
standard、file_context |
data/lsp |
LSP 增强的任务项 {lang}_functions_enriched.jsonl |
lsp_context |
data/rag |
检索增强任务项(ws<window>_ss<step>_k<top_k>,基于 bm25/unixcoder) |
rag_bm25、rag_dense |
支持语言
Go、Rust、Julia、PHP、Ruby —— 每种语言对应一个文件夹。
基础记录字段
task_id、function_name、file_pathfocal_code(被测函数)file_content(所在文件的完整源码)function_component/metadata(解析结构和来源信息)
可复现性说明
原始爬取源代码仓库的 repo_data/ 目录未公开在此数据集中。各语言的 Docker 评估镜像内置了语料库;数据集的构建可通过每条记录元数据中列出的公开源码仓库进行复现。
许可说明
数据集本身以 MIT 许可证发布。各源代码仓库保留其自身许可证,详细信息见每条记录中的来源元数据。
相关资源
- 论文:https://huggingface.co/papers/2608.25939
- 代码仓库:https://github.com/solis-team/XRepoTest




