论文

研究探讨用编程智能体自动清理日志代码:LogRem 数据集与现状评估

Towards Automatically Pruning Logging Code with Coding Agents: How Far Are We?

精选理由

开发者删日志一直靠手动,这篇论文用 387 个真实案例测了四种编程智能体干这活的靠谱程度,结论是还差得远,但给出了哪些提示信息最管用。

arXiv 论文研究了日志代码删除这一此前被忽视的软件维护任务。作者从 Python 和 Java 仓库中提取并人工验证真实删除案例,归纳出 10 种删除模式和 11 种删除原因,构建了包含 387 个真实案例的 LogRem 数据集。评测四种编程智能体后发现,虽然 95.6% 到 100.0% 的输出通过有效性检查,但只有 11.1% 到 19.6% 的输出与开发者实际接受的改动一致。实验还显示执行成本高低与结果对齐程度并无稳定关联,而提供 commit 消息和开发者讨论能带来最大的对齐提升。

原文 · arXiv cs.AI

Towards Automatically Pruning Logging Code with Coding Agents: How Far Are We?

Logging code supports debugging, monitoring, and software maintenance, but excessive logging can add noise, impose runtime overhead, and obscure diagnostic information. While prior research has extensively studied logging code generation and modification, logging removal remains comparatively underexplored. In this paper, we study developer logging removal practices and explore the use of coding agents for this task. We extract and manually validate logging removal cases from Python and Java repositories and derive 10 removal patterns and 11 removal reasons that characterize how and why logging code was removed in real-world software changes. We further construct LogRem, a dataset of 387 real-world cases covering direct logging statement removal, logging infrastructure removal, and logging replacement. We evaluate four coding agents with multiple model settings and compare their outputs with accepted real-world changes. Although 95.6% to 100.0% of outputs pass validity checks, only 11.1% to 19.6% remove the same logging code as the corresponding real-world change while preserving unrelated code. Agents differ through missed removals, extra removals, and unrelated code edits, with substantial variation across logging removal categories and trajectories. Execution cost varies widely, but higher cost does not consistently yield closer alignment. Commit messages and developer discussions provide the largest alignment gains, while taxonomy guidance consistently reduces runtime. Overall, our study establishes logging removal as a distinct software maintenance task and shows that reliable automation depends on accurately determining removal scope while preserving necessary code. To the best of our knowledge, this is the first study to examine logging code removal from this perspective.