paperbot · PL 论文追踪

全部论文 待读 收藏

P2 DLFinder: Characterizing and Detecting Duplicate Logging Code Smells

DLFinder:刻画与检测重复日志代码异味
ICSE 2019 IEEE/ACM 41st International Conference on Software Engineering (ICSE)2019匹配度 2/10 · 该论文是传统静态分析在日志重复代码异味检测上的应用,属于软件工程/日志分析方向,与用户关注的 PL↔AI、Agentic 程序分析、浮点程序分析、贝叶斯程序分析及 LLM 交叉均无直接关联;仅在“静态分析工具”这一宽泛层面有微弱联系。引用 66 inbox
Zhenhao Li, Tse-Hsun Chen, Jinqiu Yang, Weiyi Shang
crossref: 2026-09-12dblp: 2026-09-12

AI 速览

一句话:通过人工研究归纳五类重复日志代码异味模式,实现静态分析工具 DLFinder 自动检测问题实例,报告 82 处且全部修复。

日志对调试、测试等任务至关重要,但日志编写缺乏工业标准。已有研究多关注单条日志语句的合理性,而日志通常需成对分析。本文聚焦重复日志语句(相同静态文本消息),这类重复可能是代码异味,影响对动态视图的理解。作者人工研究了Hadoop、CloudStack、ElasticSearch和Cassandra四个大型开源系统中超过3K条重复日志语句及其周围代码,归纳出五种重复日志代码异味模式,并区分需修复与合理实例。结合人工结果与反馈,实现自动化静态分析工具DLFinder,在四个系统及额外两个系统(Camel、Wicket)上评估,共报告82个问题实例,全部被修复。

问题
重复日志语句(具有相同静态文本消息)是否构成代码异味,以及如何自动检测其中需要修复的实例。
方法
人工研究四个大型开源系统中超过3K条重复日志语句及其周围代码,归纳五种异味模式,区分需修复与合理实例并联系开发者验证;将结果整合为自动化静态分析工具DLFinder。
评估
在四个已研究系统和两个额外系统(Camel、Wicket)上评估DLFinder,共向开发者报告82个问题异味实例,全部被修复。
原文摘要(Abstract)

Developers rely on software logs for a wide variety of tasks, such as debugging, testing, program comprehension, verification, and performance analysis. Despite the importance of logs, prior studies show that there is no industrial standard on how to write logging statements. Recent research on logs often only considers the appropriateness of a log as an individual item (e.g., one single logging statement); while logs are typically analyzed in tandem. In this paper, we focus on studying duplicate logging statements, which are logging statements that have the same static text message. Such duplications in the text message are potential indications of logging code smells, which may affect developers' understanding of the dynamic view of the system. We manually studied over 3K duplicate logging statements and their surrounding code in four large-scale open source systems: Hadoop, CloudStack, ElasticSearch, and Cassandra. We uncovered five patterns of duplicate logging code smells. For each instance of the code smell, we further manually identify the problematic (i.e., require fixes) and justifiable (i.e., do not require fixes) cases. Then, we contact developers in order to verify our manual study result. We integrated our manual study result and developers' feedback into our automated static analysis tool, DLFinder, which automatically detects problematic duplicate logging code smells. We evaluated DLFinder on the four manually studied systems and two additional systems: Camel and Wicket. In total, combining the results of DLFinder and our manual analysis, we reported 82 problematic code smell instances to developers and all of them have been fixed.

链接与引用

DOI 原文 · DBLP

BibTeX
@inproceedings{LiC0S19,
  title = {DLFinder: Characterizing and Detecting Duplicate Logging Code Smells},
  author = {Zhenhao Li and Tse-Hsun Chen and Jinqiu Yang and Weiyi Shang},
  booktitle = {ICSE},
  year = {2019},
  doi = {10.1109/icse.2019.00032}
}