ChatPaper.aiChatPaper

特性化AI生成之C++於生產環境中的品質概況

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

August 6, 2026
作者: Michael Tran, Fred Lewis, Kun Yang, Saksham Thakur, Aditya Kini, Aditya Patil, Milad Hashemi, Parthasarathy Ranganathan
cs.AI

摘要

AI 編碼助手的廣泛整合無疑提升了工程開發速度。然而,近期研究指出一個日益明顯的取捨,揭示了程式碼品質與可維護性方面持續存在的挑戰。包括前沿AI實驗室在內的業界領導者,也呼應了這些擔憂。隨著大型語言模型日益被倚重來編寫生產程式碼,了解其對交付軟體品質的影響已成為至關重要的優先事項。然而,由於可觀測性障礙,在工業工作流程中評估這些影響仍然困難。我們在一家大型企業內部研究AI生成程式碼對生產品質的影響;該企業營運的全球產品每天有數十億用戶依賴。基於如此規模與用戶信任,該組織高度重視程式碼品質,並為每一行部署至生產環境的程式碼建立了全面的可觀測性,使我們得以克服量測障礙來評估這些影響。 本研究針對2025年4月至2026年4月期間AI生成的C++程式碼進行大規模實證分析,追蹤該企業既有程式碼庫中的352萬次程式碼變更。核心目的在於了解AI生成程式碼與人類編寫程式碼在規模化生產環境中的品質、效能與維護特性差異。我們發現AI生成的C++程式碼具有獨特的品質特徵,表現出較高的介面與耦合負擔、複製與配置開銷,並傾向使用顯式迴圈而非經最佳化的標準API。這些問題轉化為具體的下游成本,包括審查工作量增加,以及計算資源消耗增加5%至8%。然而,我們證明,為模型提供具針對性且基於分類學的回饋,可以減緩這些影響,使目標靜態分析警告減少11.1%,並提升計算效率。
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.