File size: 5,844 Bytes
00d1b38
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
---
license: unknown
task_categories:
  - tabular-regression
tags:
  - software-engineering
  - technical-debt
  - sonarqube
  - code-quality
  - mining-software-repositories
size_categories:
  - 100K<n<1M
---

# Technical Debt Regression Dataset

One row per `(repository_id, artifact_id, t0)` -- a single Java file, at a
weekly snapshot, in one of the source repositories. Built by scanning each
repo's history week-by-week with SonarQube and pairing each snapshot's
features with the technical debt that file has 3 weeks / 1 month / 3 months
later.

## Repositories covered

| repository_id | Source |
|---|---|
| OFBiz | apache/ofbiz-framework |
| SystemML | apache/systemds |
| Groovy | apache/groovy |
| NiFi | apache/nifi |
| Guava | google/guava |
| OkHttp | square/okhttp |

Each repo was scanned weekly (see `t0` per row) starting `2015-01-01`, for
60 weeks, on its default branch at scan time (`trunk` for OFBiz, `main` for
SystemML/NiFi/OkHttp, `master` for Groovy/Guava).

## Quick start

```python
import pandas as pd
df = pd.read_csv("hf://datasets/<your-username>/td-regression-mart/combined_td_mart.csv")
```

## ⚠️ Before you train anything, read this

- **`TD_3w` / `TD_1m` / `TD_3m` / `TD_*_status` / `path_at_*` are LABELS, not
  features.** Never include them in your feature matrix `X` -- they encode
  the future outcome you're trying to predict.
- **Filter each horizon independently.** A row can have `TD_3w` observed
  while `TD_3m` is still `UNKNOWN_OBSERVATION` (that horizon's scan window
  hasn't been reached yet). Don't drop a row just because one horizon isn't
  ready -- filter `TD_{h}_status == 'OBSERVED'` per horizon, per model.
- **Use the provided `partition` column for splitting**, don't re-shuffle
  randomly -- it's already a chronological, purged train/validation/test
  split designed to prevent a training row's future label window from
  overlapping a test row's T0. Drop `partition == 'PURGED'` rows entirely.

## Labels

| Column | Meaning |
|---|---|
| `TD_3w` | Technical debt (SonarQube remediation effort, minutes) on this file, 3 weeks after `t0` |
| `TD_1m` | Same, 4 weeks after `t0` |
| `TD_3m` | Same, 13 weeks after `t0` |
| `TD_{h}_status` | `OBSERVED` / `UNKNOWN_OBSERVATION` / `UNKNOWN_LINEAGE` / `EXCLUDED` -- check before using the target |
| `TD_{h}_exclusion_reason` | Why, if not `OBSERVED` |
| `path_at_{h}` | The file's path at that horizon (may differ from `t0` if renamed) |

"Technical debt" = sum of remediation-effort minutes across every SonarQube
issue (bug + vulnerability + code smell) active (OPEN/CONFIRMED/REOPENED) on
that file at that point in time.

## Row eligibility / split columns

| Column | Meaning |
|---|---|
| `eligible_t0` | Whether this row is usable as a T0 at all (production `.java` file + full trailing history available) |
| `exclusion_reason_t0` | Why not, if `eligible_t0` is false |
| `lineage_confidence` | `HIGH`/`MEDIUM`/`AMBIGUOUS`/`UNSUPPORTED` -- confidence the file's identity was tracked correctly across renames/copies |
| `split_family` | `CHRONOLOGICAL_POOLED`, or `REPOSITORY_HELD_OUT` for any repo passed as a full holdout |
| `partition` | `TRAIN` / `VALIDATION` / `TEST` / `PURGED` -- **drop `PURGED` rows** |
| `max_git_feature_ts` / `max_sonar_feature_ts` / `max_feature_ts` | Leakage-audit timestamps: the latest info-date any feature in this row could see. Should never exceed `t0`. |

## Identity columns

`origin_id`, `repository_id`, `artifact_id`, `lineage_id`, `path_at_t0`,
`t0` (the file's real historical commit date), `commit_hash_t0`,
`sonar_analysis_key_t0`, `language`.

## Features

**Git / process (trailing exact-day windows ending at `t0`):**
`ncloc_t0`, `file_age_days`, `commits_{30d,90d,180d}`,
`lines_added/deleted_{30d,90d,180d}`, `churn_{30d,90d,180d}`,
`authors_{30d,90d,180d}`, `days_since_last_change`, `commit_acceleration`,
`churn_acceleration`, `commit_burstiness_180d`, `churn_burstiness_180d`.

**Legacy 3-week-bucket git features (independent second measurement of similar signals):**
`total_lines_g3`, `commits_g3`, `churn_g3`, `churn_rate_g3`,
`commit_acceleration_g3`, `churn_acceleration_g3`, `commit_burstiness_g3`,
`churn_burstiness_g3`.

**SonarQube snapshot at `t0`:**
`finding_count_t0`, `finding_density_t0`, `bug/vulnerability/code_smell_remediation_effort_t0`,
`technical_debt_minutes_t0`, `technical_debt_density_t0`,
`{blocker,critical,major,minor,info}_finding_count_t0`,
`{code_smell,bug,vulnerability}_count_t0`, `complexity_t0`,
`cognitive_complexity_t0`, `duplicated_lines_density_t0`, `comment_lines_density_t0`.

**Trend + lifecycle (rolling `3w`/`1m`/`3m`/`6m` windows, blank until full trailing history exists):**
`finding_density_slope/volatility_*`, `technical_debt_density_slope/volatility_*`,
`complexity_slope_*`, `cognitive_complexity_slope_*`, `duplication_slope_*`,
`finding_arrivals_*`, `finding_closures_*`.

## Known limitations

- `identity_ambiguous_count` / `identity_excluded_count` are always 0 (not yet implemented).
- `file_age_days` undercounts true age for files older than (earliest scanned week − 180 days).
- Lineage (rename/copy) tracking is heuristic, not a certified production system -- treat `lineage_confidence != HIGH` with caution for horizon-dependent targets.
- Not every feature computed during pipeline construction made it into this table (e.g. `ownership_entropy_180d`, an alternate issue-survival label). Ask if you need one of these -- they exist in intermediate pipeline outputs and can be added.

## Citation / provenance

Built with a custom SonarQube-based mining pipeline: weekly-snapshot scanning
+ git-window feature extraction + Sonar trend/lifecycle features, assembled
into a chronologically-split regression mart. Questions about how a specific
column was computed -> ask the person who generated this dataset.