Characterizing and Detecting Duplicate Logging Code Smells

被引:7
作者
Li, Zhenhao [1 ]
机构
[1] Concordia Univ, Montreal, PQ, Canada
来源
2019 IEEE/ACM 41ST INTERNATIONAL CONFERENCE ON SOFTWARE ENGINEERING: COMPANION PROCEEDINGS (ICSE-COMPANION 2019) | 2019年
关键词
log; code smell; duplicate log; static analysis;
D O I
10.1109/ICSE-Companion.2019.00062
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
Software logs are widely used by developers to assist in various tasks. 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 and uncovered five patterns of duplicate logging code smells. For each instance of the problematic code smell, 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 manually studied systems and two additional systems. In total, combining the results of DLFinder and our manual analysis, DLFinder is able to detect over 85% of the instances which were reported to developers and then fixed.
引用
收藏
页码:147 / 149
页数:3
相关论文
共 17 条
[11]  
Pinjia H., 2018, P 33 IEEE INT C AUT, P1
[12]   Understanding Log Lines Using Development Knowledge [J].
Shang, Weiyi ;
Nagappan, Meiyappan ;
Hassan, Ahmed E. ;
Jiang, Zhen Ming .
2014 IEEE INTERNATIONAL CONFERENCE ON SOFTWARE MAINTENANCE AND EVOLUTION (ICSME), 2014, :21-30
[13]  
Yao K., 2018, ICPE 18, P21
[14]  
Yuan Ding, 2014, 11 USENIX S OP SYST, P249
[15]  
Yuan M, 2011, PROCEEDINGS OF THE 2011 EXCHANGE CONFERENCE - INTERNATIONAL MARKETING SCIENCE AND INFORMATION TECHNOLOGY, P3
[16]   Log20: Fully Automated Optimal Placement of Log Printing Statements under Specified Overhead Threshold [J].
Zhao, Xu ;
Rodrigues, Kirk ;
Luo, Yu ;
Stumm, Michael ;
Yuan, Ding ;
Zhou, Yuanyuan .
PROCEEDINGS OF THE TWENTY-SIXTH ACM SYMPOSIUM ON OPERATING SYSTEMS PRINCIPLES (SOSP '17), 2017, :565-581
[17]   Learning to Log: Helping Developers Make Informed Logging Decisions [J].
Zhu, Jieming ;
He, Pinjia ;
Fu, Qiang ;
Zhang, Hongyu ;
Lyu, Michael R. ;
Zhang, Dongmei .
2015 IEEE/ACM 37TH IEEE INTERNATIONAL CONFERENCE ON SOFTWARE ENGINEERING, VOL 1, 2015, :415-425