Automatically Characterizing Logging Usage: An Application of Anti-Unification

Date
2016
Journal Title
Journal ISSN
Volume Title
Publisher
Abstract
Logging has been a common practice to record the runtime behaviour of a software system, typically performed by inserting log statements in its source code. While several frameworks have been specifically created to help developers perform logging tasks, these do not provide guidance on where the log statements should be located in the source code. Thus, developers usually rely on their common sense to decide where to log. If logging is done properly, it can provide valuable information for software development and maintenance; if it is done poorly, system performance can degrade and maintenance can be made more difficult. Few studies have been conducted to characterize logging usage in real-world applications. This work tries to address the problem of where to log by proposing an automated approach that characterizes the location of log statements through the approximation of an anti-unification approach (specifically, higher-order anti-unification modulo theories) and a hierarchical clustering technique to construct a set of anti-unifiers, each describing the commonalities and differences between source code fragments that embody log statements. This approach has been reified in a prototype tool, called ELUS, that greedily identifies the best structural correspondences with respect to the highest similarity and some constraints. An empirical study was conducted by applying the tool on the source code of four open source systems and manually examining the generated anti-unifiers. The analysis resulted in five main categories of anti-unifiers in the logging usage. Two empirical evaluations were conducted in this work: (1) an experiment was conducted to evaluate the effectiveness of the proposed approach through the application of its supporting tool on a test suite; and (2) an experiment was performed to evaluate the quality of the anti-unifiers in describing the location of log statements in source code.
Description
Keywords
Computer Science
Citation
Zirakchianzadeh, N. (2016). Automatically Characterizing Logging Usage: An Application of Anti-Unification (Master's thesis, University of Calgary, Calgary, Canada). Retrieved from https://prism.ucalgary.ca. doi:10.11575/PRISM/25079