Go Static: Contextualized Logging Statement Generation
Yichen Li, Yintong Huo, Renyi Zhong, Zhihan Jiang, Jinyang Liu, Junjie, Huang, Jiazhen Gu, Pinjia He, Michael R.Lyu

TL;DR
This paper introduces SCLogger, a novel approach for generating contextualized logging statements by leveraging inter-method static contexts and detailed variable type information, significantly improving accuracy and quality over existing methods.
Contribution
SCLogger is the first method to incorporate inter-method static context and variable type refinement for more accurate and consistent logging statement generation.
Findings
SCLogger outperforms state-of-the-art in logging position accuracy by 8.7%.
SCLogger improves variable precision by 19.6%.
SCLogger enhances text BLEU-4 score by 138.4%.
Abstract
Logging practices have been extensively investigated to assist developers in writing appropriate logging statements for documenting software behaviors. Although numerous automatic logging approaches have been proposed, their performance remains unsatisfactory due to the constraint of the single-method input, without informative programming context outside the method. Specifically, we identify three inherent limitations with single-method context: limited static scope of logging statements, inconsistent logging styles, and missing type information of logging variables. To tackle these limitations, we propose SCLogger, the first contextualized logging statement generation approach with inter-method static contexts. First, SCLogger extracts inter-method contexts with static analysis to construct the contextualized prompt for language models to generate a tentative logging statement. The…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Code & Models
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsHuman Motion and Animation · Artificial Intelligence in Games · Video Analysis and Summarization
