File size: 2,843 Bytes
adec9fd
 
46a3fb1
adec9fd
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
46a3fb1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
adec9fd
 
 
 
 
 
 
 
 
46a3fb1
 
 
 
adec9fd
c3f39e8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
---
dataset_info:
- config_name: default
  features:
  - name: id
    dtype: string
  - name: source
    dtype: string
  - name: target
    dtype: string
  - name: context_text
    dtype: string
  - name: prompt_context
    dtype: string
  - name: source_ctx
    dtype: string
  - name: ctx_included
    dtype: bool
  - name: static_status
    dtype: string
  - name: static_context
    dtype: string
  splits:
  - name: train
    num_bytes: 112149975
    num_examples: 6124
  - name: validation
    num_bytes: 17744417
    num_examples: 953
  - name: test
    num_bytes: 18424937
    num_examples: 1017
  download_size: 40944098
  dataset_size: 148319329
- config_name: methods2test_runnable
  features:
  - name: id
    dtype: string
  - name: source
    dtype: string
  - name: target
    dtype: string
  - name: context_text
    dtype: string
  - name: prompt_context
    dtype: string
  - name: source_ctx
    dtype: string
  - name: ctx_included
    dtype: bool
  - name: static_status
    dtype: string
  - name: static_context
    dtype: string
  splits:
  - name: test
    num_bytes: 102710743
    num_examples: 3266
  download_size: 17491567
  dataset_size: 102710743
configs:
- config_name: default
  data_files:
  - split: train
    path: data/train-*
  - split: validation
    path: data/validation-*
  - split: test
    path: data/test-*
- config_name: methods2test_runnable
  data_files:
  - split: test
    path: methods2test_runnable/test-*
---

# methods2test_small (cleaned) + static method-level context

Static context for unit-test generation, computed with tree-sitter from each row's `source` only
(no repository checkout; `target` is never read).

## Configs
- `default`: train / validation / test from [`NDe2V/methods2test_small_cleaned`](https://huggingface.co/datasets/NDe2V/methods2test_small_cleaned) @ `3d6a2f2061736202832b7ac2bb4e84e1c70668e8`
- `methods2test_runnable`: test from [`andstor/methods2test_runnable`](https://huggingface.co/datasets/andstor/methods2test_runnable) (`fm+fc+c+m+f+t+tc`) @ `ed8cded666b2f7d101ba04a7a8d121b6249d8c39`

## Added columns
| column | meaning |
|---|---|
| `static_context` | JSON string: focal, class_info, ast, cfg, dfg, cdg, paths, calls, types, fields, exceptions, metrics, test_case, test_hints, context_text |
| `context_text` | full text summary |
| `prompt_context` | compact Java comment actually used in the prompt ("" if dropped) |
| `source_ctx` | `prompt_context + source`: ready-to-use prompt for `Salesforce/codegen-350M-multi` within 2048 tokens |
| `ctx_included` | whether context fit the token budget |
| `static_status` | ok / partial / error |

```python
import json
from datasets import load_dataset
ds = load_dataset("NDe2V/methods2test_small_static", "default", split="train")
sc = json.loads(ds[0]["static_context"])   # nested AST/CFG/DFG/...
```