test / README.md
Maxros's picture
Upload dataset
881e4d4 verified
|
Raw
History Blame Contribute Delete
4.69 kB
---
license: mit
task_categories:
- text-generation
tags:
- code
- java
- refactoring
- benchmark
- software-engineering
size_categories:
- n<1K
dataset_info:
features:
- name: instance_id
dtype: string
- name: repo
dtype: string
- name: resource_tier
dtype: string
- name: repo_stars
dtype: float64
- name: repo_forks
dtype: float64
- name: language
dtype: string
- name: base_commit
dtype: string
- name: merge_commit
dtype: string
- name: refactoring_types
list: string
- name: refactoring_descriptions
list: string
- name: file_path
dtype: string
- name: source_code_before
dtype: string
- name: source_code_after
dtype: string
- name: diff
dtype: string
- name: is_pure_refactoring
dtype: bool
- name: compile_before
dtype: bool
- name: compile_after
dtype: bool
- name: tests_pass_before
dtype: bool
- name: tests_pass_after
dtype: bool
- name: FAIL_TO_PASS
list: string
- name: PASS_TO_PASS
list: string
- name: created_at
dtype: string
- name: repo_license
dtype: string
- name: lines_changed
dtype: float64
splits:
- name: test
num_bytes: 279451236
num_examples: 816
download_size: 245967508
dataset_size: 279451236
configs:
- config_name: default
data_files:
- split: test
path: data/test-*
---
# CS4570 Java Refactoring Benchmark
A benchmark of Java refactoring commits mined from GitHub repositories, split into **high-resource** and **low-resource** tiers based on repository popularity. Built for the TU Delft CS4570 ML for Software Engineering course (2026).
## Dataset split
| Tier | Repositories | Instances | Star range |
|------|-------------|-----------|------------|
| High-resource | 57 | 618 | 1000-7298 |
| Low-resource | ~60 | 198 | 13-90 |
| **Total** | | **816** | |
Use the `resource_tier` field to filter by tier. `repo_stars` and `repo_forks` are included for fine-grained popularity analysis.
## Construction
Each instance is a single-file refactoring commit that was:
1. Detected by **RefactoringMiner 3.1.3** as containing at least one Java refactoring operation
2. Verified by building the project before and after the commit using Docker (Maven/Gradle, JDK 17/21)
3. Filtered to commits where the project compiles and tests pass both before and after (pure refactorings)
High-resource repos have >=1000 stars and >=10 contributors; low-resource repos have <100 stars.
## Fields
| Field | Type | Description |
|-------|------|-------------|
| `instance_id` | string | Unique identifier |
| `repo` | string | owner/repo identifier |
| `resource_tier` | string | "high" or "low" |
| `repo_stars` | int or null | GitHub star count at collection time |
| `repo_forks` | int or null | GitHub fork count at collection time |
| `language` | string | Always "java" |
| `base_commit` | string | Parent commit SHA |
| `merge_commit` | string | Refactoring commit SHA |
| `refactoring_types` | list[str] | Refactoring type labels from RefactoringMiner |
| `refactoring_descriptions` | list[str] or null | Human-readable descriptions (HR only) |
| `file_path` | string | Java file path that was refactored |
| `source_code_before` | string | File content at base commit |
| `source_code_after` | string | File content at merge commit |
| `diff` | string | Unified diff between before and after |
| `is_pure_refactoring` | bool or null | True if only refactoring operations changed |
| `compile_before` | bool or null | Project compiled at base commit |
| `compile_after` | bool or null | Project compiled at merge commit |
| `tests_pass_before` | bool or null | All tests pass at base commit |
| `tests_pass_after` | bool or null | All tests pass at merge commit |
| `FAIL_TO_PASS` | list[str] | Tests failing before, passing after |
| `PASS_TO_PASS` | list[str] | Tests passing both before and after |
| `created_at` | string or null | Commit timestamp (ISO 8601) |
| `repo_license` | string or null | SPDX license identifier |
| `lines_changed` | int or null | Lines changed in the refactoring |
## Refactoring types
Top types across both tiers: Extract Method, Rename Method, Rename Variable, Rename Parameter, Extract Variable, Inline Variable, Change Variable Type, Add Parameter, Add Method Annotation, Rename Attribute.
66 unique refactoring types in total.
## Usage
```python
from datasets import load_dataset
ds = load_dataset("Maxros/test", split="test")
# Filter by tier
hr = ds.filter(lambda x: x["resource_tier"] == "high")
lr = ds.filter(lambda x: x["resource_tier"] == "low")
```
## Citation
```
TU Delft CS4570 -- ML for Software Engineering benchmark, 2026.
```