COBug: A Bug Localization Pipeline for COBOL: Does It Work? An Exploratory Study
Abstract
Bug localization, the task of ranking source files according to their likelihood of containing a reported bug, is a central software maintenance problem. Despite COBOL’s continued industrial importance, file-level bug localization for COBOL lacks a controlled benchmark for reproducible evaluation. We present COBug, a COBOL bug-localization pipeline with a controlled static benchmark, independently generated bug reports, and mechanically traceable source-level ground truth. Using COBug, we find that standard lexical, learned, and embedding-based methods do not reliably exceed a repository-matched random-ranking floor. The benchmark comprises 552 deterministic queries from 12 X-COBOL repositories, each linked to one isolated source transformation, a mechanically traceable ground-truth file, and a symptom-focused bug report generated independently of the target source file. We evaluate lexical retrieval, classical and learning-to-rank re-ranking, and frozen CodeBERT under strict Leave-One-Repository-Out evaluation with repository-grouped inner validation. Across five seeds, lexical IR achieves MAP (=MRR) 0.1508 against a mean repository-matched random floor of 0.1229. LambdaMART achieves the highest aggregate MAP (0.1625), whereas standalone frozen CodeBERT retrieval remains near the random floor (MAP 0.1236). However, after Holm correction, no evaluated method significantly exceeds the random floor, and no pairwise comparison remains significant. A separate LLM-based semantic-fault pilot admitted 15 of 29 adjudicated candidates, but none of the three generators covered all five fault types required by the predefined gate. The semantic pilot is therefore excluded from the localization evaluation and retained only as admission evidence. A structured OpenCBS/ODC comparison further bounds the benchmark’s representativeness by identifying the injected categories that correspond to recreated real COBOL defects and those that do not.