SlideShare a Scribd company logo
Towards Providing Automated Supports to
Developers on Making Logging Decisions
Tse-Hsun (Peter) Chen
peterc@encs.concordia.ca
About myself
BSc
MSc, PhD
Associate
professor
Experiences
working in the
field
3
Industry collaboration and research outcome adoption
Main research area: improving
software quality and testing process
Software System
Performance
counters
System logs
Software tests Bug reports
…
Software
developers
Applying code analysis, machine learning, and
data analytics to provide automated support to
developers
I will focus on my research on
software logging in this talk
Logs are often the only source of
information for production systems
System running in
production
Operator Developer
Logs can be used to assist various
software development tasks
Performance
Analysis
Requirement
Tracking
Debugging
Monitoring
LOG.warn(“Can not parse job id from {} ”, path, e);
Verbosity Level Static Message Dynamic Variables
…
} catch (Exception e) {
}
Logging
Too much: performance overhead;
too many trivial logs
Too little: missing important information
What is a Logging Statement & Trade-off of Logging
Logs record important runtime info,
but with trade-offs
8
What is a Logging Statement & Trade-off of Logging
Deciding where to log is
challenging
“Logging and tracing is (IMO) a fine art, knowing what
to log and where takes experience.”
Where do developers log?
Studying where do developers log and
provide recommendations
Can we leverage existing code to
recommend logging locations?
Source Code Logging statements
(with surrounding code)
Our process of studying and
providing logging suggestions
Cassandra
Our Studied Systems
Elasticsearch Flink
HBase Kafka Wicket Zookeeper
We study where do developers log in 7 large-
scale open source systems
Source Code Logging statements
(with surrounding code)
Manual study on
logging code
Our process of studying and
providing logging suggestions
Manual study to
understand their
characteristics
Randomly sample 375
out of 14.9K logging
statements and their
surrendering code
Manually studying logging code
and its location
Manual study to
understand their
characteristics
Randomly sample 375
out of 14.9K logging
statements and their
surrendering code
Manually studying logging code
and its location
We uncover 6 categories of logging
locations, and the relationship between
logging statements and code
Category 1: Exception information logging in catch blocks
Categories of logging locations
Semantic information
Syntactic
information
The logging statements often record messages
or execution info related to the prior try block.
Categories of logging locations
Category 2: Execution state logging in branch blocks
Semantic information
Syntactic
information
Logging statements often record execution
states in different branches.
Categories of logging locations
Category 3: Logging the beginning/end of a method block
(method execution)
public void removeJob(JobID jobId){
...
// the end of the method
log.info(“Removed jobId {} from Zookeeper”, jobId);
}
Logging statements often record the
beginning or end of method execution.
Related to the semantic
of the method
Source Code Logging statements
(with surrounding code)
Manual study on
logging code
Our process of studying and
providing logging suggestions
Extracting Code Block
Feature
(Syntactic, Semantic,
Fusion)
if(Strings.isEmpty(sessionID)) {
LOG.error(“failed to get session ID”);
handleError();
return;
}
Syntactic
Semantic
Fusion
Extracting code block features
IfStatement, MethodInvocation,
string, is, empti, session, id,
if(Strings.isEmpty(sessionID)) {
handleError();
return;
}
Syntactic
Semantic
Fusion
MethodInvocation,
ReturnStatement
handle, error
IfStatement, MethodInvocation, string, is, empty, session, id
MethodInvocation, handle, error,
ReturnStatement
Extracting code block features
Source Code Logging statements
(with surrounding code)
Manual study on
logging code
Our process of studying and
providing logging suggestions
Extracting Code Block
Feature
(Syntactic, Semantic,
Fusion)
Deep Learning
Framework
Source Code
Code Block Features
……
Word Embedding Layer
RNN
Cell
RNN
Cell
RNN
Cell
…… RNN
Cell
RNN Layer (LSTM)
Output Layer
Our process of studying and
providing logging suggestions
Source Code Logging statements
(with surrounding code)
Manual study on
logging code
Our process of studying and
providing logging suggestions
Extracting Code Block
Feature
(Syntactic, Semantic,
Fusion)
Deep Learning
Framework
Suggestion Results
(logged vs. non-logged block)
Research Questions
RQ1 RQ2
How effective are different block
features when suggesting logging
locations?
Are the trained models
transferable to other systems?
Evaluation of our logging location
suggestion models
Research Questions
RQ1 RQ2
How effective are different block
features when suggesting logging
locations?
Are the trained models
transferable to other systems?
Evaluation of our logging location
suggestion models
• For each system, we use 60% for training, 20%
for validation, and 20% for testing.
• Compute balanced accuracy for evaluation
• How well can the model suggest logged and
non-logged code blocks
Process and metrics for DL model
evaluation
Balanced Accuracy of different block features
50
60
70
80
90
Try-Catch Branching Looping Method
Syntactic Semantic Fusion
85.8
77.4
69.0
63.2
Process and metrics for DL model
evaluation
Models trained using syntactic features
achieve the best results.
True Positive
(TP)
True Negative
(TN)
False Positive
(FP)
False Negative
(FN)
High overlaps in TN shows non-logged code has distinct characteristics
that are captured by all features. Syntactics has the lowest FNs.
20.1% of the TPs are missed by syntactic but captured by two other
block features. Only small overlaps on FPs among the features.
Studying the overlap among the results
using three different features
Manually Studying FPs and FNs
We further manually study a sample of False Positive and
False Negative in our suggestion results
We find that a large portion of the
FPs and FNs may be considered as TPs and TNs.
An example of FP:
Some misclassifications may
actually be correct
The object state is saved to a JSON files instead
of log files
The actual performance of our model may be
even better due to the diverse nature of how
developers write logging code.
Research Questions
RQ1 RQ2
How effective are different block
features when suggesting logging
locations?
Are the trained models
transferable to other systems?
Evaluation of our logging location
suggestion models
We suggest logging
locations with reasonable
accuracy. Different features
capture different logging
info in the code.
Research Questions
RQ1 RQ2
How effective are different block
features when suggesting logging
locations?
Are the trained models
transferable to other systems?
Evaluation of our logging location
suggestion models
We suggest logging
locations with reasonable
accuracy. Different features
capture different logging
info in the code.
Training a model using
syntactic features
Training cross-system models
Apply the models on
other systems
Balanced Accuracy for cross-system suggestions
RQ2: Are the trained models transferable to other systems?
10
30
50
70
90
Cassandra Flink Kafka Zookeeper
Within Cross
81.7% 80.0% 84.6% 83.9% 88.4% 80.1% 91.7%
The percentage is the ratio of Cross against Within
Although decreased, cross system suggestion still achieves
reasonable performance compared to within-system suggestion.
Results of cross system suggestion
Research Questions
RQ1 RQ2
How effective are different block
features when suggesting logging
locations?
Are the trained models
transferable to other systems?
Evaluation of our logging location
suggestion models
We suggest logging
locations with reasonable
accuracy. Different features
capture different logging
info in the code.
Different systems may
share a similar implicit
logging guideline.
Towards better software quality assurance by providing intelligent support
Towards better software quality assurance by providing intelligent support
Towards better software quality assurance by providing intelligent support
Towards better software quality assurance by providing intelligent support
Towards better software quality assurance by providing intelligent support
Towards better software quality assurance by providing intelligent support
Towards better software quality assurance by providing intelligent support
Towards better software quality assurance by providing intelligent support
Tse-Hsun (Peter) Chen
https://petertsehsun.github.io

More Related Content

PDF
Why and how to test logging - DevOps Showcase North - Feb 2016 - Matthew Skelton
DOCX
Project Deimos
PPTX
Towards Just-in-Time Suggestions for Log Changes
PDF
Mining Development Knowledge to Understand and Support Software Logging Pract...
PDF
A Tool for Rejuvenating Feature Logging Levels via Git Histories and Degree o...
PDF
Automated Evolution of Feature Logging Statement Levels Using Git Histories a...
PDF
Put Your Hands in the Mud: What Technique, Why, and How
PPTX
Log Engineering: Towards Systematic Log Mining to Support the Development of ...
Why and how to test logging - DevOps Showcase North - Feb 2016 - Matthew Skelton
Project Deimos
Towards Just-in-Time Suggestions for Log Changes
Mining Development Knowledge to Understand and Support Software Logging Pract...
A Tool for Rejuvenating Feature Logging Levels via Git Histories and Degree o...
Automated Evolution of Feature Logging Statement Levels Using Git Histories a...
Put Your Hands in the Mud: What Technique, Why, and How
Log Engineering: Towards Systematic Log Mining to Support the Development of ...

Similar to Towards better software quality assurance by providing intelligent support (20)

PPTX
Log Engineering: Towards Systematic Log Mining to Support the Development of ...
PDF
PDF
PDF
Opslogger: Operations code (should be) production quality too!
PPTX
Functional and non functional application logging
PDF
Un-broken Logging - TechnologyUG - Leeds - Matthew Skelton
PDF
Un-broken Logging - Operability.io 2015 - Matthew Skelton
PDF
Un-broken logging - the foundation of software operability - Operability.io -...
PDF
Developer Fundamentals - Logging
PDF
Bug Triage: An Automated Process
PDF
From Bugs to Decision Support - Selected Research Highlights
PPTX
SEMLA_logging_infra
PDF
IRJET- Data Reduction in Bug Triage using Supervised Machine Learning
PDF
Software Mining and Software Datasets
PDF
Final Release
PDF
Can ML help software developers? (TEQnation 2022)
PDF
Analyzing Log Data With Apache Spark
PDF
Automated Evolution of Feature Logging Statement Levels Using Git Histories a...
PPTX
How fluentd fits into the modern software landscape
PDF
IRJET-Automatic Bug Triage with Software
Log Engineering: Towards Systematic Log Mining to Support the Development of ...
Opslogger: Operations code (should be) production quality too!
Functional and non functional application logging
Un-broken Logging - TechnologyUG - Leeds - Matthew Skelton
Un-broken Logging - Operability.io 2015 - Matthew Skelton
Un-broken logging - the foundation of software operability - Operability.io -...
Developer Fundamentals - Logging
Bug Triage: An Automated Process
From Bugs to Decision Support - Selected Research Highlights
SEMLA_logging_infra
IRJET- Data Reduction in Bug Triage using Supervised Machine Learning
Software Mining and Software Datasets
Final Release
Can ML help software developers? (TEQnation 2022)
Analyzing Log Data With Apache Spark
Automated Evolution of Feature Logging Statement Levels Using Git Histories a...
How fluentd fits into the modern software landscape
IRJET-Automatic Bug Triage with Software
Ad

More from Concordia University (14)

PPTX
A first look at the integration of machine learning models in complex autonom...
PPTX
iPerfDetector: Characterizing and Detecting Performance Anti-patterns in iOS ...
PDF
Icse2018 autonomic
PPTX
TSE 2016 - Finding and Evaluating the Performance Impact of Redundant Data Ac...
PPTX
ICSE2017 - Analytics Driven Load Testing: An Industrial Experience Report on ...
PPTX
FSE2016 - CacheOptimizer: Helping Developers Configure Caching Frameworks for...
PPTX
CSER2016 - Detecting Problems in Database Access Code of Large Scale Systems
PPTX
Improving the Performance of Database-Centric Applications Through Program An...
PPTX
ICSE2016 - Detecting Problems in Database Access Code of Large Scale Systems ...
PPTX
MSR2016 - An Empirical Study on the Practice of Maintaining Object-Relational...
PPTX
ICDE2015PhD - Improving the Quality of Large-Scale Database-Centric Software ...
PPTX
ICSE2014 - Detecting Performance Anti-patterns for Applications Developed usi...
PPTX
MSR2014 - An Empirical Study of Dormant Bugs
PDF
MSR2012 - Explaining Software Defects Using Topic Models
A first look at the integration of machine learning models in complex autonom...
iPerfDetector: Characterizing and Detecting Performance Anti-patterns in iOS ...
Icse2018 autonomic
TSE 2016 - Finding and Evaluating the Performance Impact of Redundant Data Ac...
ICSE2017 - Analytics Driven Load Testing: An Industrial Experience Report on ...
FSE2016 - CacheOptimizer: Helping Developers Configure Caching Frameworks for...
CSER2016 - Detecting Problems in Database Access Code of Large Scale Systems
Improving the Performance of Database-Centric Applications Through Program An...
ICSE2016 - Detecting Problems in Database Access Code of Large Scale Systems ...
MSR2016 - An Empirical Study on the Practice of Maintaining Object-Relational...
ICDE2015PhD - Improving the Quality of Large-Scale Database-Centric Software ...
ICSE2014 - Detecting Performance Anti-patterns for Applications Developed usi...
MSR2014 - An Empirical Study of Dormant Bugs
MSR2012 - Explaining Software Defects Using Topic Models
Ad

Recently uploaded (20)

PPTX
Why Generative AI is the Future of Content, Code & Creativity?
PDF
17 Powerful Integrations Your Next-Gen MLM Software Needs
PDF
Download FL Studio Crack Latest version 2025 ?
PDF
Complete Guide to Website Development in Malaysia for SMEs
PDF
Nekopoi APK 2025 free lastest update
PDF
How to Choose the Right IT Partner for Your Business in Malaysia
PPTX
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
PPTX
Log360_SIEM_Solutions Overview PPT_Feb 2020.pptx
PPTX
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
PDF
Wondershare Filmora 15 Crack With Activation Key [2025
PDF
CCleaner Pro 6.38.11537 Crack Final Latest Version 2025
PDF
Cost to Outsource Software Development in 2025
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 41
PDF
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
PDF
Digital Systems & Binary Numbers (comprehensive )
PPTX
Transform Your Business with a Software ERP System
PPTX
AMADEUS TRAVEL AGENT SOFTWARE | AMADEUS TICKETING SYSTEM
PPTX
L1 - Introduction to python Backend.pptx
PPTX
Embracing Complexity in Serverless! GOTO Serverless Bengaluru
PDF
medical staffing services at VALiNTRY
Why Generative AI is the Future of Content, Code & Creativity?
17 Powerful Integrations Your Next-Gen MLM Software Needs
Download FL Studio Crack Latest version 2025 ?
Complete Guide to Website Development in Malaysia for SMEs
Nekopoi APK 2025 free lastest update
How to Choose the Right IT Partner for Your Business in Malaysia
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
Log360_SIEM_Solutions Overview PPT_Feb 2020.pptx
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
Wondershare Filmora 15 Crack With Activation Key [2025
CCleaner Pro 6.38.11537 Crack Final Latest Version 2025
Cost to Outsource Software Development in 2025
Internet Downloader Manager (IDM) Crack 6.42 Build 41
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
Digital Systems & Binary Numbers (comprehensive )
Transform Your Business with a Software ERP System
AMADEUS TRAVEL AGENT SOFTWARE | AMADEUS TICKETING SYSTEM
L1 - Introduction to python Backend.pptx
Embracing Complexity in Serverless! GOTO Serverless Bengaluru
medical staffing services at VALiNTRY

Towards better software quality assurance by providing intelligent support

  • 1. Towards Providing Automated Supports to Developers on Making Logging Decisions Tse-Hsun (Peter) Chen peterc@encs.concordia.ca
  • 4. Industry collaboration and research outcome adoption
  • 5. Main research area: improving software quality and testing process Software System Performance counters System logs Software tests Bug reports … Software developers Applying code analysis, machine learning, and data analytics to provide automated support to developers I will focus on my research on software logging in this talk
  • 6. Logs are often the only source of information for production systems System running in production Operator Developer
  • 7. Logs can be used to assist various software development tasks Performance Analysis Requirement Tracking Debugging Monitoring
  • 8. LOG.warn(“Can not parse job id from {} ”, path, e); Verbosity Level Static Message Dynamic Variables … } catch (Exception e) { } Logging Too much: performance overhead; too many trivial logs Too little: missing important information What is a Logging Statement & Trade-off of Logging Logs record important runtime info, but with trade-offs 8
  • 9. What is a Logging Statement & Trade-off of Logging Deciding where to log is challenging “Logging and tracing is (IMO) a fine art, knowing what to log and where takes experience.”
  • 10. Where do developers log? Studying where do developers log and provide recommendations Can we leverage existing code to recommend logging locations?
  • 11. Source Code Logging statements (with surrounding code) Our process of studying and providing logging suggestions
  • 12. Cassandra Our Studied Systems Elasticsearch Flink HBase Kafka Wicket Zookeeper We study where do developers log in 7 large- scale open source systems
  • 13. Source Code Logging statements (with surrounding code) Manual study on logging code Our process of studying and providing logging suggestions
  • 14. Manual study to understand their characteristics Randomly sample 375 out of 14.9K logging statements and their surrendering code Manually studying logging code and its location
  • 15. Manual study to understand their characteristics Randomly sample 375 out of 14.9K logging statements and their surrendering code Manually studying logging code and its location We uncover 6 categories of logging locations, and the relationship between logging statements and code
  • 16. Category 1: Exception information logging in catch blocks Categories of logging locations Semantic information Syntactic information The logging statements often record messages or execution info related to the prior try block.
  • 17. Categories of logging locations Category 2: Execution state logging in branch blocks Semantic information Syntactic information Logging statements often record execution states in different branches.
  • 18. Categories of logging locations Category 3: Logging the beginning/end of a method block (method execution) public void removeJob(JobID jobId){ ... // the end of the method log.info(“Removed jobId {} from Zookeeper”, jobId); } Logging statements often record the beginning or end of method execution. Related to the semantic of the method
  • 19. Source Code Logging statements (with surrounding code) Manual study on logging code Our process of studying and providing logging suggestions Extracting Code Block Feature (Syntactic, Semantic, Fusion)
  • 20. if(Strings.isEmpty(sessionID)) { LOG.error(“failed to get session ID”); handleError(); return; } Syntactic Semantic Fusion Extracting code block features
  • 21. IfStatement, MethodInvocation, string, is, empti, session, id, if(Strings.isEmpty(sessionID)) { handleError(); return; } Syntactic Semantic Fusion MethodInvocation, ReturnStatement handle, error IfStatement, MethodInvocation, string, is, empty, session, id MethodInvocation, handle, error, ReturnStatement Extracting code block features
  • 22. Source Code Logging statements (with surrounding code) Manual study on logging code Our process of studying and providing logging suggestions Extracting Code Block Feature (Syntactic, Semantic, Fusion) Deep Learning Framework
  • 23. Source Code Code Block Features …… Word Embedding Layer RNN Cell RNN Cell RNN Cell …… RNN Cell RNN Layer (LSTM) Output Layer Our process of studying and providing logging suggestions
  • 24. Source Code Logging statements (with surrounding code) Manual study on logging code Our process of studying and providing logging suggestions Extracting Code Block Feature (Syntactic, Semantic, Fusion) Deep Learning Framework Suggestion Results (logged vs. non-logged block)
  • 25. Research Questions RQ1 RQ2 How effective are different block features when suggesting logging locations? Are the trained models transferable to other systems? Evaluation of our logging location suggestion models
  • 26. Research Questions RQ1 RQ2 How effective are different block features when suggesting logging locations? Are the trained models transferable to other systems? Evaluation of our logging location suggestion models
  • 27. • For each system, we use 60% for training, 20% for validation, and 20% for testing. • Compute balanced accuracy for evaluation • How well can the model suggest logged and non-logged code blocks Process and metrics for DL model evaluation
  • 28. Balanced Accuracy of different block features 50 60 70 80 90 Try-Catch Branching Looping Method Syntactic Semantic Fusion 85.8 77.4 69.0 63.2 Process and metrics for DL model evaluation Models trained using syntactic features achieve the best results.
  • 29. True Positive (TP) True Negative (TN) False Positive (FP) False Negative (FN) High overlaps in TN shows non-logged code has distinct characteristics that are captured by all features. Syntactics has the lowest FNs. 20.1% of the TPs are missed by syntactic but captured by two other block features. Only small overlaps on FPs among the features. Studying the overlap among the results using three different features
  • 30. Manually Studying FPs and FNs We further manually study a sample of False Positive and False Negative in our suggestion results We find that a large portion of the FPs and FNs may be considered as TPs and TNs. An example of FP: Some misclassifications may actually be correct The object state is saved to a JSON files instead of log files The actual performance of our model may be even better due to the diverse nature of how developers write logging code.
  • 31. Research Questions RQ1 RQ2 How effective are different block features when suggesting logging locations? Are the trained models transferable to other systems? Evaluation of our logging location suggestion models We suggest logging locations with reasonable accuracy. Different features capture different logging info in the code.
  • 32. Research Questions RQ1 RQ2 How effective are different block features when suggesting logging locations? Are the trained models transferable to other systems? Evaluation of our logging location suggestion models We suggest logging locations with reasonable accuracy. Different features capture different logging info in the code.
  • 33. Training a model using syntactic features Training cross-system models Apply the models on other systems
  • 34. Balanced Accuracy for cross-system suggestions RQ2: Are the trained models transferable to other systems? 10 30 50 70 90 Cassandra Flink Kafka Zookeeper Within Cross 81.7% 80.0% 84.6% 83.9% 88.4% 80.1% 91.7% The percentage is the ratio of Cross against Within Although decreased, cross system suggestion still achieves reasonable performance compared to within-system suggestion. Results of cross system suggestion
  • 35. Research Questions RQ1 RQ2 How effective are different block features when suggesting logging locations? Are the trained models transferable to other systems? Evaluation of our logging location suggestion models We suggest logging locations with reasonable accuracy. Different features capture different logging info in the code. Different systems may share a similar implicit logging guideline.