具有变异性意识的编译错误检测与修复:利用基础模型在可配置系统中
An Empirical Study of Foundation Models for Variability-Induced Compilation Errors in Configurable C Code
AI总结:
本文研究利用基础模型检测和修复可配置系统中的编译错误,展示其在精度和召回率上的优势。
摘要:
现代软件系统常常依赖条件编译来支持可选功能和多种部署场景。在可配置系统中,编译错误可能只在特定功能组合下出现,开发和测试期间可能隐藏。此类由变异性引起的错误在实践中难以检测,因为传统编译器每次只分析一个配置,而现有的变异性意识工具通常需要复杂的设置并导致高分析成本。在本文中,我们对使用基础模型来检测和修复可配置C系统中由功能变异性引起的编译错误进行了实证研究。我们评估了GPT-OSS-20B和GEMINI 3 PRO,并将其与TYPECHEF,一种最先进的变异性意识解析器进行了比较。我们的评估考虑了两种互补的设置:5000个小型可配置系统,这些系统旨在系统地测试变异性引起的编译行为,包括有和没有编译错误的系统,以及14个现实的GitHub提交,以及一个额外的突变测试场景集(42)。我们的结果表明,基础模型可以有效地识别由变异性引起的编译错误。在小型可配置系统中,GPT-OSS-20B的精度为0.97,召回率为0.90,准确率为0.94,比TYPECHEF的检测覆盖率显著提高,并且在性能上与GEMINI 3相当。在编译错误修复方面,GPT-OSS-20B在超过70%的情况下产生了可编译的修复。在对现实提交的分析中,CHATGPT-5.2检测了所有注入的故障,除了两个情况,并在Linux提交中识别了一个潜在的编译错误,该提交有超过1000行的修改。我们的发现表明,当前最先进的基础模型为传统的变异性意识分析提供了实用且低努力的补充。
英文摘要:
In configurable systems, conditional compilation can hide compilation errors under untested feature combinations. We investigate foundation models for detecting such errors and, in a controlled setting, restoring compilability in configurable C code. Study I evaluates GPT-OSS-20B on 5,000 synthetic snippets generated by ChatGPT-5.2 from 30 curated seeds and exhaustively compiled under all Boolean feature assignments; it also compares TypeChef and evaluates Gemini 3.6 Flash on a stratified sample. GPT-OSS-20B achieved 84.7% micro-precision and 52.1% micro-recall for affected configurations. Coverage depended on reporting style: presence conditions covered 99.4% of failing configurations, whereas explicit enumerations covered 29.5% under a prompt requesting only a minimal justifiable set. GPT-OSS-20B restored compilability for 1,930 of 2,665 faulty snippets (72.4%), while Gemini 3.6 Flash did so for 182 of 190 sampled faulty snippets (95.8%). A paired counterfactual audit found no evidence that an identified label-correlated #define property materially influenced GPT-OSS-20B's predictions. Study II evaluates Codex-GPT5.5 on 100 faulty file-level subjects from five mature configurable systems and reports target-fault-aligned problems in 94 subjects, including four of five historical bugs. Overall, foundation models can support localized detection, explanation, and triage, but should complement compiler-based and variability-aware analyses; compiler acceptance does not establish semantic correctness
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。