arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2604.09409cs.SE
收藏

AI 编程代理是否像人类一样记录日志?一项实证研究

Do AI Coding Agents Log Like Humans? An Empirical Study

Queen’s University(女王大学);ETS - Québec University(魁北克大学ETS)

Youssef Esseddiq Ouatiti, Mohammed Sayagh, Hao Li, Ahmed E. Hassan

AI总结:

研究通过分析4550个代理拉取请求,发现代理在58.4%的仓库中更改日志频率低于人类,但日志密度更高。明确的日志指令稀缺且无效,人类在72.5%的情况下修复日志问题,表明自然语言指令存在不足,需引入确定性限制以确保一致性。

摘要:

软件日志对于维护和调试复杂系统至关重要,但尚不清楚AI编程代理如何处理这一非功能性需求。尽管先前工作描述了人类的日志记录实践,但AI编程代理的行为及其对自然语言指令的响应尚未被探索。为填补这一空白,我们对81个开源仓库中的4550个代理拉取请求进行了实证研究。我们比较了代理的日志记录模式与人类基准,并分析了明确日志指令的影响。我们发现,在58.4%的仓库中,代理更改日志的频率低于人类,尽管当它们进行更改时,日志密度更高。此外,明确的日志指令很少(4.7%),且无效,因为代理在67%的情况下未能遵守建设性的请求。最后,我们发现人类在72.5%的情况下修复生成后的日志问题,充当“沉默清洁工”,在没有显式审查反馈的情况下修复日志和可观测性问题。这些发现表明自然语言指令存在双重失败(即日志指令稀缺和代理合规性低),表明可能需要确定性限制以确保一致的日志记录实践。

英文摘要:

Software logging is essential for maintaining and debugging complex systems, yet it remains unclear how AI coding agents handle this non-functional requirement. While prior work characterizes human logging practices, the behaviors of AI coding agents and the efficacy of natural language instructions in governing them are unexplored. To address this gap, we conduct an empirical study of 4,550 agentic pull requests across 81 open-source repositories. We compare agent logging patterns against human baselines and analyze the impact of explicit logging instructions. We find that agents change logging less often than humans in 58.4% of repositories, though they exhibit higher log density when they do. Furthermore, explicit logging instructions are rare (4.7%) and ineffective, as agents fail to comply with constructive requests 67% of the time. Finally, we observe that humans perform 72.5% of post-generation log repairs, acting as "silent janitors" who fix logging and observability issues without explicit review feedback. These findings indicate a dual failure in natural language instruction (i.e., scarcity of logging instructions and low agent compliance), suggesting that deterministic guardrails might be necessary to ensure consistent logging practices.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑