paperbot · PL 论文追踪

全部论文 待读 收藏

P1 Defects4Log: Benchmarking LLMs for Logging Code Defect Detection and Reasoning

Defects4Log:面向日志代码缺陷检测与推理的 LLM 基准测试
ASE 2025 40th IEEE/ACM International Conference on Automated Software Engineering (ASE)2025匹配度 5/10 · 该论文利用LLM检测日志代码缺陷,属于AI与PL交叉领域,且构建了缺乏基准的重要场景数据集,符合用户对AI→PL和基准设计的部分兴趣。但具体任务(日志缺陷检测)并非用户核心关注的静态分析、形式化验证、浮点或贝叶斯程序分析方向,匹配度中等。引用 4 inbox
Xin Wang, Zhenhao Li, Zishuo Ding
crossref: 2026-09-12

AI 速览

一句话:构建日志代码缺陷分类体系与基准数据集 Defects4Log,系统评估 LLM 检测与推理日志代码缺陷的能力。

日志代码用于捕获系统运行时行为,对调试、性能分析和系统监控至关重要,但其中的缺陷会削弱日志价值并导致误读。已有研究多基于有限来源(如提交历史)识别少数缺陷模式,缺乏系统且全面的分析;同时,大语言模型(LLM)在日志代码缺陷检测上的潜力尚未被充分探索。本文首先提出一个涵盖 7 种日志代码缺陷模式、14 个详细场景的分类体系,并构建包含 164 个经开发者验证的真实世界日志缺陷的基准数据集 Defects4Log。然后,提出一个自动化评估框架,利用多种提示策略和上下文信息评估 LLM 检测与推理日志代码缺陷的能力。实验表明,仅凭源代码时 LLM 普遍难以准确检测和推理日志代码缺陷;但引入适当知识(如缺陷模式的详细场景)可使检测准确率提升 10.9%。

问题
日志代码缺陷缺乏系统全面的分类,且 LLM 在检测与推理此类缺陷上的能力尚未得到充分评估。
方法
提出包含 7 种模式、14 个场景的日志代码缺陷分类体系,构建 164 个开发者验证的真实缺陷数据集 Defects4Log,并设计自动化框架结合多种提示策略与上下文信息评估 LLM。
评估
在 Defects4Log 上评估多种 LLM 的检测与推理表现,发现仅凭源码时效果不佳,而引入缺陷模式详细场景等知识可使检测准确率提升 10.9%。
原文摘要(Abstract)

Logging code is written by developers to capture system runtime behavior and plays a vital role in debugging, performance analysis, and system monitoring. However, defects in logging code can undermine the usefulness of logs and lead to misinterpretations. Although prior work has identified several logging defect patterns and provided valuable insights into logging practices, these studies often focus on a narrow range of defect patterns derived from limited sources (e.g., commit histories) and lack a systematic and comprehensive analysis. Moreover, large language models (LLMs) have demonstrated promising generalization and reasoning capabilities across a variety of code-related tasks, yet their potential for detecting logging code defects remains largely unexploredIn this paper, we derive a comprehensive taxonomy of logging code defects, which encompasses seven logging code defect patterns with 14 detailed scenarios. We further construct a benchmark dataset, Defects4Log, consisting of 164 developer-verified real-world logging defects. Then we propose an automated framework that leverages various prompting strategies and contextual information to evaluate LLMs’ capability in detecting and reasoning logging code defects. Experimental results reveal that LLMs generally struggle to accurately detect and reason logging code defects based on the source code only. However, incorporating proper knowledge (e.g., detailed scenarios of defect patterns) can lead to 10.9% improvement in detection accuracy. Overall, our findings provide actionable guidance for practitioners to avoid common defect patterns and establish a foundation for improving LLM-based reasoning in logging code defect detection.

链接与引用

DOI 原文 ·

BibTeX
@inproceedings{paperbot9216,
  title = {Defects4Log: Benchmarking LLMs for Logging Code Defect Detection and Reasoning},
  author = {Xin Wang and Zhenhao Li and Zishuo Ding},
  booktitle = {ASE},
  year = {2025},
  doi = {10.1109/ase63991.2025.00161}
}