SlideShare a Scribd company logo
What do Developers Discuss about
Code Comments?
Pooja Rani, Mathias Birrer, Sebastiano Panichella
Mohammad Ghafari, Oscar Nierstrasz
University of Bern, Switzerland
Code Comment
2
/** Event fired when a spacer element is hidden or shown in Escalator
*
* @author Vaadin Ltd
* @since 7.7.13
*/
public class SpacerVisibility {
System.out.println(..);
}
Developers use comments to understand and maintain code.
Code Comment
• Style & Syntax is not enforced by complier
• Different conventions for Languages, Companies, Projects, Developers
• Confusion amongst developers
3
Planning Implementation Testing Releasing Maintenance
Internal Sources
External Sources
Developers' Information Needs
4
What Do Developers Discuss about Code Comments?
5
6
Code
comment
questions
What Do Developers Discuss about Code Comments?
7
Code
comment
questions
Code
comments High-level topics
RQ1
What Do Developers Discuss about Code Comments?
8
Code
comment
questions
Types of questions
Code
comments High-level topics
RQ1
RQ2
What Do Developers Discuss about Code Comments?
9
Code
comment
questions
Types of questions
Recommendations
Information needs
Code
comments High-level topics
RQ1
RQ2
RQ3 RQ4
What Do Developers Discuss about Code Comments?
12
What Do Developers Discuss about Code Comments?
13
What Do Developers Discuss about Code Comments?
15
What high-level topics do developers discuss?
Code
comments
Code
comments High-level topics
RQ1
# Topic Name
1 Syntax & Format
2 IDEs & Editors
3 R Documentation
4 Code Conventions
5 Developing frameworks for thread commenting
6 Open-source software
7 Documentation generation
8 Thread comments in web-sites
9 Naming conventions & data types
10 Seeking documentation & learning language
18
LDA Topic modelling
Expected topics like “Documentation Generation” or “Syntax & Format”
were successfully identified by LDA.
# Topic Name
1 Syntax & Format
2 IDEs & Editors
3 R Documentation
4 Code Conventions
5 Developing frameworks for thread commenting
6 Open-source software
7 Documentation generation
8 Thread comments in web-sites
9 Naming conventions & data types
10 Seeking documentation & learning language
19
LDA Topics: Irrelevant Topics
‘Comment’ term is used in various environment
22
What Do Developers Discuss about “Code Comment”?
Code
comments
Types of questions
Recommendations
Information needs
RQ2
RQ3 RQ4
23
What Do Developers Discuss about “Code Comment”?
Code
comments
Types of questions
RQ2
RQ2: Types of questions
25
First
Dimension
Implementation
strategies
Implementation
problems
Error
Limitation &
Possibilities
Background
Information
Best Practice
Opinion
How to use @value tag in Javadoc
The command does not work
Contains an error message from the
exception
Is there a keyboard shortcut for block
comments?
Why is # usually introduces a comment?
What is the proper way to reference a
element in Android comments?
Are comments in code a good or bad
thing?
26
0%
5%
10%
15%
20%
25%
30%
35%
40%
Implementation
Strategies
Best practice Background
Information
Limitation &
Possibilites
Implementation
Problems
Opinion Error
%
of
Question
Types
Stack overflow Quora
RQ2: Types of questions
Developers prefer different sources to know different aspects of comments
RQ3: Developer Information Needs
30
Second Dimension - Level 2
Syntax & format
Asking for features
Using features
Maintain
comments
Understand
documentation
Process comments
Change comment
template
........
32
Comment-conventions
Programming Languages Tools
IDEs & Editors Other
Add
comments
Versioning
comments
Comments
example
Grammar
rules
Maintain
comments
Syntax &
format
Other
Asking for
features
Change comment
template
Error
Process
comments
Report
bug
Setup
Syntax &
format
Using
Feature
Asking for
features
Shortcut
Process
comments
Using
feature
Tool
setup
Change comment
template
Syntax &
format
Adopt other
language style
Asking for
feature
Asking tool
existence
Change comment
template
Understand
documentation
Using
features
Process
comments
Syntax &
format
Display
comments
Add
tags
Add
comments
Blocks/Multiline
comments
Inline
comments
Add
comments
Formatting
Color
scheme
Render
documentation
Detect
undocumented
code files
Detect todo
comments
Highlight
comments
Add more information
in comments
Generate API
documentation
Directives
Generate
documentation
Lint
Add
tags
Class
comments
Function
comments
Project
documentation
Other
Show
comments
Synchronize code
comment changes
Mulit-lingual
comments
Add more
information
Add
comments
Show inherited
comments
Add
media
Generate
documentation
Tags
Function Class
Project
Other
Function
comment
Class
comment
Project
comment
Block/
Multiline
Other
Inline
comments
Comment Highlevels
Categories found in both sources (SO and Quora)
Categories found on SO
Categories found on Quora
RQ3: Developer Information Needs
Syntax & format
33
Increasing efforts and trend towards Function (API) documentation
36
1.1
2.2
2.2
3.2
3.2
3.2
4.3
4.3
5.4
5.4
7.5
9.7
11.8
14
22.6
0 % 5 % 10 % 15 % 20 % 25 %
Show inherited methods comments
Detect Todo comments
Detect undocumented code files
Color scheme
Highlight comments
Synchronize Code comment changes
Ask for documentation
Multi-lingual comments
Add comments
Render Documentation
Other
Show comments
Add media
Generate documentation
Add more information
% of Posts Asking for a Feature
Feautres
Developer
Ask
Developers are interesting in adding various information types in
comments such as how to add images, examples in comments
Asking for features
RQ4: Recommendations
37
[.net] long inline comments should start with a capital letter and end with a period.
[general] Use correct notation to write block or multiline comments.
We identified 40 comment conventions that developers recommend
on these platforms
Findings relevant for developers and researchers
Implication
Implications
40
Need of automated style checkers
Some languages do not support automated style
checkers
Adherence of comments to the
conventions
To what extent developers follow commenting
conventions
Tools to assess comment quality
Developers look for automated tools to assess
the quality of their comments
Ease of finding commenting guidelines
Developers face problems in locating
conventions
Future Work
• Investigate more sources (e.g. GitHub, Jira, Mailing lists)
• Survey developers to know which concerns are more important
than others
• Verifying the tool support to assess code comments
41
What do Developers Discuss about Code Comments?
• Preprint on Arxiv
https://arxiv.org/abs/2108.07648
• Video on YouTube
https://youtu.be/EUQINZ38ziU
• Replication Package on Zenodo
https://doi.org/10.5281/zenodo.5044270
42
http://scg.unibe.ch/staff
Contact us
https://twitter.com/poojaruhal

More Related Content

What's hot

Top 50 .NET Interview Questions and Answers 2019 | Edureka
Top 50 .NET Interview Questions and Answers 2019 | EdurekaTop 50 .NET Interview Questions and Answers 2019 | Edureka
Top 50 .NET Interview Questions and Answers 2019 | Edureka
Edureka!
 
C# Interview Questions | Edureka
C# Interview Questions | EdurekaC# Interview Questions | Edureka
C# Interview Questions | Edureka
Edureka!
 
Code review best practice
Code review best practiceCode review best practice
Code review best practice
Oren Digmi
 
Let's Explore C# 6
Let's Explore C# 6Let's Explore C# 6
Let's Explore C# 6
Jaliya Udagedara
 
Code generation
Code generationCode generation
Code generation
Doug Holland
 
Code Review for iOS
Code Review for iOSCode Review for iOS
Code Review for iOS
KLabCyscorpions-TechBlog
 
Java Tutorial: Part 2. IntelliJ IDEA
Java Tutorial: Part 2. IntelliJ IDEAJava Tutorial: Part 2. IntelliJ IDEA
Java Tutorial: Part 2. IntelliJ IDEA
Svetlin Nakov
 
Code Review
Code ReviewCode Review
Code Review
Lukas Rypl
 
Testing the untestable
Testing the untestableTesting the untestable
Testing the untestable
RoyKlein
 
PRG 420 Effective Communication - snaptutorial.com
PRG 420 Effective Communication - snaptutorial.comPRG 420 Effective Communication - snaptutorial.com
PRG 420 Effective Communication - snaptutorial.com
donaldzs37
 
Importance of the quality of code
Importance of the quality of codeImportance of the quality of code
Importance of the quality of code
Shwe Yee
 
Ensuring code quality
Ensuring code qualityEnsuring code quality
Ensuring code quality
MikhailVladimirov
 
Test driven developement
Test driven developementTest driven developement
Test driven developement
Bhavik Panchal
 
C# c# for beginners crash course master c# programming fast and easy today
C# c# for beginners crash course master c# programming fast and easy todayC# c# for beginners crash course master c# programming fast and easy today
C# c# for beginners crash course master c# programming fast and easy today
Afonso Macedo
 
Code Clone Detection in Visual Studio 2012
Code Clone Detection in Visual Studio 2012Code Clone Detection in Visual Studio 2012
Code Clone Detection in Visual Studio 2012
Suhail Jamaldeen
 
Java vs python comparison which programming language is right for my business
Java vs python comparison  which programming language is right for my business Java vs python comparison  which programming language is right for my business
Java vs python comparison which programming language is right for my business
Katy Slemon
 
.Net framework
.Net framework.Net framework
.Net framework
Raghu nath
 
Code Quality
Code QualityCode Quality
Code Quality
Stephen Rodgers
 
Code Review
Code ReviewCode Review
Code Review
Mikalai Alimenkou
 
Code quality
Code qualityCode quality
Code quality
saber tabatabaee
 

What's hot (20)

Top 50 .NET Interview Questions and Answers 2019 | Edureka
Top 50 .NET Interview Questions and Answers 2019 | EdurekaTop 50 .NET Interview Questions and Answers 2019 | Edureka
Top 50 .NET Interview Questions and Answers 2019 | Edureka
 
C# Interview Questions | Edureka
C# Interview Questions | EdurekaC# Interview Questions | Edureka
C# Interview Questions | Edureka
 
Code review best practice
Code review best practiceCode review best practice
Code review best practice
 
Let's Explore C# 6
Let's Explore C# 6Let's Explore C# 6
Let's Explore C# 6
 
Code generation
Code generationCode generation
Code generation
 
Code Review for iOS
Code Review for iOSCode Review for iOS
Code Review for iOS
 
Java Tutorial: Part 2. IntelliJ IDEA
Java Tutorial: Part 2. IntelliJ IDEAJava Tutorial: Part 2. IntelliJ IDEA
Java Tutorial: Part 2. IntelliJ IDEA
 
Code Review
Code ReviewCode Review
Code Review
 
Testing the untestable
Testing the untestableTesting the untestable
Testing the untestable
 
PRG 420 Effective Communication - snaptutorial.com
PRG 420 Effective Communication - snaptutorial.comPRG 420 Effective Communication - snaptutorial.com
PRG 420 Effective Communication - snaptutorial.com
 
Importance of the quality of code
Importance of the quality of codeImportance of the quality of code
Importance of the quality of code
 
Ensuring code quality
Ensuring code qualityEnsuring code quality
Ensuring code quality
 
Test driven developement
Test driven developementTest driven developement
Test driven developement
 
C# c# for beginners crash course master c# programming fast and easy today
C# c# for beginners crash course master c# programming fast and easy todayC# c# for beginners crash course master c# programming fast and easy today
C# c# for beginners crash course master c# programming fast and easy today
 
Code Clone Detection in Visual Studio 2012
Code Clone Detection in Visual Studio 2012Code Clone Detection in Visual Studio 2012
Code Clone Detection in Visual Studio 2012
 
Java vs python comparison which programming language is right for my business
Java vs python comparison  which programming language is right for my business Java vs python comparison  which programming language is right for my business
Java vs python comparison which programming language is right for my business
 
.Net framework
.Net framework.Net framework
.Net framework
 
Code Quality
Code QualityCode Quality
Code Quality
 
Code Review
Code ReviewCode Review
Code Review
 
Code quality
Code qualityCode quality
Code quality
 

Similar to What Do Developers Discuss about Code Comments?

Unit_5 and Unit 6.pptx
Unit_5 and Unit 6.pptxUnit_5 and Unit 6.pptx
Unit_5 and Unit 6.pptx
taxegap762
 
CodeInsight-SCAM2015
CodeInsight-SCAM2015CodeInsight-SCAM2015
CodeInsight-SCAM2015
Masud Rahman
 
Capability Building for Cyber Defense: Software Walk through and Screening
Capability Building for Cyber Defense: Software Walk through and Screening Capability Building for Cyber Defense: Software Walk through and Screening
Capability Building for Cyber Defense: Software Walk through and Screening
Maven Logix
 
Unit iv
Unit ivUnit iv
21. High-Quality Programming Code
21. High-Quality Programming Code21. High-Quality Programming Code
21. High-Quality Programming Code
Intro C# Book
 
SE2_Lec 18_ Coding
SE2_Lec 18_ CodingSE2_Lec 18_ Coding
SE2_Lec 18_ Coding
Amr E. Mohamed
 
Nascenia: Road to Software Industry
Nascenia: Road to Software IndustryNascenia: Road to Software Industry
Nascenia: Road to Software Industry
Nascenia IT
 
SE2018_Lec 17_ Coding
SE2018_Lec 17_ CodingSE2018_Lec 17_ Coding
SE2018_Lec 17_ Coding
Amr E. Mohamed
 
Documenting Code - Patterns and Anti-patterns - NLPW 2016
Documenting Code - Patterns and Anti-patterns - NLPW 2016Documenting Code - Patterns and Anti-patterns - NLPW 2016
Documenting Code - Patterns and Anti-patterns - NLPW 2016
Søren Lund
 
How Do I Refactor This? An Empirical Study on Refactoring Trends and Topics i...
How Do I Refactor This? An Empirical Study on Refactoring Trends and Topics i...How Do I Refactor This? An Empirical Study on Refactoring Trends and Topics i...
How Do I Refactor This? An Empirical Study on Refactoring Trends and Topics i...
University of Hawai‘i at Mānoa
 
Code Inspection
Code InspectionCode Inspection
Code Inspection
Fáber D. Giraldo
 
Code-Review-Principles-Process-and-Tools (1)
Code-Review-Principles-Process-and-Tools (1)Code-Review-Principles-Process-and-Tools (1)
Code-Review-Principles-Process-and-Tools (1)
Aditya Bhuyan
 
Content Strategy and Developer Engagement for DevPortals
Content Strategy and Developer Engagement for DevPortalsContent Strategy and Developer Engagement for DevPortals
Content Strategy and Developer Engagement for DevPortals
Axway
 
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
 
Documenting code yapceu2016
Documenting code yapceu2016Documenting code yapceu2016
Documenting code yapceu2016
Søren Lund
 
Aliaksei Skobeleu "Taking Control Over Code Metrics"
Aliaksei Skobeleu "Taking Control Over Code Metrics"Aliaksei Skobeleu "Taking Control Over Code Metrics"
Aliaksei Skobeleu "Taking Control Over Code Metrics"
LogeekNightUkraine
 
Api design best practice
Api design best practiceApi design best practice
Api design best practice
Red Hat
 
11. Lecture 19 Code standards and review.ppt
11. Lecture 19 Code standards and review.ppt11. Lecture 19 Code standards and review.ppt
11. Lecture 19 Code standards and review.ppt
MaddalaSeshu
 
Defensive programming
Defensive programmingDefensive programming
Defensive programming
Mark Reynolds
 
Coding Standard And Code Review
Coding Standard And Code ReviewCoding Standard And Code Review
Coding Standard And Code Review
Milan Vukoje
 

Similar to What Do Developers Discuss about Code Comments? (20)

Unit_5 and Unit 6.pptx
Unit_5 and Unit 6.pptxUnit_5 and Unit 6.pptx
Unit_5 and Unit 6.pptx
 
CodeInsight-SCAM2015
CodeInsight-SCAM2015CodeInsight-SCAM2015
CodeInsight-SCAM2015
 
Capability Building for Cyber Defense: Software Walk through and Screening
Capability Building for Cyber Defense: Software Walk through and Screening Capability Building for Cyber Defense: Software Walk through and Screening
Capability Building for Cyber Defense: Software Walk through and Screening
 
Unit iv
Unit ivUnit iv
Unit iv
 
21. High-Quality Programming Code
21. High-Quality Programming Code21. High-Quality Programming Code
21. High-Quality Programming Code
 
SE2_Lec 18_ Coding
SE2_Lec 18_ CodingSE2_Lec 18_ Coding
SE2_Lec 18_ Coding
 
Nascenia: Road to Software Industry
Nascenia: Road to Software IndustryNascenia: Road to Software Industry
Nascenia: Road to Software Industry
 
SE2018_Lec 17_ Coding
SE2018_Lec 17_ CodingSE2018_Lec 17_ Coding
SE2018_Lec 17_ Coding
 
Documenting Code - Patterns and Anti-patterns - NLPW 2016
Documenting Code - Patterns and Anti-patterns - NLPW 2016Documenting Code - Patterns and Anti-patterns - NLPW 2016
Documenting Code - Patterns and Anti-patterns - NLPW 2016
 
How Do I Refactor This? An Empirical Study on Refactoring Trends and Topics i...
How Do I Refactor This? An Empirical Study on Refactoring Trends and Topics i...How Do I Refactor This? An Empirical Study on Refactoring Trends and Topics i...
How Do I Refactor This? An Empirical Study on Refactoring Trends and Topics i...
 
Code Inspection
Code InspectionCode Inspection
Code Inspection
 
Code-Review-Principles-Process-and-Tools (1)
Code-Review-Principles-Process-and-Tools (1)Code-Review-Principles-Process-and-Tools (1)
Code-Review-Principles-Process-and-Tools (1)
 
Content Strategy and Developer Engagement for DevPortals
Content Strategy and Developer Engagement for DevPortalsContent Strategy and Developer Engagement for DevPortals
Content Strategy and Developer Engagement for DevPortals
 
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
 
Documenting code yapceu2016
Documenting code yapceu2016Documenting code yapceu2016
Documenting code yapceu2016
 
Aliaksei Skobeleu "Taking Control Over Code Metrics"
Aliaksei Skobeleu "Taking Control Over Code Metrics"Aliaksei Skobeleu "Taking Control Over Code Metrics"
Aliaksei Skobeleu "Taking Control Over Code Metrics"
 
Api design best practice
Api design best practiceApi design best practice
Api design best practice
 
11. Lecture 19 Code standards and review.ppt
11. Lecture 19 Code standards and review.ppt11. Lecture 19 Code standards and review.ppt
11. Lecture 19 Code standards and review.ppt
 
Defensive programming
Defensive programmingDefensive programming
Defensive programming
 
Coding Standard And Code Review
Coding Standard And Code ReviewCoding Standard And Code Review
Coding Standard And Code Review
 

Recently uploaded

Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
Kari Kakkonen
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems S.M.S.A.
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
Uni Systems S.M.S.A.
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
shyamraj55
 
Infrastructure Challenges in Scaling RAG with Custom AI models
Infrastructure Challenges in Scaling RAG with Custom AI modelsInfrastructure Challenges in Scaling RAG with Custom AI models
Infrastructure Challenges in Scaling RAG with Custom AI models
Zilliz
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
mikeeftimakis1
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
Adtran
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
Quotidiano Piemontese
 
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
 
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
Neo4j
 
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
Edge AI and Vision Alliance
 
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
 
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
 
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
Neo4j
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
Matthew Sinclair
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
Matthew Sinclair
 
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
Neo4j
 
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
Neo4j
 
UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
DianaGray10
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc
 

Recently uploaded (20)

Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
 
Infrastructure Challenges in Scaling RAG with Custom AI models
Infrastructure Challenges in Scaling RAG with Custom AI modelsInfrastructure Challenges in Scaling RAG with Custom AI models
Infrastructure Challenges in Scaling RAG with Custom AI models
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
 
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
 
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
 
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
 
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
 
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
 
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
 
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
 
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
 
UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
 

What Do Developers Discuss about Code Comments?

  • 1. What do Developers Discuss about Code Comments? Pooja Rani, Mathias Birrer, Sebastiano Panichella Mohammad Ghafari, Oscar Nierstrasz University of Bern, Switzerland
  • 2. Code Comment 2 /** Event fired when a spacer element is hidden or shown in Escalator * * @author Vaadin Ltd * @since 7.7.13 */ public class SpacerVisibility { System.out.println(..); } Developers use comments to understand and maintain code.
  • 3. Code Comment • Style & Syntax is not enforced by complier • Different conventions for Languages, Companies, Projects, Developers • Confusion amongst developers 3
  • 4. Planning Implementation Testing Releasing Maintenance Internal Sources External Sources Developers' Information Needs 4
  • 5. What Do Developers Discuss about Code Comments? 5
  • 6. 6 Code comment questions What Do Developers Discuss about Code Comments?
  • 7. 7 Code comment questions Code comments High-level topics RQ1 What Do Developers Discuss about Code Comments?
  • 8. 8 Code comment questions Types of questions Code comments High-level topics RQ1 RQ2 What Do Developers Discuss about Code Comments?
  • 9. 9 Code comment questions Types of questions Recommendations Information needs Code comments High-level topics RQ1 RQ2 RQ3 RQ4 What Do Developers Discuss about Code Comments?
  • 10. 12 What Do Developers Discuss about Code Comments?
  • 11. 13 What Do Developers Discuss about Code Comments?
  • 12. 15 What high-level topics do developers discuss? Code comments Code comments High-level topics RQ1
  • 13. # Topic Name 1 Syntax & Format 2 IDEs & Editors 3 R Documentation 4 Code Conventions 5 Developing frameworks for thread commenting 6 Open-source software 7 Documentation generation 8 Thread comments in web-sites 9 Naming conventions & data types 10 Seeking documentation & learning language 18 LDA Topic modelling Expected topics like “Documentation Generation” or “Syntax & Format” were successfully identified by LDA.
  • 14. # Topic Name 1 Syntax & Format 2 IDEs & Editors 3 R Documentation 4 Code Conventions 5 Developing frameworks for thread commenting 6 Open-source software 7 Documentation generation 8 Thread comments in web-sites 9 Naming conventions & data types 10 Seeking documentation & learning language 19 LDA Topics: Irrelevant Topics ‘Comment’ term is used in various environment
  • 15. 22 What Do Developers Discuss about “Code Comment”? Code comments Types of questions Recommendations Information needs RQ2 RQ3 RQ4
  • 16. 23 What Do Developers Discuss about “Code Comment”? Code comments Types of questions RQ2
  • 17. RQ2: Types of questions 25 First Dimension Implementation strategies Implementation problems Error Limitation & Possibilities Background Information Best Practice Opinion How to use @value tag in Javadoc The command does not work Contains an error message from the exception Is there a keyboard shortcut for block comments? Why is # usually introduces a comment? What is the proper way to reference a element in Android comments? Are comments in code a good or bad thing?
  • 18. 26 0% 5% 10% 15% 20% 25% 30% 35% 40% Implementation Strategies Best practice Background Information Limitation & Possibilites Implementation Problems Opinion Error % of Question Types Stack overflow Quora RQ2: Types of questions Developers prefer different sources to know different aspects of comments
  • 19. RQ3: Developer Information Needs 30 Second Dimension - Level 2 Syntax & format Asking for features Using features Maintain comments Understand documentation Process comments Change comment template ........
  • 20. 32 Comment-conventions Programming Languages Tools IDEs & Editors Other Add comments Versioning comments Comments example Grammar rules Maintain comments Syntax & format Other Asking for features Change comment template Error Process comments Report bug Setup Syntax & format Using Feature Asking for features Shortcut Process comments Using feature Tool setup Change comment template Syntax & format Adopt other language style Asking for feature Asking tool existence Change comment template Understand documentation Using features Process comments Syntax & format Display comments Add tags Add comments Blocks/Multiline comments Inline comments Add comments Formatting Color scheme Render documentation Detect undocumented code files Detect todo comments Highlight comments Add more information in comments Generate API documentation Directives Generate documentation Lint Add tags Class comments Function comments Project documentation Other Show comments Synchronize code comment changes Mulit-lingual comments Add more information Add comments Show inherited comments Add media Generate documentation Tags Function Class Project Other Function comment Class comment Project comment Block/ Multiline Other Inline comments Comment Highlevels Categories found in both sources (SO and Quora) Categories found on SO Categories found on Quora RQ3: Developer Information Needs
  • 21. Syntax & format 33 Increasing efforts and trend towards Function (API) documentation
  • 22. 36 1.1 2.2 2.2 3.2 3.2 3.2 4.3 4.3 5.4 5.4 7.5 9.7 11.8 14 22.6 0 % 5 % 10 % 15 % 20 % 25 % Show inherited methods comments Detect Todo comments Detect undocumented code files Color scheme Highlight comments Synchronize Code comment changes Ask for documentation Multi-lingual comments Add comments Render Documentation Other Show comments Add media Generate documentation Add more information % of Posts Asking for a Feature Feautres Developer Ask Developers are interesting in adding various information types in comments such as how to add images, examples in comments Asking for features
  • 23. RQ4: Recommendations 37 [.net] long inline comments should start with a capital letter and end with a period. [general] Use correct notation to write block or multiline comments. We identified 40 comment conventions that developers recommend on these platforms
  • 24. Findings relevant for developers and researchers Implication
  • 25. Implications 40 Need of automated style checkers Some languages do not support automated style checkers Adherence of comments to the conventions To what extent developers follow commenting conventions Tools to assess comment quality Developers look for automated tools to assess the quality of their comments Ease of finding commenting guidelines Developers face problems in locating conventions
  • 26. Future Work • Investigate more sources (e.g. GitHub, Jira, Mailing lists) • Survey developers to know which concerns are more important than others • Verifying the tool support to assess code comments 41
  • 27. What do Developers Discuss about Code Comments? • Preprint on Arxiv https://arxiv.org/abs/2108.07648 • Video on YouTube https://youtu.be/EUQINZ38ziU • Replication Package on Zenodo https://doi.org/10.5281/zenodo.5044270 42 http://scg.unibe.ch/staff Contact us https://twitter.com/poojaruhal