REVAL: Recommend Which Variables to Log With Pretrained Model and Graph Neural Network | IEEE Journals & Magazine | IEEE Xplore

REVAL: Recommend Which Variables to Log With Pretrained Model and Graph Neural Network


Abstract:

Variable logging plays a vital role in software service management. Developers usually print a set of selected variables in logs to record software system status. Due to ...Show More

Abstract:

Variable logging plays a vital role in software service management. Developers usually print a set of selected variables in logs to record software system status. Due to the lack of strict logging instructions and domain-specific knowledge, it is challenging for developers to decide which variables to log. Therefore, a technology that enables developers to log high- quality log variables is desirable. There are two reasons that make such a technology feasible. First, there exists semantic relevance between logged variables and other code statements. Second, the structural relationship between variables helps technology learn more information. In this paper, we propose a novel method to recommend variables to log — given a code snippet that needs to be followed by a logging statement, our method will tag every token in this code snippet to indicate whether it should be logged. Our method utilizes a pre-trained model to encode semantic information and a graph neural network to encode graph structure information. Given a code snippet without logging statements, our method first extracts graph structure information by graph neural network, then fuses the graph structure information with semantic information extracted by the pre-trained model to recommend logging variables. We use nine open-source projects’ java files to evaluate our method. The experimental results demonstrate that our method outperforms other baseline methods in terms of Hits@1, MRR, and MAP, which indicate that the quality of the first recommended variable and all recommended variables is superior to other baseline models. Moreover this benefits from encoding better semantic information and incorporating graph structure information.
Published in: IEEE Transactions on Network and Service Management ( Volume: 19, Issue: 4, December 2022)
Page(s): 4045 - 4057
Date of Publication: 28 September 2022

ISSN Information:

Funding Agency:


Contact IEEE to Subscribe

References

References is not available for this document.