Software logging is a common software development practice which is used to log program execution points. This execution information is later used by software developers for debugging purpose. Software logging is useful but it has cost and benefit tradeoff. Hence it is important to optimize the number of log statements in the code. However, previous studies on logging show that optimal logging is challenging for software developers. Hence tools and techniques which can help developers in making optimized logging decision can be beneficial. We propose LogOptPlus, a machine learning based tool to help software developers to optimize the number of log statements in the source code, for two focused code construct types. LogOptPlus is a significant extension of our previously published work 'LogOpt'. LogOpt is designed to predict logging for catch-blocks. We extend the functionality of LogOpt to predict logging for both if-blocks and catch-blocks. We identify distinguishing static features from the source code for logging prediction. We present intuition and results of quantitative analysis of all the features. We present results of comprehensive evaluation of LogOptPlus with five different machine learning algorithms on two two large Open Source projects (i.e., Apache Tomcat and CloudStack). Encouraging experimental results on two Open Source projects show that LogOptPlus is effective in logging prediction for two focused code construct types.
[1]
Qiang Fu,et al.
Where do developers log? an empirical study on logging practices in industry
,
2014,
ICSE Companion.
[2]
Ding Yuan,et al.
SherLog: error diagnosis by connecting clues from run-time logs
,
2010,
ASPLOS XV.
[3]
Ashish Sureka,et al.
LogOpt: Static Feature Extraction from Source Code for Automated Catch Block Logging Prediction
,
2016,
ISEC.
[4]
Ding Yuan,et al.
Characterizing logging practices in open-source software
,
2012,
2012 34th International Conference on Software Engineering (ICSE).
[5]
Qiang Fu,et al.
Learning to Log: Helping Developers Make Informed Logging Decisions
,
2015,
2015 IEEE/ACM 37th IEEE International Conference on Software Engineering.
[6]
Ding Yuan,et al.
Improving Software Diagnosability via Log Enhancement
,
2012,
TOCS.
[7]
Jennifer Neville,et al.
Structured Comparative Analysis of Systems Logs to Diagnose Performance Problems
,
2012,
NSDI.
[8]
Ahmed E. Hassan,et al.
Studying the relationship between logging characteristics and the code quality of platform software
,
2015,
Empirical Software Engineering.