Ying Fu , Meng Yan , Pinjia He , Chao Liu , Xiaohong Zhang , Dan Yang
{"title":"在块级生成端到端日志语句","authors":"Ying Fu , Meng Yan , Pinjia He , Chao Liu , Xiaohong Zhang , Dan Yang","doi":"10.1016/j.jss.2024.112146","DOIUrl":null,"url":null,"abstract":"<div><p>Logging is crucial in software development for addressing runtime issues but can pose challenges. Logging encompasses four essential sub-tasks: whether to log (Whether), where to log (Position), which log level (Level), and what information to log (Message). While existing approaches have performed well, they suffer from two limitations. Firstly, they address only a subset of the logging sub-tasks. Secondly, most of them focus on generating single log statements at class or method level, potentially overlooking multiple log statements within those scopes.</p><p>To address these issues, we propose ELogger, which enables end-to-end log statement generation at block-level. Furthermore, ELogger implements block-level log generation, enabling it to handle multiple log statements within different code blocks of a method. Evaluation results indicate that ELogger correctly predicts all four sub-tasks in 19.55% of cases. Compared to the baselines that combined existing approaches for end-to-end log statement generation, ELogger demonstrates a significant improvement with a 50.85% to 78.21% average increase. Additionally, ELogger correctly predicts whether to log in 71.68% of cases, two sub-tasks (Whether and Position) in 58.29% of cases, and three sub-tasks (Whether, Position, and Level) in 41.97% of cases, all of which outperform the baselines.</p></div>","PeriodicalId":51099,"journal":{"name":"Journal of Systems and Software","volume":null,"pages":null},"PeriodicalIF":3.7000,"publicationDate":"2024-06-21","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":"{\"title\":\"End-to-end log statement generation at block-level\",\"authors\":\"Ying Fu , Meng Yan , Pinjia He , Chao Liu , Xiaohong Zhang , Dan Yang\",\"doi\":\"10.1016/j.jss.2024.112146\",\"DOIUrl\":null,\"url\":null,\"abstract\":\"<div><p>Logging is crucial in software development for addressing runtime issues but can pose challenges. Logging encompasses four essential sub-tasks: whether to log (Whether), where to log (Position), which log level (Level), and what information to log (Message). While existing approaches have performed well, they suffer from two limitations. Firstly, they address only a subset of the logging sub-tasks. Secondly, most of them focus on generating single log statements at class or method level, potentially overlooking multiple log statements within those scopes.</p><p>To address these issues, we propose ELogger, which enables end-to-end log statement generation at block-level. Furthermore, ELogger implements block-level log generation, enabling it to handle multiple log statements within different code blocks of a method. Evaluation results indicate that ELogger correctly predicts all four sub-tasks in 19.55% of cases. Compared to the baselines that combined existing approaches for end-to-end log statement generation, ELogger demonstrates a significant improvement with a 50.85% to 78.21% average increase. Additionally, ELogger correctly predicts whether to log in 71.68% of cases, two sub-tasks (Whether and Position) in 58.29% of cases, and three sub-tasks (Whether, Position, and Level) in 41.97% of cases, all of which outperform the baselines.</p></div>\",\"PeriodicalId\":51099,\"journal\":{\"name\":\"Journal of Systems and Software\",\"volume\":null,\"pages\":null},\"PeriodicalIF\":3.7000,\"publicationDate\":\"2024-06-21\",\"publicationTypes\":\"Journal Article\",\"fieldsOfStudy\":null,\"isOpenAccess\":false,\"openAccessPdf\":\"\",\"citationCount\":\"0\",\"resultStr\":null,\"platform\":\"Semanticscholar\",\"paperid\":null,\"PeriodicalName\":\"Journal of Systems and Software\",\"FirstCategoryId\":\"94\",\"ListUrlMain\":\"https://www.sciencedirect.com/science/article/pii/S0164121224001912\",\"RegionNum\":2,\"RegionCategory\":\"计算机科学\",\"ArticlePicture\":[],\"TitleCN\":null,\"AbstractTextCN\":null,\"PMCID\":null,\"EPubDate\":\"\",\"PubModel\":\"\",\"JCR\":\"Q1\",\"JCRName\":\"COMPUTER SCIENCE, SOFTWARE ENGINEERING\",\"Score\":null,\"Total\":0}","platform":"Semanticscholar","paperid":null,"PeriodicalName":"Journal of Systems and Software","FirstCategoryId":"94","ListUrlMain":"https://www.sciencedirect.com/science/article/pii/S0164121224001912","RegionNum":2,"RegionCategory":"计算机科学","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"Q1","JCRName":"COMPUTER SCIENCE, SOFTWARE ENGINEERING","Score":null,"Total":0}
End-to-end log statement generation at block-level
Logging is crucial in software development for addressing runtime issues but can pose challenges. Logging encompasses four essential sub-tasks: whether to log (Whether), where to log (Position), which log level (Level), and what information to log (Message). While existing approaches have performed well, they suffer from two limitations. Firstly, they address only a subset of the logging sub-tasks. Secondly, most of them focus on generating single log statements at class or method level, potentially overlooking multiple log statements within those scopes.
To address these issues, we propose ELogger, which enables end-to-end log statement generation at block-level. Furthermore, ELogger implements block-level log generation, enabling it to handle multiple log statements within different code blocks of a method. Evaluation results indicate that ELogger correctly predicts all four sub-tasks in 19.55% of cases. Compared to the baselines that combined existing approaches for end-to-end log statement generation, ELogger demonstrates a significant improvement with a 50.85% to 78.21% average increase. Additionally, ELogger correctly predicts whether to log in 71.68% of cases, two sub-tasks (Whether and Position) in 58.29% of cases, and three sub-tasks (Whether, Position, and Level) in 41.97% of cases, all of which outperform the baselines.
期刊介绍:
The Journal of Systems and Software publishes papers covering all aspects of software engineering and related hardware-software-systems issues. All articles should include a validation of the idea presented, e.g. through case studies, experiments, or systematic comparisons with other approaches already in practice. Topics of interest include, but are not limited to:
• Methods and tools for, and empirical studies on, software requirements, design, architecture, verification and validation, maintenance and evolution
• Agile, model-driven, service-oriented, open source and global software development
• Approaches for mobile, multiprocessing, real-time, distributed, cloud-based, dependable and virtualized systems
• Human factors and management concerns of software development
• Data management and big data issues of software systems
• Metrics and evaluation, data mining of software development resources
• Business and economic aspects of software development processes
The journal welcomes state-of-the-art surveys and reports of practical experience for all of these topics.