SlideShare ist ein Scribd-Unternehmen logo
A Decade of Comment Quality Assessment:
A Systematic Literature Review
Pooja Rani, Arianna Blasi, Natallia Stulova, Sebastiano
Panichella, Alessandra Gorla, Oscar Nierstrasz
Journal First
University of Zurich, Switzerland
ESEM 2023
2
How software developers spend their time?
Xia, X., Bao, L., Lo, D., Xing, Z., Hassan, A. E., & Li, S. (2017). Measuring program comprehension:
A large-scale
fi
eld study with professionals. IEEE Transactions on Software Engineering.
Comprehension
58%
Navigation
24%
Others
13%
Edition
5%
3
Comprehension
58%
Navigation
24%
Others
13%
Edition
5%
Code comments
/**
* A class representing a window on the screen.
*
* For example:
* <pre>
* Window win = new Window(parent);
* win.show();
* </pre>
*
* @author Sami Shaio
* @version 1.13, 06/08/06
* @see java.awt.BaseWindow
* @see java.awt.Button
*/
class Window extends BaseWindow {
…
}
4
/**
* A class representing a window on the screen.
*
* For example:
* <pre>
* Window win = new Window(parent);
* win.show();
* </pre>
*
* @author Sami Shaio
* @version 1.13, 06/08/06
* @see java.awt.BaseWindow
* @see java.awt.Button
*/
class Window extends BaseWindow {
…
}
Code comments
5
/**
* A class representing a window on the screen.
*
* For example:
* <pre>
* Window win = new Window(parent);
* win.show();
* </pre>
*
* @author Sami Shaio
* @version 1.13, 06/08/06
* @see java.awt.BaseWindow
* @see java.awt.Button
*/
class Window extends BaseWindow {
…
}
Code comments
6
/**
* A class representing a window on the screen.
*
* For example:
* <pre>
* Window win = new Window(parent);
* win.show();
* </pre>
*
* @author Sami Shaio
* @version 1.13, 06/08/06
* @see java.awt.BaseWindow
* @see java.awt.Button
*/
class Window extends BaseWindow {
…
}
Code comments
Trustworthy form of documentation
- McMillan et al. 2010
7
High-quality comments support developers in various activities
/**
* A class representing a window on the screen.
*
* For example:
* <pre>
* Window win = new Window(parent);
* win.show();
* </pre>
*
* @author Sami Shaio
* @version 1.13, 06/08/06
* @see java.awt.BaseWindow
* @see java.awt.Button
*/
class Window extends BaseWindow {
…
}
Code comments
Trustworthy form of documentation
- McMillan et al. 2010
- Dekel et al. 2009
8
/**
* A class representing a window on the screen.
*
* For example:
* <pre>
* Window win = new Window(parent);
* win.show();
* </pre>
*
* @author Sami Shaio
* @version 1.13, 06/08/06
* @see java.awt.BaseWindow
* @see java.awt.Button
*/
class Window extends BaseWindow {
…
}
Is this a high-
quality comment?
correct?
consistent?
enough?
Other quality attributes?
Code comments
9
Gillies et al. 2011
Quality is a multi-dimensional concept
10
How do researchers measure comment quality?
Systematic literature review
10 years timeline (2011-2020)
195 software engineering venues
332 proceedings
2353 candidate papers
47 relevant papers
11
How do researchers measure comment quality?
12
21 quality attributes
Quality attributes
13
Consistency
Completeness
Accuracy
Readability
Up-to-date-ness
Content relevance
Maintainability
Spelling and grammar
Quality attributes
Quality attributes
23
12
21 quality attributes
14
Some are frequently considered
Consistency
Completeness
Accuracy
Readability
Up-to-date-ness
Content relevance
Maintainability
Spelling and grammar
Quality attributes
Quality attributes
15
Some are rarely considered
Consistency
Completeness
Accuracy
Readability
Up-to-date-ness
Content relevance
Maintainability
Spelling and grammar
Conciseness
Usability
Correctness
Traceability
Accessibility
Coherence
Format
Information organization
Understandability
Documentation technoogy
Internatioalization
Author-related
Quality attributes
Quality attributes
16
Techniques Consistency
Completeness
Accuracy
Readability
Up-to-date-ness
Content relevance
Maintainability
Spelling and grammar
Conciseness
Usability
Correctness
Traceability
Accessibility
Coherence
Format
Information organization
Understandability
Documentation technoogy
Internatioalization
Author-related
Quality attributes
17
Techniques
Manual assessment
Consistency
ML-based
Heuristic-based
Completeness
Accuracy
Metric-based
Static analysis
NLP
Readability
Up-to-date-ness
Content relevance
DNN-based
Maintainability
Spelling and grammar
Conciseness
First order logic
Usability
Correctness
Traceability
Accessibility
Coherence
Format
Information organization
Understandability
Empirically
fNIRS
Documentation technoogy
Internatioalization
Author-related
Techniques
Quality attributes
18
Techniques
Manual assessment
Consistency
ML-based
Heuristic-based
Completeness
Accuracy
Metric-based
Static analysis
NLP
Readability
Up-to-date-ness
Content relevance
DNN-based
Maintainability
Spelling and grammar
Conciseness
First order logic
Usability
Correctness
Traceability
Accessibility
Coherence
Format
Information organization
Understandability
Empirically
fNIRS
Documentation technoogy
Internatioalization
Author-related
Techniques
Quality attributes
Manual assessment
Consistency
ML-based
Heuristic-based
Completeness
Accuracy
Metric-based
Static analysis
NLP
Readability
Up-to-date-ness
Content relevance
DNN-based
Maintainability
Spelling and grammar
Conciseness
First order logic
Usability
Correctness
Traceability
Accessibility
Coherence
Format
Information organization
Understandability
Empirically
fNIRS
Documentation technoogy
Internatioalization
Author-related
Techniques
Quality attributes
19
Techniques
Manual assessment is still the most
frequent technique to measure
quality attributes
Manual assessment
Consistency
ML-based
Heuristic-based
Completeness
Accuracy
Metric-based
Static analysis
NLP
Readability
Up-to-date-ness
Content relevance
DNN-based
Maintainability
Spelling and grammar
Conciseness
First order logic
Usability
Correctness
Traceability
Accessibility
Coherence
Format
Information organization
Understandability
Empirically
fNIRS
Documentation technoogy
Internatioalization
Author-related
Techniques
Quality attributes
20
Techniques
Deep learning-based techniques have
not been extensively explored for
comment analysis
Manual assessment
Consistency
ML-based
Heuristic-based
Completeness
Accuracy
Metric-based
Static analysis
NLP
Readability
Up-to-date-ness
Content relevance
DNN-based
Maintainability
Spelling and grammar
Conciseness
First order logic
Usability
Correctness
Traceability
Accessibility
Coherence
Format
Information organization
Understandability
Empirically
fNIRS
Documentation technoogy
Internatioalization
Author-related
Techniques
Quality attributes
21
Which of these quality attributes are
important to which developers?
Do code reviewers care more for accurate
comments than complete comments? When?
How to automatically measure these
quality attributes?
Can LLMs help writing better comments?
22
Is comments worth the efforts?
23
/**
* A class representing a window on the screen.
*
* For example:
* <pre>
* Window win = new Window(parent);
* win.show();
* </pre>
*
* @author Sami Shaio
* @version 1.13, 06/08/06
* @see java.awt.BaseWindow
* @see java.awt.Button
*/
class Window extends BaseWindow {
…
}
Task Design Implementation Maintenance
Summary
Usage
Pointer
Information Quality attributes
Accessibility
Readability
Author-related
Completeness
Consistency
Correctness
Audience User Developer
Future work
24
Replication: https://
zenodo.org/record/
4729054
Paper
pooja-rani-01985b68/
A Decade of Comment Quality Assessment: A Systematic Literature Review
More Curious?
/**
* A class representing a window on the screen.
*
* For example:
* <pre>
* Window win = new Window(parent);
* win.show();
* </pre>
*
* @author Sami Shaio
* @version 1.13, 06/08/06
* @see java.awt.BaseWindow
*/
class Window extends BaseWindow{
..
}
class OneHotCategorical(Distribution):
r"""
Creates a one-hot categorical distribution parameterized by :attr:`probs` or
:attr:`logits`.
Samples are one-hot coded vectors of size ``probs.size(-1)``.
.. note:: The `probs` argument must be non-negative, finite and have a non-zero sum,
and it will be normalized to sum to 1 along the last dimension. :attr:`probs`
will return this normalized value.
The `logits` argument will be interpreted as unnormalized log probabilities
and can therefore be any real number. It will likewise be normalized so that
the resulting probabilities sum to 1 along the last dimension. :attr:`logits`
will return this normalized value.
See also: :func:`torch.distributions.Categorical` for specifications of
:attr:`probs` and :attr:`logits`.
Example::
>>> m = OneHotCategorical(torch.tensor([ 0.25, 0.25, 0.25, 0.25 ]))
>>> m.sample() # equal probability of 0, 1, 2, 3
tensor([ 0., 0., 0., 1.])
Args:
probs (Tensor): event probabilities
logits (Tensor): event log probabilities (unnormalized)
"""
Smalltalk class comment
26
Comments of multi-languages
27
Methodology
1 2 3
4
6
5
28
1 2 3
4
6
5
Methodology
29
7
6
8 9
10
1 2 3
4 5
Methodology
11
47 papers
47 papers over years
30
0
2
4
6
8
10
2011 2012 2013 2014 2015 2016 2017 2018 2019 2020
#
Papers
31
consistency, completeness
Quality attributes
Techniques
Comment types
method comments, inline comments
heuristic-based, machine learning-based
Dimensions analyzed
Data availability
tool, dataset
32
/**
* A class representing a window on the screen.
*
* For example:
* <pre>
* Window win = new Window(parent);
* win.show();
* </pre>
*
* @author Sami Shaio
* @version 1.13, 06/08/06
* @see java.awt.BaseWindow
* @see java.awt.Button
*/
class Window extends BaseWindow {
…
}
Code comment metrics
Consistency:
Overlap between the terms used
in comment and code. Higher
value of CIC with higher
readability of that code.
Readability:
Flesch reading-ease test
33
Nearly 50% of the studies still lack in the replicability
dimension, as their respective dataset or tool is often
not publicly accessible.
Data availability
34
48%
19%
8%
4%
4%
2%
2%
6%
6%
2%
6%
4%
2%
4%
4%
2%
2%
8%
4%
2%
2%
Code comments
Method comments
API documentation
License comments
Inline comments
TODO Comments
Software documentation
Deprecation Comments
0% 20% 40% 60% 80%
Java
Python
C++
C
C#
Other
Comment types
35
48%
19%
8%
4%
4%
2%
2%
6%
6%
2%
6%
4%
2%
4%
4%
2%
2%
8%
4%
2%
2%
Code comments
Method comments
API documentation
License comments
Inline comments
TODO Comments
Software documentation
Deprecation Comments
0% 20% 40% 60% 80%
Java
Python
C++
C
C#
Other
52% of the studies
Comment types
36
48%
19%
8%
4%
4%
2%
2%
6%
6%
2%
6%
4%
2%
4%
4%
2%
2%
8%
4%
2%
2%
Code comments
Method comments
API documentation
License comments
Inline comments
TODO Comments
Software documentation
Deprecation Comments
0% 20% 40% 60% 80%
Java
Python
C++
C
C#
Other
48% of the studies
Comment types
37
Comment types
48%
19%
8%
4%
4%
2%
2%
6%
6%
2%
6%
4%
2%
4%
4%
2%
2%
8%
4%
2%
2%
Code comments
Method comments
API documentation
License comments
Inline comments
TODO Comments
Software documentation
Deprecation Comments
0% 20% 40% 60% 80%
Java
Python
C++
C
C#
Other
% of studies

Weitere ähnliche Inhalte

Ähnlich wie A Decade of Comment Quality Assessment: A Systematic Literature Review

CIS 406 Imagine Your Future/newtonhelp.com   
CIS 406 Imagine Your Future/newtonhelp.com   CIS 406 Imagine Your Future/newtonhelp.com   
CIS 406 Imagine Your Future/newtonhelp.com   
bellflower47
 
CIS 406 Life of the Mind/newtonhelp.com   
CIS 406 Life of the Mind/newtonhelp.com   CIS 406 Life of the Mind/newtonhelp.com   
CIS 406 Life of the Mind/newtonhelp.com   
bellflower5
 
CIS 406 Focus Dreams/newtonhelp.com
CIS 406 Focus Dreams/newtonhelp.comCIS 406 Focus Dreams/newtonhelp.com
CIS 406 Focus Dreams/newtonhelp.com
bellflower87
 
Cis 406 Extraordinary Success/newtonhelp.com
Cis 406 Extraordinary Success/newtonhelp.com  Cis 406 Extraordinary Success/newtonhelp.com
Cis 406 Extraordinary Success/newtonhelp.com
amaranthbeg148
 
Innovation Generation - The Mobile Meetup: Android Best Practices
Innovation Generation - The Mobile Meetup: Android Best PracticesInnovation Generation - The Mobile Meetup: Android Best Practices
Innovation Generation - The Mobile Meetup: Android Best Practices
Solstice Mobile Argentina
 
JavaScript Miller Columns
JavaScript Miller ColumnsJavaScript Miller Columns
JavaScript Miller Columns
Jonathan Fine
 
Introduction to Behavior Driven Development
Introduction to Behavior Driven Development Introduction to Behavior Driven Development
Introduction to Behavior Driven Development
Robin O'Brien
 
CIS 406 Entire Course NEW
CIS 406 Entire Course NEWCIS 406 Entire Course NEW
CIS 406 Entire Course NEW
shyamuopfive
 
Ensuring code quality
Ensuring code qualityEnsuring code quality
Ensuring code quality
MikhailVladimirov
 
HKG15-411: Browser Testing Framework for LHG
HKG15-411: Browser Testing Framework for LHGHKG15-411: Browser Testing Framework for LHG
HKG15-411: Browser Testing Framework for LHG
Linaro
 
We continue checking Microsoft projects: analysis of PowerShell
We continue checking Microsoft projects: analysis of PowerShellWe continue checking Microsoft projects: analysis of PowerShell
We continue checking Microsoft projects: analysis of PowerShell
PVS-Studio
 
Framework engineering JCO 2011
Framework engineering JCO 2011Framework engineering JCO 2011
Framework engineering JCO 2011
YoungSu Son
 
Full_Stack_Dule_1.NNNNNNNNNNNNNNNNNNNNNNNNNNNNNN[1].pptx
Full_Stack_Dule_1.NNNNNNNNNNNNNNNNNNNNNNNNNNNNNN[1].pptxFull_Stack_Dule_1.NNNNNNNNNNNNNNNNNNNNNNNNNNNNNN[1].pptx
Full_Stack_Dule_1.NNNNNNNNNNNNNNNNNNNNNNNNNNNNNN[1].pptx
KalyanGV2
 
Strayer cis 406 week 6 assignment 1 financial portfolio new
Strayer cis 406 week 6 assignment 1 financial portfolio newStrayer cis 406 week 6 assignment 1 financial portfolio new
Strayer cis 406 week 6 assignment 1 financial portfolio new
dixonbakerr
 
Comparing static analysis in Visual Studio 2012 (Visual C++ 2012) and PVS-Studio
Comparing static analysis in Visual Studio 2012 (Visual C++ 2012) and PVS-StudioComparing static analysis in Visual Studio 2012 (Visual C++ 2012) and PVS-Studio
Comparing static analysis in Visual Studio 2012 (Visual C++ 2012) and PVS-Studio
PVS-Studio
 
Chapter 2.1
Chapter 2.1Chapter 2.1
Chapter 2.1
sotlsoc
 
Strayer cis 406 week 6 assignment 1 financial portfolio new
Strayer cis 406 week 6 assignment 1 financial portfolio newStrayer cis 406 week 6 assignment 1 financial portfolio new
Strayer cis 406 week 6 assignment 1 financial portfolio new
uopassignment
 
Strayer cis 406 week 6 assignment 1 financial portfolio new
Strayer cis 406 week 6 assignment 1 financial portfolio newStrayer cis 406 week 6 assignment 1 financial portfolio new
Strayer cis 406 week 6 assignment 1 financial portfolio new
lroselyn
 
MSR Asia Summit
MSR Asia SummitMSR Asia Summit
MSR Asia Summit
Ptidej Team
 
Measuring Your Code
Measuring Your CodeMeasuring Your Code
Measuring Your Code
Nate Abele
 

Ähnlich wie A Decade of Comment Quality Assessment: A Systematic Literature Review (20)

CIS 406 Imagine Your Future/newtonhelp.com   
CIS 406 Imagine Your Future/newtonhelp.com   CIS 406 Imagine Your Future/newtonhelp.com   
CIS 406 Imagine Your Future/newtonhelp.com   
 
CIS 406 Life of the Mind/newtonhelp.com   
CIS 406 Life of the Mind/newtonhelp.com   CIS 406 Life of the Mind/newtonhelp.com   
CIS 406 Life of the Mind/newtonhelp.com   
 
CIS 406 Focus Dreams/newtonhelp.com
CIS 406 Focus Dreams/newtonhelp.comCIS 406 Focus Dreams/newtonhelp.com
CIS 406 Focus Dreams/newtonhelp.com
 
Cis 406 Extraordinary Success/newtonhelp.com
Cis 406 Extraordinary Success/newtonhelp.com  Cis 406 Extraordinary Success/newtonhelp.com
Cis 406 Extraordinary Success/newtonhelp.com
 
Innovation Generation - The Mobile Meetup: Android Best Practices
Innovation Generation - The Mobile Meetup: Android Best PracticesInnovation Generation - The Mobile Meetup: Android Best Practices
Innovation Generation - The Mobile Meetup: Android Best Practices
 
JavaScript Miller Columns
JavaScript Miller ColumnsJavaScript Miller Columns
JavaScript Miller Columns
 
Introduction to Behavior Driven Development
Introduction to Behavior Driven Development Introduction to Behavior Driven Development
Introduction to Behavior Driven Development
 
CIS 406 Entire Course NEW
CIS 406 Entire Course NEWCIS 406 Entire Course NEW
CIS 406 Entire Course NEW
 
Ensuring code quality
Ensuring code qualityEnsuring code quality
Ensuring code quality
 
HKG15-411: Browser Testing Framework for LHG
HKG15-411: Browser Testing Framework for LHGHKG15-411: Browser Testing Framework for LHG
HKG15-411: Browser Testing Framework for LHG
 
We continue checking Microsoft projects: analysis of PowerShell
We continue checking Microsoft projects: analysis of PowerShellWe continue checking Microsoft projects: analysis of PowerShell
We continue checking Microsoft projects: analysis of PowerShell
 
Framework engineering JCO 2011
Framework engineering JCO 2011Framework engineering JCO 2011
Framework engineering JCO 2011
 
Full_Stack_Dule_1.NNNNNNNNNNNNNNNNNNNNNNNNNNNNNN[1].pptx
Full_Stack_Dule_1.NNNNNNNNNNNNNNNNNNNNNNNNNNNNNN[1].pptxFull_Stack_Dule_1.NNNNNNNNNNNNNNNNNNNNNNNNNNNNNN[1].pptx
Full_Stack_Dule_1.NNNNNNNNNNNNNNNNNNNNNNNNNNNNNN[1].pptx
 
Strayer cis 406 week 6 assignment 1 financial portfolio new
Strayer cis 406 week 6 assignment 1 financial portfolio newStrayer cis 406 week 6 assignment 1 financial portfolio new
Strayer cis 406 week 6 assignment 1 financial portfolio new
 
Comparing static analysis in Visual Studio 2012 (Visual C++ 2012) and PVS-Studio
Comparing static analysis in Visual Studio 2012 (Visual C++ 2012) and PVS-StudioComparing static analysis in Visual Studio 2012 (Visual C++ 2012) and PVS-Studio
Comparing static analysis in Visual Studio 2012 (Visual C++ 2012) and PVS-Studio
 
Chapter 2.1
Chapter 2.1Chapter 2.1
Chapter 2.1
 
Strayer cis 406 week 6 assignment 1 financial portfolio new
Strayer cis 406 week 6 assignment 1 financial portfolio newStrayer cis 406 week 6 assignment 1 financial portfolio new
Strayer cis 406 week 6 assignment 1 financial portfolio new
 
Strayer cis 406 week 6 assignment 1 financial portfolio new
Strayer cis 406 week 6 assignment 1 financial portfolio newStrayer cis 406 week 6 assignment 1 financial portfolio new
Strayer cis 406 week 6 assignment 1 financial portfolio new
 
MSR Asia Summit
MSR Asia SummitMSR Asia Summit
MSR Asia Summit
 
Measuring Your Code
Measuring Your CodeMeasuring Your Code
Measuring Your Code
 

Mehr von Pooja Rani

Energy Patterns for Web: An Exploratory Study
Energy Patterns for Web: An Exploratory StudyEnergy Patterns for Web: An Exploratory Study
Energy Patterns for Web: An Exploratory Study
Pooja Rani
 
Can We Automatically Generate Class Comments in Pharo?
Can We Automatically Generate Class Comments in Pharo?Can We Automatically Generate Class Comments in Pharo?
Can We Automatically Generate Class Comments in Pharo?
Pooja Rani
 
What do class comments tell us?An investigation of comment evolution and prac...
What do class comments tell us?An investigation of comment evolution and prac...What do class comments tell us?An investigation of comment evolution and prac...
What do class comments tell us?An investigation of comment evolution and prac...
Pooja Rani
 
What Do Developers Discuss about Code Comments?
What Do Developers Discuss about Code Comments?What Do Developers Discuss about Code Comments?
What Do Developers Discuss about Code Comments?
Pooja Rani
 
Let linguistics guide software analysis
Let linguistics guide software analysisLet linguistics guide software analysis
Let linguistics guide software analysis
Pooja Rani
 
Comment soup with a pinch of types
Comment soup with a pinch of typesComment soup with a pinch of types
Comment soup with a pinch of types
Pooja Rani
 
Software Analysis using Natural Language Queries
Software Analysis using Natural Language QueriesSoftware Analysis using Natural Language Queries
Software Analysis using Natural Language Queries
Pooja Rani
 

Mehr von Pooja Rani (7)

Energy Patterns for Web: An Exploratory Study
Energy Patterns for Web: An Exploratory StudyEnergy Patterns for Web: An Exploratory Study
Energy Patterns for Web: An Exploratory Study
 
Can We Automatically Generate Class Comments in Pharo?
Can We Automatically Generate Class Comments in Pharo?Can We Automatically Generate Class Comments in Pharo?
Can We Automatically Generate Class Comments in Pharo?
 
What do class comments tell us?An investigation of comment evolution and prac...
What do class comments tell us?An investigation of comment evolution and prac...What do class comments tell us?An investigation of comment evolution and prac...
What do class comments tell us?An investigation of comment evolution and prac...
 
What Do Developers Discuss about Code Comments?
What Do Developers Discuss about Code Comments?What Do Developers Discuss about Code Comments?
What Do Developers Discuss about Code Comments?
 
Let linguistics guide software analysis
Let linguistics guide software analysisLet linguistics guide software analysis
Let linguistics guide software analysis
 
Comment soup with a pinch of types
Comment soup with a pinch of typesComment soup with a pinch of types
Comment soup with a pinch of types
 
Software Analysis using Natural Language Queries
Software Analysis using Natural Language QueriesSoftware Analysis using Natural Language Queries
Software Analysis using Natural Language Queries
 

Kürzlich hochgeladen

Skybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoptionSkybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoption
Tatiana Kojar
 
June Patch Tuesday
June Patch TuesdayJune Patch Tuesday
June Patch Tuesday
Ivanti
 
Nunit vs XUnit vs MSTest Differences Between These Unit Testing Frameworks.pdf
Nunit vs XUnit vs MSTest Differences Between These Unit Testing Frameworks.pdfNunit vs XUnit vs MSTest Differences Between These Unit Testing Frameworks.pdf
Nunit vs XUnit vs MSTest Differences Between These Unit Testing Frameworks.pdf
flufftailshop
 
Digital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying AheadDigital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying Ahead
Wask
 
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing InstancesEnergy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
Alpen-Adria-Universität
 
Nordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptxNordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptx
MichaelKnudsen27
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
Zilliz
 
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUHCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
panagenda
 
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
saastr
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc
 
5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides
DanBrown980551
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
Octavian Nadolu
 
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdfHow to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
Chart Kalyan
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Safe Software
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
innovationoecd
 
Recommendation System using RAG Architecture
Recommendation System using RAG ArchitectureRecommendation System using RAG Architecture
Recommendation System using RAG Architecture
fredae14
 
Trusted Execution Environment for Decentralized Process Mining
Trusted Execution Environment for Decentralized Process MiningTrusted Execution Environment for Decentralized Process Mining
Trusted Execution Environment for Decentralized Process Mining
LucaBarbaro3
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Malak Abu Hammad
 
Best 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERPBest 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERP
Pixlogix Infotech
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
Tomaz Bratanic
 

Kürzlich hochgeladen (20)

Skybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoptionSkybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoption
 
June Patch Tuesday
June Patch TuesdayJune Patch Tuesday
June Patch Tuesday
 
Nunit vs XUnit vs MSTest Differences Between These Unit Testing Frameworks.pdf
Nunit vs XUnit vs MSTest Differences Between These Unit Testing Frameworks.pdfNunit vs XUnit vs MSTest Differences Between These Unit Testing Frameworks.pdf
Nunit vs XUnit vs MSTest Differences Between These Unit Testing Frameworks.pdf
 
Digital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying AheadDigital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying Ahead
 
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing InstancesEnergy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
 
Nordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptxNordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptx
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
 
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUHCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
 
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
 
5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
 
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdfHow to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
 
Recommendation System using RAG Architecture
Recommendation System using RAG ArchitectureRecommendation System using RAG Architecture
Recommendation System using RAG Architecture
 
Trusted Execution Environment for Decentralized Process Mining
Trusted Execution Environment for Decentralized Process MiningTrusted Execution Environment for Decentralized Process Mining
Trusted Execution Environment for Decentralized Process Mining
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
 
Best 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERPBest 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERP
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
 

A Decade of Comment Quality Assessment: A Systematic Literature Review

  • 1. A Decade of Comment Quality Assessment: A Systematic Literature Review Pooja Rani, Arianna Blasi, Natallia Stulova, Sebastiano Panichella, Alessandra Gorla, Oscar Nierstrasz Journal First University of Zurich, Switzerland ESEM 2023
  • 2. 2 How software developers spend their time? Xia, X., Bao, L., Lo, D., Xing, Z., Hassan, A. E., & Li, S. (2017). Measuring program comprehension: A large-scale fi eld study with professionals. IEEE Transactions on Software Engineering. Comprehension 58% Navigation 24% Others 13% Edition 5%
  • 3. 3 Comprehension 58% Navigation 24% Others 13% Edition 5% Code comments /** * A class representing a window on the screen. * * For example: * <pre> * Window win = new Window(parent); * win.show(); * </pre> * * @author Sami Shaio * @version 1.13, 06/08/06 * @see java.awt.BaseWindow * @see java.awt.Button */ class Window extends BaseWindow { … }
  • 4. 4 /** * A class representing a window on the screen. * * For example: * <pre> * Window win = new Window(parent); * win.show(); * </pre> * * @author Sami Shaio * @version 1.13, 06/08/06 * @see java.awt.BaseWindow * @see java.awt.Button */ class Window extends BaseWindow { … } Code comments
  • 5. 5 /** * A class representing a window on the screen. * * For example: * <pre> * Window win = new Window(parent); * win.show(); * </pre> * * @author Sami Shaio * @version 1.13, 06/08/06 * @see java.awt.BaseWindow * @see java.awt.Button */ class Window extends BaseWindow { … } Code comments
  • 6. 6 /** * A class representing a window on the screen. * * For example: * <pre> * Window win = new Window(parent); * win.show(); * </pre> * * @author Sami Shaio * @version 1.13, 06/08/06 * @see java.awt.BaseWindow * @see java.awt.Button */ class Window extends BaseWindow { … } Code comments Trustworthy form of documentation - McMillan et al. 2010
  • 7. 7 High-quality comments support developers in various activities /** * A class representing a window on the screen. * * For example: * <pre> * Window win = new Window(parent); * win.show(); * </pre> * * @author Sami Shaio * @version 1.13, 06/08/06 * @see java.awt.BaseWindow * @see java.awt.Button */ class Window extends BaseWindow { … } Code comments Trustworthy form of documentation - McMillan et al. 2010 - Dekel et al. 2009
  • 8. 8 /** * A class representing a window on the screen. * * For example: * <pre> * Window win = new Window(parent); * win.show(); * </pre> * * @author Sami Shaio * @version 1.13, 06/08/06 * @see java.awt.BaseWindow * @see java.awt.Button */ class Window extends BaseWindow { … } Is this a high- quality comment? correct? consistent? enough? Other quality attributes? Code comments
  • 9. 9 Gillies et al. 2011 Quality is a multi-dimensional concept
  • 10. 10 How do researchers measure comment quality?
  • 11. Systematic literature review 10 years timeline (2011-2020) 195 software engineering venues 332 proceedings 2353 candidate papers 47 relevant papers 11 How do researchers measure comment quality?
  • 13. 13 Consistency Completeness Accuracy Readability Up-to-date-ness Content relevance Maintainability Spelling and grammar Quality attributes Quality attributes 23 12 21 quality attributes
  • 14. 14 Some are frequently considered Consistency Completeness Accuracy Readability Up-to-date-ness Content relevance Maintainability Spelling and grammar Quality attributes Quality attributes
  • 15. 15 Some are rarely considered Consistency Completeness Accuracy Readability Up-to-date-ness Content relevance Maintainability Spelling and grammar Conciseness Usability Correctness Traceability Accessibility Coherence Format Information organization Understandability Documentation technoogy Internatioalization Author-related Quality attributes Quality attributes
  • 16. 16 Techniques Consistency Completeness Accuracy Readability Up-to-date-ness Content relevance Maintainability Spelling and grammar Conciseness Usability Correctness Traceability Accessibility Coherence Format Information organization Understandability Documentation technoogy Internatioalization Author-related Quality attributes
  • 17. 17 Techniques Manual assessment Consistency ML-based Heuristic-based Completeness Accuracy Metric-based Static analysis NLP Readability Up-to-date-ness Content relevance DNN-based Maintainability Spelling and grammar Conciseness First order logic Usability Correctness Traceability Accessibility Coherence Format Information organization Understandability Empirically fNIRS Documentation technoogy Internatioalization Author-related Techniques Quality attributes
  • 18. 18 Techniques Manual assessment Consistency ML-based Heuristic-based Completeness Accuracy Metric-based Static analysis NLP Readability Up-to-date-ness Content relevance DNN-based Maintainability Spelling and grammar Conciseness First order logic Usability Correctness Traceability Accessibility Coherence Format Information organization Understandability Empirically fNIRS Documentation technoogy Internatioalization Author-related Techniques Quality attributes
  • 19. Manual assessment Consistency ML-based Heuristic-based Completeness Accuracy Metric-based Static analysis NLP Readability Up-to-date-ness Content relevance DNN-based Maintainability Spelling and grammar Conciseness First order logic Usability Correctness Traceability Accessibility Coherence Format Information organization Understandability Empirically fNIRS Documentation technoogy Internatioalization Author-related Techniques Quality attributes 19 Techniques Manual assessment is still the most frequent technique to measure quality attributes
  • 20. Manual assessment Consistency ML-based Heuristic-based Completeness Accuracy Metric-based Static analysis NLP Readability Up-to-date-ness Content relevance DNN-based Maintainability Spelling and grammar Conciseness First order logic Usability Correctness Traceability Accessibility Coherence Format Information organization Understandability Empirically fNIRS Documentation technoogy Internatioalization Author-related Techniques Quality attributes 20 Techniques Deep learning-based techniques have not been extensively explored for comment analysis
  • 21. Manual assessment Consistency ML-based Heuristic-based Completeness Accuracy Metric-based Static analysis NLP Readability Up-to-date-ness Content relevance DNN-based Maintainability Spelling and grammar Conciseness First order logic Usability Correctness Traceability Accessibility Coherence Format Information organization Understandability Empirically fNIRS Documentation technoogy Internatioalization Author-related Techniques Quality attributes 21 Which of these quality attributes are important to which developers? Do code reviewers care more for accurate comments than complete comments? When? How to automatically measure these quality attributes? Can LLMs help writing better comments?
  • 22. 22 Is comments worth the efforts?
  • 23. 23 /** * A class representing a window on the screen. * * For example: * <pre> * Window win = new Window(parent); * win.show(); * </pre> * * @author Sami Shaio * @version 1.13, 06/08/06 * @see java.awt.BaseWindow * @see java.awt.Button */ class Window extends BaseWindow { … } Task Design Implementation Maintenance Summary Usage Pointer Information Quality attributes Accessibility Readability Author-related Completeness Consistency Correctness Audience User Developer Future work
  • 24. 24 Replication: https:// zenodo.org/record/ 4729054 Paper pooja-rani-01985b68/ A Decade of Comment Quality Assessment: A Systematic Literature Review
  • 26. /** * A class representing a window on the screen. * * For example: * <pre> * Window win = new Window(parent); * win.show(); * </pre> * * @author Sami Shaio * @version 1.13, 06/08/06 * @see java.awt.BaseWindow */ class Window extends BaseWindow{ .. } class OneHotCategorical(Distribution): r""" Creates a one-hot categorical distribution parameterized by :attr:`probs` or :attr:`logits`. Samples are one-hot coded vectors of size ``probs.size(-1)``. .. note:: The `probs` argument must be non-negative, finite and have a non-zero sum, and it will be normalized to sum to 1 along the last dimension. :attr:`probs` will return this normalized value. The `logits` argument will be interpreted as unnormalized log probabilities and can therefore be any real number. It will likewise be normalized so that the resulting probabilities sum to 1 along the last dimension. :attr:`logits` will return this normalized value. See also: :func:`torch.distributions.Categorical` for specifications of :attr:`probs` and :attr:`logits`. Example:: >>> m = OneHotCategorical(torch.tensor([ 0.25, 0.25, 0.25, 0.25 ])) >>> m.sample() # equal probability of 0, 1, 2, 3 tensor([ 0., 0., 0., 1.]) Args: probs (Tensor): event probabilities logits (Tensor): event log probabilities (unnormalized) """ Smalltalk class comment 26 Comments of multi-languages
  • 29. 29 7 6 8 9 10 1 2 3 4 5 Methodology 11 47 papers
  • 30. 47 papers over years 30 0 2 4 6 8 10 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 # Papers
  • 31. 31 consistency, completeness Quality attributes Techniques Comment types method comments, inline comments heuristic-based, machine learning-based Dimensions analyzed Data availability tool, dataset
  • 32. 32 /** * A class representing a window on the screen. * * For example: * <pre> * Window win = new Window(parent); * win.show(); * </pre> * * @author Sami Shaio * @version 1.13, 06/08/06 * @see java.awt.BaseWindow * @see java.awt.Button */ class Window extends BaseWindow { … } Code comment metrics Consistency: Overlap between the terms used in comment and code. Higher value of CIC with higher readability of that code. Readability: Flesch reading-ease test
  • 33. 33 Nearly 50% of the studies still lack in the replicability dimension, as their respective dataset or tool is often not publicly accessible. Data availability
  • 34. 34 48% 19% 8% 4% 4% 2% 2% 6% 6% 2% 6% 4% 2% 4% 4% 2% 2% 8% 4% 2% 2% Code comments Method comments API documentation License comments Inline comments TODO Comments Software documentation Deprecation Comments 0% 20% 40% 60% 80% Java Python C++ C C# Other Comment types
  • 35. 35 48% 19% 8% 4% 4% 2% 2% 6% 6% 2% 6% 4% 2% 4% 4% 2% 2% 8% 4% 2% 2% Code comments Method comments API documentation License comments Inline comments TODO Comments Software documentation Deprecation Comments 0% 20% 40% 60% 80% Java Python C++ C C# Other 52% of the studies Comment types
  • 36. 36 48% 19% 8% 4% 4% 2% 2% 6% 6% 2% 6% 4% 2% 4% 4% 2% 2% 8% 4% 2% 2% Code comments Method comments API documentation License comments Inline comments TODO Comments Software documentation Deprecation Comments 0% 20% 40% 60% 80% Java Python C++ C C# Other 48% of the studies Comment types
  • 37. 37 Comment types 48% 19% 8% 4% 4% 2% 2% 6% 6% 2% 6% 4% 2% 4% 4% 2% 2% 8% 4% 2% 2% Code comments Method comments API documentation License comments Inline comments TODO Comments Software documentation Deprecation Comments 0% 20% 40% 60% 80% Java Python C++ C C# Other % of studies