arXiv:2608.06640cs.SEcs.AI2026-08被引 1

分析了AI生成的C++代码在生产环境中的质量缺陷及其影响。

Characterizing the Quality Profile of AI-Generated C++ in Production

论文配图:Characterizing the Quality Profile of AI-Generated C++ in Production
图 1 · 摘自论文原文
  • 通过企业级代码可观测性,对比分析352万次代码变更。
  • AI代码接口耦合高、内存开销大,导致计算资源消耗增加5-8%。
  • 针对性反馈可降低11.1%的静态警告,提升代码效率,适合工程团队参考。

大型企业将AI编码助手广泛应用于生产环境,但其对代码质量的影响尚不清晰。本文基于2025年4月至2026年4月间352万次代码变更的工业级数据,研究了AI生成的C++代码在真实生产环境中的质量表现。该企业具备全行代码的可观测能力,使评估成为可能。结果表明,AI生成代码存在更高的接口依赖与耦合度、复制与内存分配开销,并更倾向使用显式循环而非优化的标准化API。这些缺陷导致代码审查成本上升,且造成5%-8%的计算资源额外消耗。通过引入基于分类体系的定向反馈,可有效缓解问题,使特定静态分析警告减少11.1%,并提升运行效率。

原文摘要 · Abstract (English)

The widespread integration of AI coding assistants offers undeniable boosts to engineering velocity. Yet, recent studies point to a growing trade-off, revealing persistent challenges with code quality and maintainability. Industry leaders, including frontier AI labs, echo these concerns. As large language models are increasingly relied upon to author production code, understanding their impact on shipped software quality has become a critical priority. However, assessing these effects in industrial workflows remains difficult due to observability barriers. We study the impact of AI-generated code on production quality within a large enterprise operating global products relied upon by billions of users daily. Driven by this scale and user trust, the organization values code quality and has built thorough observability for every line of code deployed into production, enabling us to overcome measurement barriers to assess these effects. This study presents a large-scale empirical analysis of AI-generated C++ code from April 2025 to April 2026, tracking 3.52 million code changes across this enterprise's brownfield codebase. The core purpose is to understand the quality, performance, and maintenance characteristics of AI-generated code compared to human-written code in a production environment at scale. We find that AI-generated C++ code has a distinct quality profile, showing higher rates of interface and coupling burdens, copy and allocation overheads, and a reliance on explicit loops over optimized standard APIs. These issues translate into tangible downstream costs, including increased review effort and a 5-8% increase in compute resource consumption. However, we demonstrate that providing models with targeted, taxonomy-informed feedback can mitigate these effects, leading to an 11.1% reduction in targeted static analysis warnings and improved computational efficiency.

AI编程代码质量生产环境C++

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。