Maxros commited on
Commit
8533a11
·
verified ·
1 Parent(s): 1f10716

Update dataset card: combined HR+LR benchmark with resource_tier field

Browse files
Files changed (1) hide show
  1. README.md +70 -90
README.md CHANGED
@@ -1,110 +1,90 @@
1
  ---
2
- language:
3
- - code
4
- license: cc-by-4.0
5
  task_categories:
6
- - text-classification
7
  - text-generation
8
  tags:
 
 
9
  - refactoring
 
10
  - software-engineering
11
- - java
12
- - testing
13
- pretty_name: CS4570 Java Refactoring Benchmark (High-Resource)
14
  size_categories:
15
- - 1K<n<10K
16
- dataset_info:
17
- features:
18
- - name: instance_id
19
- dtype: string
20
- - name: repo
21
- dtype: string
22
- - name: language
23
- dtype: string
24
- - name: base_commit
25
- dtype: string
26
- - name: merge_commit
27
- dtype: string
28
- - name: refactoring_types
29
- list: string
30
- - name: file_path
31
- dtype: string
32
- - name: source_code_before
33
- dtype: string
34
- - name: source_code_after
35
- dtype: string
36
- - name: diff
37
- dtype: string
38
- - name: compile_before
39
- dtype: bool
40
- - name: compile_after
41
- dtype: bool
42
- - name: tests_pass_before
43
- dtype: bool
44
- - name: tests_pass_after
45
- dtype: bool
46
- - name: FAIL_TO_PASS
47
- list: 'null'
48
- - name: PASS_TO_PASS
49
- list: string
50
- - name: created_at
51
- dtype: string
52
- - name: repo_license
53
- dtype: string
54
- - name: lines_changed
55
- dtype: int64
56
- splits:
57
- - name: test
58
- num_bytes: 279451542
59
- num_examples: 816
60
- download_size: 245967998
61
- dataset_size: 279451542
62
- configs:
63
- - config_name: default
64
- data_files:
65
- - split: test
66
- path: data/test-*
67
  ---
68
 
69
- # CS4570 Java Refactoring Benchmark — High-Resource Tier
 
 
 
 
 
 
 
 
 
 
 
 
 
 
70
 
71
- This dataset contains Java refactoring commits mined from **57 high-resource GitHub repositories** (≥1000 stars, ≥10 contributors).
72
 
73
- Each commit was:
74
  1. Detected by **RefactoringMiner 3.1.3** as containing at least one Java refactoring operation
75
- 2. Verified by building the project and running its test suite **before and after** the commit using Docker (Maven/Gradle with JDK17/21)
 
76
 
77
- ## Statistics
78
- | Metric | Value |
79
- |--------|-------|
80
- | Repositories | 57 |
81
- | Total commits with tests | 983 |
82
- | PASS_TO_PASS commits | 981 |
83
- | Unique refactoring types | 66 |
84
 
85
  ## Fields
 
86
  | Field | Type | Description |
87
  |-------|------|-------------|
88
- | `repo` | string | `owner_repo` identifier |
89
- | `commit` | string | Git commit SHA |
90
- | `commit_url` | string | GitHub URL to the commit |
91
- | `repo_url` | string | GitHub URL to the repository |
92
- | `refactoring_count` | int | Number of refactorings in this commit |
 
 
 
93
  | `refactoring_types` | list[str] | Refactoring type labels from RefactoringMiner |
94
- | `compile_before` | bool | Did the project compile at the parent commit? |
95
- | `compile_after` | bool | Did the project compile after this commit? |
96
- | `tests_pass_before` | bool | Did ALL tests pass before? |
97
- | `tests_pass_after` | bool | Did ALL tests pass after? |
98
- | `test_count_before` | int | Number of tests before |
99
- | `test_count_after` | int | Number of tests after |
100
- | `pass_to_pass_tests` | list[str] | Tests that pass both before and after |
101
- | `fail_to_pass_tests` | list[str] | Tests that fail before but pass after |
102
- | `is_pass_to_pass` | bool | At least one P2P test exists |
103
- | `pass_to_pass_count` | int | Number of P2P tests |
104
- | `fail_to_pass_count` | int | Number of F2P tests |
105
-
106
- ## Refactoring Types
107
- Top types: Extract Variable, Add Method Annotation, Rename Variable, Rename Method, Inline Variable, Rename Parameter, Change Variable Type, Add Variable Modifier, Extract Method, Rename Attribute
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
108
 
109
  ## Citation
110
- TU Delft CS4570 — ML for Software Engineering benchmark, 2026.
 
 
 
 
1
  ---
2
+ license: mit
 
 
3
  task_categories:
 
4
  - text-generation
5
  tags:
6
+ - code
7
+ - java
8
  - refactoring
9
+ - benchmark
10
  - software-engineering
 
 
 
11
  size_categories:
12
+ - n<1K
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
13
  ---
14
 
15
+ # CS4570 Java Refactoring Benchmark
16
+
17
+ 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).
18
+
19
+ ## Dataset split
20
+
21
+ | Tier | Repositories | Instances | Star range |
22
+ |------|-------------|-----------|------------|
23
+ | High-resource | 57 | 618 | 1000-7298 |
24
+ | Low-resource | ~60 | 198 | 13-90 |
25
+ | **Total** | | **816** | |
26
+
27
+ Use the `resource_tier` field to filter by tier. `repo_stars` and `repo_forks` are included for fine-grained popularity analysis.
28
+
29
+ ## Construction
30
 
31
+ Each instance is a single-file refactoring commit that was:
32
 
 
33
  1. Detected by **RefactoringMiner 3.1.3** as containing at least one Java refactoring operation
34
+ 2. Verified by building the project before and after the commit using Docker (Maven/Gradle, JDK 17/21)
35
+ 3. Filtered to commits where the project compiles and tests pass both before and after (pure refactorings)
36
 
37
+ High-resource repos have >=1000 stars and >=10 contributors; low-resource repos have <100 stars.
 
 
 
 
 
 
38
 
39
  ## Fields
40
+
41
  | Field | Type | Description |
42
  |-------|------|-------------|
43
+ | `instance_id` | string | Unique identifier |
44
+ | `repo` | string | owner/repo identifier |
45
+ | `resource_tier` | string | "high" or "low" |
46
+ | `repo_stars` | int or null | GitHub star count at collection time |
47
+ | `repo_forks` | int or null | GitHub fork count at collection time |
48
+ | `language` | string | Always "java" |
49
+ | `base_commit` | string | Parent commit SHA |
50
+ | `merge_commit` | string | Refactoring commit SHA |
51
  | `refactoring_types` | list[str] | Refactoring type labels from RefactoringMiner |
52
+ | `refactoring_descriptions` | list[str] or null | Human-readable descriptions (HR only) |
53
+ | `file_path` | string | Java file path that was refactored |
54
+ | `source_code_before` | string | File content at base commit |
55
+ | `source_code_after` | string | File content at merge commit |
56
+ | `diff` | string | Unified diff between before and after |
57
+ | `is_pure_refactoring` | bool or null | True if only refactoring operations changed |
58
+ | `compile_before` | bool or null | Project compiled at base commit |
59
+ | `compile_after` | bool or null | Project compiled at merge commit |
60
+ | `tests_pass_before` | bool or null | All tests pass at base commit |
61
+ | `tests_pass_after` | bool or null | All tests pass at merge commit |
62
+ | `FAIL_TO_PASS` | list[str] | Tests failing before, passing after |
63
+ | `PASS_TO_PASS` | list[str] | Tests passing both before and after |
64
+ | `created_at` | string or null | Commit timestamp (ISO 8601) |
65
+ | `repo_license` | string or null | SPDX license identifier |
66
+ | `lines_changed` | int or null | Lines changed in the refactoring |
67
+
68
+ ## Refactoring types
69
+
70
+ 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.
71
+
72
+ 66 unique refactoring types in total.
73
+
74
+ ## Usage
75
+
76
+ ```python
77
+ from datasets import load_dataset
78
+
79
+ ds = load_dataset("Maxros/test", split="test")
80
+
81
+ # Filter by tier
82
+ hr = ds.filter(lambda x: x["resource_tier"] == "high")
83
+ lr = ds.filter(lambda x: x["resource_tier"] == "low")
84
+ ```
85
 
86
  ## Citation
87
+
88
+ ```
89
+ TU Delft CS4570 -- ML for Software Engineering benchmark, 2026.
90
+ ```