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 条
  • [1] An Automated Approach to Estimating Code Coverage Measures via Execution Logs
    Chen, Boyuan
    Song, Jian
    Xu, Peng
    Hu, Xing
    Jiang, Zhen Ming
    [J]. PROCEEDINGS OF THE 2018 33RD IEEE/ACM INTERNATIONAL CONFERENCE ON AUTOMTED SOFTWARE ENGINEERING (ASE' 18), 2018, : 305 - 316
  • [2] Characterizing and Detecting Anti-patterns in the Logging Code
    Chen, Boyuan
    Jiang, Zhen Ming Jack
    [J]. 2017 IEEE/ACM 39TH INTERNATIONAL CONFERENCE ON SOFTWARE ENGINEERING (ICSE), 2017, : 71 - 81
  • [3] CacheOptimizer: Helping Developers Configure Caching Frameworks for Hibernate-Based Database-Centric Web Applications
    Chen, Tse-Hsun
    Shang, Weiyi
    Hassan, Ahmed E.
    Nasser, Mohamed
    Flora, Parminder
    [J]. FSE'16: PROCEEDINGS OF THE 2016 24TH ACM SIGSOFT INTERNATIONAL SYMPOSIUM ON FOUNDATIONS OF SOFTWARE ENGINEERING, 2016, : 666 - 677
  • [4] Where Do Developers Log? An Empirical Study on Logging Practices in Industry
    Fu, Qiang
    Zhu, Jieming
    Hu, Wenlu
    Lou, Jian-Guang
    Ding, Rui
    Lin, Qingwei
    Zhang, Dongmei
    Xie, Tao
    [J]. 36TH INTERNATIONAL CONFERENCE ON SOFTWARE ENGINEERING (ICSE COMPANION 2014), 2014, : 24 - 33
  • [5] Hassan AE, 2008, ICSE'08 PROCEEDINGS OF THE THIRTIETH INTERNATIONAL CONFERENCE ON SOFTWARE ENGINEERING, P713, DOI 10.1145/1368088.1379445
  • [6] Hassani M., 2018, EMPIRICAL SOFTWARE E
  • [7] Automatic Identification of Load Testing Problems
    Jiang, Zhen Ming
    Hassan, Ahmed E.
    Hamann, Gilbert
    Flora, Parminder
    [J]. 2008 IEEE INTERNATIONAL CONFERENCE ON SOFTWARE MAINTENANCE, 2008, : 307 - +
  • [8] Kabinna S, 2016, 13TH WORKING CONFERENCE ON MINING SOFTWARE REPOSITORIES (MSR 2016), P154, DOI [10.1109/MSR.2016.025, 10.1145/2901739.2901769]
  • [9] Li Z., 2019, ICSE 19
  • [10] Industry Practices and Event Logging: Assessment of a Critical Software Development Process
    Pecchia, Antonio
    Cinque, Marcello
    Carrozza, Gabriella
    Cotroneo, Domenico
    [J]. 2015 IEEE/ACM 37TH IEEE INTERNATIONAL CONFERENCE ON SOFTWARE ENGINEERING, VOL 2, 2015, : 169 - 178