Incomplete Data and Inference · Vol. 1 No. 1 (2026)
Original publication: October 17, 2026

The Word Test Is Not a Patch Role: Filename Heuristics in SWE-bench Lite

Nicholas Butler, Luke Parker, Matthew Fisher

Nicholas Butler — Sweden; Luke Parker — Denmark; Matthew Fisher — Norway

Static audit of captured reference-patch metadata. Labels describe benchmark patch fields, not a universal semantic distinction between testing and implementation code.

Abstract

Seventeen filename disagreements came from a testing framework's own implementation. In 300 SWE-bench Lite tasks, a rule labeling any path containing test as a test-patch file marked 17 solution-patch entries positive, all under pytest's implementation directory. A fixed directory-and-basename rule agreed with all 678 captured file-role entries. That perfect captured agreement should not be read as general accuracy: every observed improvement came from one repository. The audit shows how a convenient string proxy can distort labels about what a code change modifies, while leaving the semantic meaning of those files unexamined.

1. A small naming rule can change an annotation

Coding datasets often distinguish an issue-solving change from the tests used to assess it. An analyst may try to reconstruct that distinction from file paths rather than retaining the benchmark's separate patch fields. A simple shortcut is to search for the substring test. This seems plausible until the project itself is a testing framework and ordinary implementation paths contain the same string.

The research question is whether two fixed path heuristics recover the solution-versus-test patch roles assigned in the captured SWE-bench Lite metadata. We compare a broad substring rule with a rule based on named directories and Python-style test basenames. The benchmark field supplies the comparison label. It is not treated as semantic ground truth about everything a file does.

Tao and Kamata, 2026 study fine-tuning coding assistants from pairwise preferences about what to change. Before preferences about a change can be interpreted, its affected files and their roles need defensible labels. This audit investigates one source of label disagreement in that preparatory process. It does not train an assistant, evaluate patch correctness, or infer which candidate a human would prefer.

The distinction between role and meaning is central. A testing framework's implementation is code used to perform testing, but it can still belong to the benchmark's solution patch rather than its designated test patch. Calling the substring rule wrong in the current audit therefore means disagreement with a named metadata role. It does not mean that the word testing is semantically inappropriate for the project.

2. What filename proxies can and cannot establish

SWE-bench evaluates issue resolution in real repositories and supplies reference changes and test-related metadata (Jimenez et al., 2023). Agent systems built around these tasks, including SWE-agent and Agentless, have broader operational behavior than a filename classifier (Yang et al., 2024; Xia et al., 2024). Our unit is a captured patch file entry. It is not an agent action, a successfully repaired issue, or an executed evaluation run.

Studies of modern code review emphasize the purposes and challenges of interpreting changes (Bacchelli and Bird, 2013). Mining repository history also requires care about the objects extracted from version control (Bird et al., 2009). A path is a readily available artifact, but naming conventions and repository structure can make a text pattern behave differently across projects. The present rules intentionally avoid repository-specific exceptions so that such differences remain visible.

Misclassification can materially affect software-research conclusions (Herzig et al., 2013). Here a mislabeled solution entry could make an analysis overstate the amount of test editing or misdescribe a candidate's scope. Those downstream consequences are plausible uses of the labels, not outcomes measured by this experiment. We measure only agreement with the source patch partition and retain examples of the disagreements.

Test selection and prioritization have their own objectives (Rothermel et al., 2001; Yoo and Harman, 2012). Locating a test-related file may be an input to those procedures, but the classification itself does not show that a particular test should run or that an omitted test is irrelevant. No test scheduler is executed here. The study addresses an upstream measurement decision whose output could otherwise be mistaken for a completed testing analysis.

The oracle problem provides another boundary: knowing which file belongs to a test patch does not establish that its assertions correctly judge a repair (Barr et al., 2015). Likewise, reference program length and control flow describe a different measurement target from patch-field membership. These distinctions motivate separating three objects that can otherwise be conflated: a filename, its benchmark role, and its actual behavioral function.

3. Source snapshot and file-entry construction

We use the pinned 300-task SWE-bench Lite snapshot already captured locally. Every row's truncation indicator is checked before parsing; none is truncated. The complete cohort spans twelve repositories. Both the solution patch field and the designated test_patch field are present for every retained task, so no issue is excluded because a heuristic succeeds or fails on its paths.

For each patch field, the parser reads diff --git headers and splits the two path arguments using the observed quoted-header syntax. The official Git format documentation distinguishes these patch paths and related change headers (Git Project, 2026). We use the b-side header path as the destination identifier; a deleted file retains the filename expressed by that header. This is a file-entry extraction rule, not execution of the patch against a checkout.

The parser checks the expected a/ and b/ prefixes, rejects unexpected header shapes, and confirms that no observed extracted path contains an unresolved backslash escape. It also checks that a path is not repeated within the same task and patch field. These conditions describe what the captured files actually support. They are not a claim that this short parser handles every possible binary, combined, renamed, or unusually escaped Git patch.

The resulting table has 678 file-role entries: 300 in the solution patch field and 378 in the test patch field. Each task contributes one solution entry and at least one test entry. No task-path pair occurs in both roles in this capture. The analysis nevertheless defines the unit as a role-bearing entry, so a future source with the same path in both fields would require retaining or explicitly resolving that distinction rather than silently merging the labels.

The target label is one for the designated test-patch field and zero for the solution-patch field. It comes from the source metadata, not from a manual inspection of the file body. The study does not fetch full repositories, execute their tests, infer developer intent from issue text, or decide whether helper modules and fixtures should count as tests in another taxonomy.

4. Two fixed rules and a class-balanced outcome

The substring rule lowercases a path and returns one whenever test appears anywhere in it. The structured rule instead checks whether any parent directory is named test, tests, or testing, or whether the basename starts with test_, ends with _test.py, or equals test.py. These are fixed Python-oriented patterns. The rules contain no special case for pytest and no exception added after seeing a particular misclassified filename.

Both rules use only path strings. They do not inspect the issue, the patch body, or the benchmark role when making a prediction. The source role is read only to score the result. This separation matters for leakage analysis (Kapoor and Narayanan, 2023): a classifier that directly used the field name could recover these labels trivially but would answer a different question from reconstructing the role from a filename alone.

For each task and each rule, we calculate the fraction of solution entries labeled positive and the fraction of test entries labeled negative. Their mean is the task's class-balanced role error, giving the two source roles equal weight. This prevents tasks with more designated test files from automatically dominating the metric. The balance is an analysis convention, not an observed deployment error-cost ratio; cost-sensitive reasoning would require additional information to choose such weights (Elkan, 2001).

Research model

Figure 1. Captured patch fields define comparison roles; two static path rules predict those roles; task-level balanced error differences are summarized with repository dependence acknowledged.

The main regression contains an intercept only and uses structured-rule error minus substring-rule error for each of 300 tasks. Negative values favor the structured rule. Covariance clusters the rows by twelve repositories, with a finite correction and t11 reference intervals. There are no covariate controls or repository fixed effects. The intercept remains task-weighted, so repositories with more tasks contribute more to the point estimate.

Robust and clustered covariance address specified error structures (White, 1980; Cameron and Miller, 2015), but there is a severe limitation here: only one repository supplies nonzero differences. A conventional twelve-cluster interval is therefore a fragile working calculation, not reliable evidence about a population of new repositories. We retain its width and this concentration warning rather than replacing it with a narrower file-independent interval.

Table 1. Paired task-level change in balanced patch-role error. N=300 tasks, twelve repository clusters, finite-corrected cluster standard error, t11 interval. The model is intercept-only and R-squared is zero up to numerical rounding. Only one repository contributes nonzero contrasts, limiting inferential interpretation.

Model Term Estimate (SE) 95% CI N
M1 Mean outcome/contrast -0.0283 (0.0313) [-0.0972, 0.0405] 300
M1: fit R-squared = 0.0000 - - 300

Model labels: M1 = Structured minus substring balanced patch-role error.

5. All observed disagreement is concentrated in pytest

The substring rule labels all 378 designated test entries positive and labels seventeen of the 300 solution entries positive as well. Its solution-positive fraction is therefore 0.056667, while its test-negative fraction is zero. The structured rule has both fractions zero in this capture and agrees with all 678 field-role labels. These are finite-record results, without extrapolation to unseen file organizations.

Every changed solution entry belongs to pytest-dev/pytest. Examples include src/_pytest/python.py, src/_pytest/logging.py, src/_pytest/pathlib.py, and src/_pytest/assertion/rewrite.py. The substring test appears in the implementation directory _pytest, while that directory is not an exact match for test, tests, or testing. The result follows from a visible naming distinction rather than from the structured rule reading the actual patch-field label.

Because each task has one solution entry and neither rule misses any designated test entry, mean balanced error falls from 0.028333 to zero. The paired regression coefficient is -0.028333, with standard error 0.031270 and interval [-0.097157, 0.040491]. Its width is consistent with the concentration problem: one project's pattern supplies the entire observed improvement, even though the table contains 300 task rows.

The solution-positive contrast is exactly twice the balanced-error contrast in this source, so a second regression would simply restate the same information on another scale. We report that rate descriptively rather than presenting a scaled duplicate as independent corroboration. This distinction preserves the relationship between the measurement definition and the number of genuinely different results.

Perfect captured agreement is not a guarantee that the structured rule identifies every testing file. A production helper located in a tests directory, a project-specific basename convention, or a future language ecosystem could disagree with this rule or with the benchmark partition. The experiment neither observes those counterexamples nor establishes their absence. Its strongest conclusion is about the specific false-positive pattern visible in the fixed capture.

Measurement reasoning requires naming what a proxy represents (Carroll et al., 2006; Stevens, 1946). Method-comparison work similarly distinguishes agreement on an observed scale from interchangeable use in a broader setting (Bland and Altman, 1986). Here we have field-role agreement, not adjudicated agreement about semantic file purpose. Replacing that phrase with test-file accuracy would make the result appear more general than the label source permits.

6. Consequences for coding-study design

Expanded code tests, as in EvalPlus, address behavioral coverage that a path label cannot supply (Liu et al., 2023). LiveCodeBench concerns code-evaluation evidence under additional benchmark constraints (Jain et al., 2024). Our audit should therefore be viewed as metadata hygiene before a behavioral analysis, rather than a competing code-evaluation method. A correctly labeled file can still contain incomplete assertions, and a solution patch can still fail every relevant test.

Pairwise preference optimization and feedback-based language-model training add learning objectives beyond a file taxonomy (Rafailov et al., 2023; Ouyang et al., 2022). An analyst constructing preference data might want to know whether a change modifies implementation, tests, or both. The current result warns against deriving that label with an unexamined substring rule, but it does not demonstrate an effect on trained-model behavior or the quality of any resulting preference dataset.

Empirical software-engineering guidance emphasizes explicit operational choices (Kitchenham et al., 2002). Source completeness also matters: missing or truncated patch fields would require a declared handling rule rather than an inferred negative role (Little and Rubin, 2002). Here all 300 task records are complete under the parser's checks. We preserve that fact while avoiding an unsupported claim about the completeness of all repository activity behind each benchmark issue.

Validation should match the desired transfer setting (Roberts et al., 2017), and model-selection procedures can introduce optimism when evaluation data guide choices (Varma and Simon, 2006). The rules in this audit are fixed comparisons, without a search over directory patterns or repository exceptions. Further optimization of the heuristic should use separate development repositories and a new held evaluation. The twelve current repositories cannot simultaneously justify tuning and an independent generalization claim.

Influence reasoning is particularly relevant when one repository determines every nonzero difference (Cook, 1977). A leave-that-repository-out calculation would remove all observed improvement, which follows directly from the saved contrast distribution. It would not prove the substring rule is generally safe. Instead, it identifies the limited support for inference and a concrete naming pattern that a future sample should deliberately include.

7. Preserve the original role before inventing a proxy

The saved artifacts include task and repository identifiers, source patch fields, extracted paths, both predictions, and task-level error summaries. Dataset documentation supports tracing those definitions (Gebru et al., 2021), and reusable metadata should preserve source identifiers and transformation rules (Wilkinson et al., 2016). Pipeline dependencies can otherwise turn a convenient early proxy into an undocumented later assumption (Sculley et al., 2015).

For this capture, retaining the benchmark's role fields is more informative than trying to reconstruct them from filenames. When only paths are available, a structured naming rule avoids the observed _pytest substring problem, but its perfect local agreement remains a finite-record description. The research question is answered with that boundary intact: seventeen disagreements disappear, all from one repository, and stronger claims about file semantics or unseen projects require additional evidence.

References

  1. Elkan, Charles. “The Foundations of Cost-Sensitive Learning.” Proceedings of the Seventeenth International Joint Conference on Artificial Intelligence, 2001, pp. 973-978. https://cseweb.ucsd.edu/~elkan/rescale.pdf.
  2. Tao, Hongmo; Kamata, Hiroyuki. (2026). Teaching Coding Assistants What to Change: Fine-Tuning from Pairwise Preferences. Proceedings of the Second Workshop for REsearch on Agent Language Models (REALM 2026), 1363-1374. https://doi.org/10.18653/2026.realm-1.95.
  3. Yang, John; Jimenez, Carlos E.; Wettig, Alexander; Lieret, Kilian; Yao, Shunyu; Narasimhan, Karthik; Press, Ofir. (2024). SWE-agent: Agent-Computer Interfaces Enable Automated Software Engineering. arXiv:2405.15793. https://arxiv.org/abs/2405.15793.
  4. Cameron, A. Colin, and Douglas L. Miller. “A Practitioner’s Guide to Cluster-Robust Inference.” Journal of Human Resources, vol. 50, no. 2, 2015, pp. 317-372. https://doi.org/10.3368/jhr.50.2.317.
  5. Kapoor, Sayash; Narayanan, Arvind. (2023). Leakage and the reproducibility crisis in machine-learning-based science. Patterns. https://doi.org/10.1016/j.patter.2023.100804.
  6. Carroll, Raymond J., David Ruppert, Leonard A. Stefanski, and Ciprian M. Crainiceanu. “Measurement Error in Nonlinear Models.” 2006. https://doi.org/10.1201/9781420010138.
  7. Barr, Earl T.; Harman, Mark; McMinn, Phil; Shahbaz, Muzammil; Yoo, Shin. (2015). The Oracle Problem in Software Testing: A Survey. IEEE Transactions on Software Engineering. https://doi.org/10.1109/tse.2014.2372785.
  8. Sculley, D., et al. "Hidden Technical Debt in Machine Learning Systems." Advances in Neural Information Processing Systems, vol. 28, 2015. https://papers.nips.cc/paper/2015/hash/86df7dcfd896fcaf2674f757a2463eba-Abstract.html
  9. Herzig, Kim; Just, Sascha; Zeller, Andreas. (2013). It’s not a bug, it’s a feature: How misclassification impacts bug prediction. https://doi.org/10.1109/ICSE.2013.6606585.
  10. Bacchelli, Alberto; Bird, Christian. (2013). Expectations, outcomes, and challenges of modern code review. 2013 35th International Conference on Software Engineering (ICSE). https://doi.org/10.1109/icse.2013.6606617.
  11. Little, Roderick J. A., and Donald B. Rubin. Statistical Analysis with Missing Data. Wiley, 2002. https://doi.org/10.1002/9781119013563.
  12. Cook, R. Dennis. (1977). Detection of Influential Observation in Linear Regression. Technometrics. https://doi.org/10.1080/00401706.1977.10489493.
  13. Ouyang, Long; Wu, Jeff; Jiang, Xu; Almeida, Diogo; Wainwright, Carroll L.; Mishkin, Pamela; Zhang, Chong; Agarwal, Sandhini; Slama, Katarina; Ray, Alex; Schulman, John; Hilton, Jacob; Kelton, Fraser; Miller, Luke; Simens, Maddie; Askell, Amanda; Welinder, Peter; Christiano, Paul; Leike, Jan; Lowe, Ryan. (2022). Training language models to follow instructions with human feedback. arXiv:2203.02155. https://arxiv.org/abs/2203.02155.
  14. Roberts, David R., et al. “Cross-validation strategies for data with temporal, spatial, hierarchical, or phylogenetic structure.” Ecography, vol. 40, no. 8, 2017, pp. 913-929. https://doi.org/10.1111/ecog.02881.
  15. Xia, Chunqiu Steven; Deng, Yinlin; Dunn, Soren; Zhang, Lingming. (2024). Agentless: Demystifying LLM-based Software Engineering Agents. arXiv:2407.01489. https://arxiv.org/abs/2407.01489.
  16. Wilkinson, Mark D.; Dumontier, Michel; Aalbersberg, IJsbrand Jan; Appleton, Gabrielle; Axton, Myles; Baak, Arie; Blomberg, Niklas; Boiten, Jan-Willem; da Silva Santos, Luiz Bonino; Bourne, Philip E.; Bouwman, Jildau; Brookes, Anthony J.; Clark, Tim; Crosas, Mercè; Dillo, Ingrid; Dumon, Olivier; Edmunds, Scott; Evelo, Chris T.; Finkers, Richard; Gonzalez-Beltran, Alejandra; Gray, Alasdair J.G.; Groth, Paul; Goble, Carole; Grethe, Jeffrey S.; Heringa, Jaap; ’t Hoen, Peter A.C; Hooft, Rob; Kuhn, Tobias; Kok, Ruben; Kok, Joost; Lusher, Scott J.; Martone, Maryann E.; Mons, Albert; Packer, Abel L.; Persson, Bengt; Rocca-Serra, Philippe; Roos, Marco; van Schaik, Rene; Sansone, Susanna-Assunta; Schultes, Erik; Sengstag, Thierry; Slater, Ted; Strawn, George; Swertz, Morris A.; Thompson, Mark; van der Lei, Johan; van Mulligen, Erik; Velterop, Jan; Waagmeester, Andra; Wittenburg, Peter; Wolstencroft, Katherine; Zhao, Jun; Mons, Barend. (2016). The FAIR Guiding Principles for scientific data management and stewardship. Scientific Data. https://doi.org/10.1038/sdata.2016.18.
  17. Rafailov, Rafael; Sharma, Archit; Mitchell, Eric; Ermon, Stefano; Manning, Christopher D.; Finn, Chelsea. (2023). Direct Preference Optimization: Your Language Model is Secretly a Reward Model. arXiv:2305.18290. https://arxiv.org/abs/2305.18290.
  18. Bland, J. Martin, and Douglas G. Altman. "Statistical Methods for Assessing Agreement between Two Methods of Clinical Measurement." The Lancet, vol. 327, no. 8476, 1986, pp. 307-310. https://doi.org/10.1016/S0140-6736(86)90837-8.
  19. Yoo, S.; Harman, M.. (2012). Regression testing minimization, selection and prioritization: a survey. Software Testing, Verification and Reliability. https://doi.org/10.1002/stvr.430.
  20. Git Project. (2026). diff-format: Git documentation. Documentation captured7November2026; capture year, not original software release year. https://git-scm.com/docs/diff-format.
  21. Stevens, S. S.. (1946). On the Theory of Scales of Measurement. Science. https://doi.org/10.1126/science.103.2684.677.
  22. Bird, Christian; Rigby, Peter C.; Barr, Earl T.; Hamilton, David J.; German, Daniel M.; Devanbu, Premkumar. (2009). The promises and perils of mining git. https://doi.org/10.1109/MSR.2009.5069475.
  23. Rothermel, G.; Untch, R.H.; Chengyun Chu; Harrold, M.J.. (2001). Prioritizing test cases for regression testing. IEEE Transactions on Software Engineering. https://doi.org/10.1109/32.962562.
  24. Jimenez, Carlos E.; Yang, John; Wettig, Alexander; Yao, Shunyu; Pei, Kexin; Press, Ofir; Narasimhan, Karthik. (2023). SWE-bench: Can Language Models Resolve Real-World GitHub Issues?. arXiv:2310.06770. https://arxiv.org/abs/2310.06770.
  25. Kitchenham, Barbara A.; Pfleeger, Shari Lawrence; Pickard, Lesley M.; Jones, Peter W.; Hoaglin, David C.; El Emam, Khaled; Rosenberg, Jarrett. (2002). Preliminary guidelines for empirical research in software engineering. https://doi.org/10.1109/TSE.2002.1027796.
  26. Gebru, Timnit, et al. "Datasheets for datasets" Communications of the ACM, 2021. https://doi.org/10.1145/3458723.
  27. Liu, Jiawei; Xia, Chunqiu Steven; Wang, Yuyao; Zhang, Lingming. (2023). Is Your Code Generated by ChatGPT Really Correct? Rigorous Evaluation of Large Language Models for Code Generation. arXiv:2305.01210. https://arxiv.org/abs/2305.01210.
  28. Varma, Sudhir and Richard Simon. “Bias in error estimation when using cross-validation for model selection.” BMC Bioinformatics, vol. 7, no. 1, 2006. https://doi.org/10.1186/1471-2105-7-91.
  29. White, Halbert. “A Heteroskedasticity-Consistent Covariance Matrix Estimator and a Direct Test for Heteroskedasticity.” Econometrica, vol. 48, no. 4, 1980, pp. 817-838. https://doi.org/10.2307/1912934.
  30. Jain, Naman; Han, King; Gu, Alex; Li, Wen-Ding; Yan, Fanjia; Zhang, Tianjun; Wang, Sida; Solar-Lezama, Armando; Sen, Koushik; Stoica, Ion. (2024). LiveCodeBench: Holistic and Contamination Free Evaluation of Large Language Models for Code. arXiv:2403.07974. https://arxiv.org/abs/2403.07974.