jitx/Methods2Test_java_unit_test_code
收藏资源简介:
微软创建了这个大型的Java JUnit测试用例数据集,包含与其对应的焦点方法。数据集共包含780k对JUnit测试用例和焦点方法,这些数据是从GitHub上的91K个Java开源项目中提取的。测试用例和焦点方法之间的映射基于启发式规则和Java开发者的最佳实践。数据集的结构包括目标测试用例、焦点方法、焦点类名、构造函数、方法签名和公共字段等特征。原始作者通过检查训练集中的97个样本来验证启发式规则的正确性,发现90.72%的样本在测试用例和焦点方法之间有正确的链接。
This large-scale Java JUnit test case dataset was created by Microsoft, which includes corresponding focal methods paired with each test case. The dataset consists of 780k pairs of JUnit test cases and focal methods, extracted from 91K open-source Java projects hosted on GitHub. The mapping between test cases and focal methods is based on heuristic rules and best practices for Java developers. The dataset structure includes features such as target test cases, focal methods, focal class names, constructors, method signatures, and public fields. The original authors verified the correctness of the heuristic rules by inspecting 97 samples from the training set, and found that 90.72% of the samples had correct links between test cases and focal methods.
数据集概述
数据集基本信息
- 许可证: MIT
- 数据文件配置:
- 训练集路径:
data/train-* - 测试集路径:
data/test-*
- 训练集路径:
- 数据集大小:
- 下载大小: 558984469 字节
- 数据集总大小: 4307277221 字节
数据集特征
- 目标: 字符串类型
- src_fm: 字符串类型
- src_fm_fc: 字符串类型
- src_fm_fc_co: 字符串类型
- src_fm_fc_ms: 字符串类型
- src_fm_fc_ms_ff: 字符串类型
数据集分割
- 训练集:
- 字节数: 3399525755
- 示例数: 624022
- 测试集:
- 字节数: 907751466
- 示例数: 156922
任务类别
- 文本生成
语言
- 英语
数据集标签
- 单元测试
- Java
- 代码
数据集结构
- 目标:
<TEST_CASE> - src_fm:
<FOCAL_METHOD> - src_fm_fc:
<FOCAL_CLASS_NAME> <FOCAL_METHOD> - src_fm_fc_co:
<FOCAL_CLASS_NAME> <FOCAL_METHOD> <CONTRSUCTORS> - src_fm_fc_ms:
<FOCAL_CLASS_NAME> <FOCAL_METHOD> <CONTRSUCTORS> <METHOD_SIGNATURES> - src_fm_fc_ms_ff:
<FOCAL_CLASS_NAME> <FOCAL_METHOD> <CONTRSUCTORS> <METHOD_SIGNATURES> <FIELDS>
焦点上下文级别
- FM: 焦点方法
- FM_FC: 焦点方法 + 焦点类名
- FM_FC_CO: 焦点方法 + 焦点类名 + 构造函数签名
- FM_FC_MS: 焦点方法 + 焦点类名 + 构造函数签名 + 公共方法签名
- FM_FC_MS_FF: 焦点方法 + 焦点类名 + 构造函数签名 + 公共方法签名 + 公共字段
限制
- 原始作者通过检查训练集中的97个样本(95%置信水平,10%误差范围)验证了启发式规则。90.72%的样本正确链接了测试案例和相应的焦点方法。




