The rise of Large Language Models (LLMs) as coding agents promises to accelerate software development, but their impact on generated code reproducibility remains largely unexplored. This paper presents an empirical study investigating whether LLM-generated code can be executed successfully in a clean environment with only OS packages and using only the dependencies that the model specifies. We evaluate three state-of-the-art LLM coding agents (Claude Code, OpenAI Codex, and Gemini) across 300 projects generated from 100 standardized prompts in Python, JavaScript, and Java. We introduce a three-layer dependency framework (distinguishing between claimed, working, and runtime dependencies) to quantify execution reproducibility. Our results show that only 68.3% of projects execute out-of-the-box, with substantial variation across languages (Python 89.2%, Java 44.0%). We also find a 13.5 times average expansion from declared to actual runtime dependencies, revealing significant hidden dependencies.
翻译:大型语言模型(LLM)作为编码智能体的兴起有望加速软件开发,但其对生成代码可复现性的影响仍鲜有探索。本文通过实证研究探究:在仅含操作系统包及模型指定依赖的纯净环境中,LLM生成的代码能否成功执行。我们评估了三种最先进的LLM编码智能体(Claude Code、OpenAI Codex与Gemini),基于100个标准化提示在Python、JavaScript和Java中生成的300个项目。引入三层依赖框架(区分声称依赖、工作依赖与运行时依赖)量化执行可复现性。结果表明,仅68.3%的项目开箱即用,且语言间差异显著(Python 89.2%,Java 44.0%)。此外,从声明依赖到实际运行时依赖平均扩大13.5倍,揭示大量隐藏依赖。