Empirical validation for the premise that tests act as executable requirements for issue localization. We evaluate three hypotheses: H1 Coverage feasibility, H2 Retrievability, and H3 Bridging effect.
We study whether tests can serve as executable requirements for localizing software engineering issues. The dataset includes 929 issue instances drawn from SWE-bench and SWE-bench Gym across 18 popular Python repositories. Each repository-issue pair is executed in a containerized environment reset to its pre-patch state. To prevent environment configuration errors from confounding results, we retain instances where the test environment is sufficiently robust (at least 50% of test functions execute successfully).
We collect function-level execution traces during test runs and retain only repository-internal functions. Standard library and third-party dependency calls are filtered out, and remaining functions are represented by their fully-qualified paths.
A code location is considered covered if it appears in the repository-internal function call trace of at least one executed test. Coverage is evaluated at three granularities: file, module (class or top-level function), and function. For search space reduction, we compare the size of the union of test-covered internal functions to the total number of internal functions in the repository for each instance.
H1 evaluates whether dynamic execution signals already exist in typical repositories. By intersecting test traces with the ground-truth edit sets, we measure how often tests reach the true edit locations and how much the candidate space can be compressed by trace-induced constraints.
| Metric | Mean | Median | Std | Min | Max |
|---|---|---|---|---|---|
| File-level coverage | 0.9698 (96.98%) | 1.0000 (100.00%) | 0.1550 | 0.0000 | 1.0000 |
| Module-level coverage | 0.7804 (78.04%) | 1.0000 (100.00%) | 0.3933 | 0.0000 | 1.0000 |
| Function-level coverage | 0.6670 (66.70%) | 1.0000 (100.00%) | 0.4178 | 0.0000 | 1.0000 |
| Search space (union coverage / total) | 0.5839 (58.39%) | 0.6188 (61.88%) | 0.2268 | 0.1117 | 0.8523 |
| Granularity | ≥ 75% | ≥ 90% |
|---|---|---|
| File-level | 898 / 929 (96.7%) | 886 / 929 (95.4%) |
| Module-level | 700 / 929 (75.3%) | 686 / 929 (73.8%) |
| Function-level | 546 / 929 (58.8%) | 504 / 929 (54.3%) |
RQ1: Coverage Statistics Report (Generated: 2026-01-05)
- Total Instances: 929
- File-level Mean: 0.9698
- Module-level Mean: 0.7804
- Function-level Mean: 0.6670
- Space Reduction Mean: 0.5839
H2 checks whether covering tests are distinguishable from non-covering tests via semantic signals. We compare similarity between the issue description and (i) tests that cover at least one ground-truth location and (ii) baseline tests sampled from the same repository that do not cover ground-truth locations.
| Statistic | Value | Notes |
|---|---|---|
| Win rate (covering > non-covering mean) | 90.9% | Across valid instances, covering tests show higher similarity than non-covering tests. |
| Paired t-test (per-instance means) | $p < 0.001$ (t = 38.8015) | Significant advantage of covering tests over non-covering tests. |
| Effect size (Cohen’s d) | 0.5573 | Medium-to-large practical effect. |
| Correlation (#GT covered vs similarity) | $\rho = 0.1809$, $p < 0.001$ | Tests covering more ground-truth locations tend to be more semantically aligned with the issue. |
RQ2: Semantic Similarity Statistics Report (Generated: 2026-01-05)
- Valid instances: 536
- Win rate: 90.9%
- Paired t-test p-value: 1.203337e-157
- Cohen's d: 0.5573
- Spearman ρ: 0.1809 (p < 0.001)
Similarity distributions vary across repositories and test suites. Comparing covering vs non-covering tests within each issue instance provides a more stable estimate of semantic distinguishability and reduces cross-project confounding.
For each (issue, location) pair where coverage exists, we compare direct similarity $s_{\text{direct}}=\mathrm{sim}(\text{issue}, \text{location})$ against a test-mediated pathway strength:
$$s_{\text{mediated}} = \max_{t \in \mathcal{T}_{\text{cover}}} \sqrt{\mathrm{sim}(\text{issue}, t)\cdot \mathrm{sim}(t,\text{location})}$$
This geometric-mean form ensures a strong bridge requires balanced semantic associations across both hops: Issue $\rightarrow$ Test and Test $\rightarrow$ Location.
| Statistic | Value | Notes |
|---|---|---|
| Direct pathway mean (std) | 0.6745 (0.0681) | $s_{\text{direct}}$ |
| Mediated pathway mean (std) | 0.7271 (0.0576) | $s_{\text{mediated}}$ |
| Win rate (mediated > direct) | 82.4% (1991 / 2416) | Bridging effect holds for most pairs. |
| Paired t-test | $p < 0.001$ (t = 45.4641) | Highly significant difference. |
| Wilcoxon signed-rank | $p < 0.001$ (W = 2,633,234) | Non-parametric confirmation. |
| Effect size (Cohen’s d) | 0.9251 (large) | Substantial practical improvement. |
RQ3: Tests as Semantic Bridges (Generated: 2026-01-07)
- Pairs analyzed: 2416
- direct_mean: 0.6745, mediated_mean: 0.7271
- Win rate: 82.4%
- Paired t-test: p < 0.001, Cohen's d: 0.9251
You can optionally place a small table of representative (issue, location) pairs here (e.g., a few with large positive deltas and a few with negative/near-zero deltas). Keep it short to avoid overwhelming the page.
| Instance | Location | $s_{direct}$ | $s_{mediated}$ | Best test |
|---|---|---|---|---|
pytest-dev__pytest-11143 |
src/_pytest/assertion/rewrite.py::AssertionRewriter.run |
0.7222 | 0.7567 | testing/test_assertrewrite.py::TestAssertionRewrite.test_rewrites_plugin_as_a_package |
sphinx-doc__sphinx-8548 |
sphinx/ext/autodoc/__init__.py::ClassDocumenter.get_object_members |
0.7573 | 0.8320 | tests/test_ext_autodoc.py::test_autodoc_inherited_members |
The empirical findings directly inform IssueExec’s design choices:
See Case Studies for illustrative good and bad cases, with intermediate artifacts (retrieved tests, trace-guided candidates, and final ranked locations).