SlideShare una empresa de Scribd logo
1 de 36
Descargar para leer sin conexión
Can We Automatically Generate Class
Comments in Pharo?
Pooja Rani, Alexandre Bergel, 

Lino Hess, Timo Kehrer, Oscar Nierstrasz
University of Bern, Switzerland
 
International Workshop on Smalltalk Technologies,


Novi Sad, Serbia, 2022
2
3
High-quality code comments assist developers
4
Developers find writing comments a boring and effort-intensive task
5
To support developers in writing comments,
communities suggest coding guidelines
Apache
Oracle
Google Pharo
PEP8/257
6
To support developers in writing comments,
communities suggest coding guidelines
Apache
Oracle
Google Pharo
PEP8/257
7
To support developers in writing comments,
communities suggest coding guidelines
Apache
Oracle
Google Pharo
PEP8/257
8
To support developers in writing comments,
communities suggest coding guidelines
Apache
Oracle
Google Pharo
PEP8/257
9
- Rani et al., Empirical Software Engineering, 2021
Developers follow template inspired information types more often
To support developers in writing comments,
communities suggest coding guidelines
Apache
Oracle
Google Pharo
PEP8/257
10
Color scale according to number of comments falling into a category
0 25 52
0 26 52
1 (52)
2 (52)
3 (52)
4 (52)
5 (52)
6 (52)
7 (52)
O
t
h
e
r
L
i
c
e
n
s
e
D
e
p
e
n
d
e
n
c
i
e
s
C
o
n
t
r
a
c
t
s
O
b
s
e
r
v
a
t
i
o
n
s
R
e
c
o
m
m
e
n
d
a
t
i
o
n
s
E
x
t
e
n
s
i
o
s
L
i
n
k
s
D
i
s
c
o
u
r
s
e
W
a
r
n
i
n
g
s
C
o
d
i
n
g
G
u
i
d
e
l
i
n
e
s
N
a
m
i
n
g
C
o
n
v
e
n
t
i
o
n
s
T
o
d
o
c
o
m
m
e
n
t
s
C
l
a
s
s
R
e
f
e
r
e
n
c
e
s
S
u
b
c
l
a
s
s
e
s
E
x
p
l
a
n
a
t
i
o
n
R
e
f
e
r
e
n
c
e
O
t
h
e
r
R
e
s
o
u
r
c
e
s
I
m
p
l
e
m
e
n
t
a
t
i
o
n
P
o
i
n
t
s
E
x
a
m
p
l
e
s
K
e
y
M
e
s
s
a
g
e
s
I
n
s
t
a
n
c
e
V
a
r
i
a
b
l
e
s
C
o
l
l
a
b
a
r
t
o
r
s
R
e
s
p
o
n
s
i
b
i
l
i
t
y
I
n
t
e
n
t
Categories
Pharo
versions
(total
classes)
Developers follow template inspired information types more often
- Rani et al., Empirical Software Engineering, 2021
11
Can we automatically generate these information types?
Color scale according to number of comments falling into a category
0 25 52
0 26 52
1 (52)
2 (52)
3 (52)
4 (52)
5 (52)
6 (52)
7 (52)
O
t
h
e
r
L
i
c
e
n
s
e
D
e
p
e
n
d
e
n
c
i
e
s
C
o
n
t
r
a
c
t
s
O
b
s
e
r
v
a
t
i
o
n
s
R
e
c
o
m
m
e
n
d
a
t
i
o
n
s
E
x
t
e
n
s
i
o
s
L
i
n
k
s
D
i
s
c
o
u
r
s
e
W
a
r
n
i
n
g
s
C
o
d
i
n
g
G
u
i
d
e
l
i
n
e
s
N
a
m
i
n
g
C
o
n
v
e
n
t
i
o
n
s
T
o
d
o
c
o
m
m
e
n
t
s
C
l
a
s
s
R
e
f
e
r
e
n
c
e
s
S
u
b
c
l
a
s
s
e
s
E
x
p
l
a
n
a
t
i
o
n
R
e
f
e
r
e
n
c
e
O
t
h
e
r
R
e
s
o
u
r
c
e
s
I
m
p
l
e
m
e
n
t
a
t
i
o
n
P
o
i
n
t
s
E
x
a
m
p
l
e
s
K
e
y
M
e
s
s
a
g
e
s
I
n
s
t
a
n
c
e
V
a
r
i
a
b
l
e
s
C
o
l
l
a
b
a
r
t
o
r
s
R
e
s
p
o
n
s
i
b
i
l
i
t
y
I
n
t
e
n
t
Categories
Pharo
versions
(total
classes)
12
Objects are responsible members of an
object community
Rebecca Wirfs-Brock
Object role stereotypes in 1992 in a Smalltalk Report article
13
Objects are responsible members of an
object community
Rebecca Wirfs-Brock
Object role stereotypes in 1992 in a Smalltalk Report article
14
Controller
Coordinator
Structure
Interface
Information holder
Objects are responsible members of an
object community
Rebecca Wirfs-Brock
Object role stereotypes in 1992 in a Smalltalk Report article
15
Controller
Coordinator
Structure
Interface
Information holder
Objects are responsible members of an
object community
Object role stereotypes in 1992 in a Smalltalk Report article
Stereotype-based approach
16
Previous works
17
Previous works
18
Previous works
19
Previous works
20
Methodology Dataset
Can We Automatically Generate Class Comments in
Pharo?
Previous works
21
Methodology
Identify


class stereotype
Identify method
stereotypes
Pharo 8 Extract


method information
Extract


class


information
Fill


template
1 2 3 4 5
22
• Accessor
• Getter
• Mutator
• Setter
• Creational
• Collaborator
• Degnerate
• Controller
Method Stereotypes
1
23
4%
4%
4%
5%
10%
16%
28%
33%
Set
Get
Controller
Creational
Mutator
Degenerate
Collaborator
Accessor
Distribution of Stereotypes
• Accessor
• Getter
• Mutator
• Setter
• Creational
• Collaborator
• Degnerate
• Controller
Method Stereotypes
1
24
• Entity
• Minimal Entity
• Data Provider
• Commander
• Boundary
• Factory
• Empty
• Small
• Controller
• Pure Controller
• Large
• Lazy
• Degenerate
• Data
Class Stereotypes
2
4%
4%
4%
5%
10%
16%
28%
33%
Set
Get
Controller
Creational
Mutator
Degenerate
Collaborator
Accessor
• Accessor
• Getter
• Mutator
• Setter
• Creational
• Collaborator
• Degnerate
• Controller
Method Stereotypes
1
Distribution of Stereotypes
25
0%
1%
2%
2%
2%
2%
2%
3%
5%
6%
7%
9%
23%
42%
PureController
Lazy
Controller
Data
Entity
Factory
MinimalEntity
Empty
Commander
Small
Large
Degenerate
Boundary
DataProvider
4%
4%
4%
5%
10%
16%
28%
33%
Set
Get
Controller
Creational
Mutator
Degenerate
Collaborator
Accessor
• Entity
• Minimal Entity
• Data Provider
• Commander
• Boundary
• Factory
• Empty
• Small
• Controller
• Pure Controller
• Large
• Lazy
• Degenerate
• Data
Class Stereotypes
2
• Accessor
• Getter
• Mutator
• Setter
• Creational
• Collaborator
• Degnerate
• Controller
Method Stereotypes
1
Distribution of Stereotypes
26
• Entity
• Minimal Entity
• Data Provider
• Commander
• Boundary
• Factory
• Empty
• Small
• Controller
• Pure Controller
• Large
• Lazy
• Degenerate
• Data
Class Stereotypes
2
• Accessor
• Getter
• Mutator
• Setter
• Creational
• Collaborator
• Degnerate
• Controller
Method Stereotypes
1
27
Small
Controller
Pure Controller
Large
Lazy
Degenerate
Data
otypes
reational
ollaborator
egnerate
ontroller
eotypes
28
• External used methods
• Internally used methods
Method Information
3
• Class name
• Class stereotype description
• Classes used by the class
• Dependent classes
• Relevant keywords
Class Information
4
Small
Controller
Pure Controller
Large
Lazy
Degenerate
Data
otypes
reational
ollaborator
egnerate
ontroller
eotypes
29
• External used methods
• Internally used methods
Method Information
3
• Class name
• Class stereotype description
• Classes used by the class
• Dependent classes
• Relevant keywords
Class Information
4
Small
Controller
Pure Controller
Large
Lazy
Degenerate
Data
otypes
reational
ollaborator
egnerate
ontroller
eotypes
30
• External used methods
• Internally used methods
Method Information
3
• Class name
• Class stereotype description
• Classes used by the class
• Dependent classes
• Relevant keywords
Class Information
4
Small
Controller
Pure Controller
Large
Lazy
Degenerate
Data
otypes
reational
ollaborator
egnerate
ontroller
eotypes
31
24 class comments (auto generated)
3 developers: each comment evaluated by three
42 evaluations: 7 developers completed it
3 metrics: Adequacy, Conciseness, Comprehensibility
Evaluation
32
Evaluation
Adequacy: 44% participants said the comment is missing some important information
33
Conciseness- 54% participants said the comment contains a lot of
unnecessary information
Evaluation
Adequacy: 44% participants said the comment is missing some important information
Can We Automatically Generate Class Comments in Pharo?
Can We Automatically Generate Class Comments in Pharo?
Can We Automatically Generate Class Comments in Pharo?

Más contenido relacionado

Similar a Can We Automatically Generate Class Comments in Pharo?

Tool Up Your LAMP Stack
Tool Up Your LAMP StackTool Up Your LAMP Stack
Tool Up Your LAMP StackLorna Mitchell
 
Characterizing Defective Configuration Scripts Used for Continuous Deployment
Characterizing Defective Configuration Scripts Used for Continuous DeploymentCharacterizing Defective Configuration Scripts Used for Continuous Deployment
Characterizing Defective Configuration Scripts Used for Continuous DeploymentAkond Rahman
 
Importance of Solution Architecture in Automation
Importance of Solution Architecture in AutomationImportance of Solution Architecture in Automation
Importance of Solution Architecture in AutomationCristina Vidu
 
How To Use Selenium Successfully (Java Edition)
How To Use Selenium Successfully (Java Edition)How To Use Selenium Successfully (Java Edition)
How To Use Selenium Successfully (Java Edition)Dave Haeffner
 
Reproducible Research: how could Research Objects help
Reproducible Research: how could Research Objects helpReproducible Research: how could Research Objects help
Reproducible Research: how could Research Objects helpCarole Goble
 
Boost developer productivity with EE, MP and OL (Devoxx Ukraine 22).pptx
Boost developer productivity with EE, MP and OL (Devoxx Ukraine 22).pptxBoost developer productivity with EE, MP and OL (Devoxx Ukraine 22).pptx
Boost developer productivity with EE, MP and OL (Devoxx Ukraine 22).pptxGrace Jansen
 
Heterogeneous Workflows With Spark At Netflix
Heterogeneous Workflows With Spark At NetflixHeterogeneous Workflows With Spark At Netflix
Heterogeneous Workflows With Spark At NetflixJen Aman
 
How Do You Know that Gal Knows Drupal? Towards an Open Source Curriculum and ...
How Do You Know that Gal Knows Drupal? Towards an Open Source Curriculum and ...How Do You Know that Gal Knows Drupal? Towards an Open Source Curriculum and ...
How Do You Know that Gal Knows Drupal? Towards an Open Source Curriculum and ...Dominik Lukes
 
Using HPC Resources to Exploit Big Data for Code Review Analytics
Using HPC Resources to Exploit Big Data for Code Review AnalyticsUsing HPC Resources to Exploit Big Data for Code Review Analytics
Using HPC Resources to Exploit Big Data for Code Review AnalyticsThe University of Adelaide
 
SUGCON 2015 Modelling
SUGCON 2015 ModellingSUGCON 2015 Modelling
SUGCON 2015 ModellingGlasslu
 
Owasp Eu Summit 2008 Owasp Testing Guide V3
Owasp Eu Summit 2008 Owasp Testing Guide V3Owasp Eu Summit 2008 Owasp Testing Guide V3
Owasp Eu Summit 2008 Owasp Testing Guide V3Matteo Meucci
 
UKSG webinar: Authentication technology update: RA21 and OpenAthens with Josh...
UKSG webinar: Authentication technology update: RA21 and OpenAthens with Josh...UKSG webinar: Authentication technology update: RA21 and OpenAthens with Josh...
UKSG webinar: Authentication technology update: RA21 and OpenAthens with Josh...UKSG: connecting the knowledge community
 
Cloud and Network Transformation using DevOps methodology : Cisco Live 2015
Cloud and Network Transformation using DevOps methodology : Cisco Live 2015Cloud and Network Transformation using DevOps methodology : Cisco Live 2015
Cloud and Network Transformation using DevOps methodology : Cisco Live 2015Vimal Suba
 
DataONE_Guided Metadata Improvement
DataONE_Guided Metadata ImprovementDataONE_Guided Metadata Improvement
DataONE_Guided Metadata ImprovementLindsay Powers
 
CI-CD Jenkins, GitHub Actions, Tekton
CI-CD Jenkins, GitHub Actions, Tekton CI-CD Jenkins, GitHub Actions, Tekton
CI-CD Jenkins, GitHub Actions, Tekton Araf Karsh Hamid
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesKari Kakkonen
 

Similar a Can We Automatically Generate Class Comments in Pharo? (20)

Tool Up Your LAMP Stack
Tool Up Your LAMP StackTool Up Your LAMP Stack
Tool Up Your LAMP Stack
 
Characterizing Defective Configuration Scripts Used for Continuous Deployment
Characterizing Defective Configuration Scripts Used for Continuous DeploymentCharacterizing Defective Configuration Scripts Used for Continuous Deployment
Characterizing Defective Configuration Scripts Used for Continuous Deployment
 
Importance of Solution Architecture in Automation
Importance of Solution Architecture in AutomationImportance of Solution Architecture in Automation
Importance of Solution Architecture in Automation
 
How To Use Selenium Successfully (Java Edition)
How To Use Selenium Successfully (Java Edition)How To Use Selenium Successfully (Java Edition)
How To Use Selenium Successfully (Java Edition)
 
Reproducible Research: how could Research Objects help
Reproducible Research: how could Research Objects helpReproducible Research: how could Research Objects help
Reproducible Research: how could Research Objects help
 
Boost developer productivity with EE, MP and OL (Devoxx Ukraine 22).pptx
Boost developer productivity with EE, MP and OL (Devoxx Ukraine 22).pptxBoost developer productivity with EE, MP and OL (Devoxx Ukraine 22).pptx
Boost developer productivity with EE, MP and OL (Devoxx Ukraine 22).pptx
 
Heterogeneous Workflows With Spark At Netflix
Heterogeneous Workflows With Spark At NetflixHeterogeneous Workflows With Spark At Netflix
Heterogeneous Workflows With Spark At Netflix
 
How Do You Know that Gal Knows Drupal? Towards an Open Source Curriculum and ...
How Do You Know that Gal Knows Drupal? Towards an Open Source Curriculum and ...How Do You Know that Gal Knows Drupal? Towards an Open Source Curriculum and ...
How Do You Know that Gal Knows Drupal? Towards an Open Source Curriculum and ...
 
RA21: An Update on RA21
RA21: An Update on RA21RA21: An Update on RA21
RA21: An Update on RA21
 
Using HPC Resources to Exploit Big Data for Code Review Analytics
Using HPC Resources to Exploit Big Data for Code Review AnalyticsUsing HPC Resources to Exploit Big Data for Code Review Analytics
Using HPC Resources to Exploit Big Data for Code Review Analytics
 
Rails tools
Rails toolsRails tools
Rails tools
 
SUGCON 2015 Modelling
SUGCON 2015 ModellingSUGCON 2015 Modelling
SUGCON 2015 Modelling
 
OWASP Testing Guide v3
OWASP Testing Guide v3OWASP Testing Guide v3
OWASP Testing Guide v3
 
Owasp Eu Summit 2008 Owasp Testing Guide V3
Owasp Eu Summit 2008 Owasp Testing Guide V3Owasp Eu Summit 2008 Owasp Testing Guide V3
Owasp Eu Summit 2008 Owasp Testing Guide V3
 
UKSG webinar: Authentication technology update: RA21 and OpenAthens with Josh...
UKSG webinar: Authentication technology update: RA21 and OpenAthens with Josh...UKSG webinar: Authentication technology update: RA21 and OpenAthens with Josh...
UKSG webinar: Authentication technology update: RA21 and OpenAthens with Josh...
 
Cloud and Network Transformation using DevOps methodology : Cisco Live 2015
Cloud and Network Transformation using DevOps methodology : Cisco Live 2015Cloud and Network Transformation using DevOps methodology : Cisco Live 2015
Cloud and Network Transformation using DevOps methodology : Cisco Live 2015
 
10 Ways To Improve Your Code
10 Ways To Improve Your Code10 Ways To Improve Your Code
10 Ways To Improve Your Code
 
DataONE_Guided Metadata Improvement
DataONE_Guided Metadata ImprovementDataONE_Guided Metadata Improvement
DataONE_Guided Metadata Improvement
 
CI-CD Jenkins, GitHub Actions, Tekton
CI-CD Jenkins, GitHub Actions, Tekton CI-CD Jenkins, GitHub Actions, Tekton
CI-CD Jenkins, GitHub Actions, Tekton
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examples
 

Más de 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 StudyPooja Rani
 
A Decade of Comment Quality Assessment: A Systematic Literature Review
A Decade of Comment Quality Assessment: A Systematic Literature ReviewA Decade of Comment Quality Assessment: A Systematic Literature Review
A Decade of Comment Quality Assessment: A Systematic Literature ReviewPooja 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
 
How to Identify Class Comment Types? A Multi-language Approach for Class Com...
How to Identify Class Comment Types?  A Multi-language Approach for Class Com...How to Identify Class Comment Types?  A Multi-language Approach for Class Com...
How to Identify Class Comment Types? A Multi-language Approach for Class Com...Pooja Rani
 
PhD defense presenation
PhD defense presenationPhD defense presenation
PhD defense presenationPooja Rani
 
Speculative analysis for comment quality assessment
Speculative analysis for comment quality assessmentSpeculative analysis for comment quality assessment
Speculative analysis for comment quality assessmentPooja Rani
 
Let linguistics guide software analysis
Let linguistics guide software analysisLet linguistics guide software analysis
Let linguistics guide software analysisPooja 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 typesPooja Rani
 
Software Analysis using Natural Language Queries
Software Analysis using Natural Language QueriesSoftware Analysis using Natural Language Queries
Software Analysis using Natural Language QueriesPooja Rani
 

Más de Pooja Rani (9)

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
 
A Decade of Comment Quality Assessment: A Systematic Literature Review
A Decade of Comment Quality Assessment: A Systematic Literature ReviewA Decade of Comment Quality Assessment: A Systematic Literature Review
A Decade of Comment Quality Assessment: A Systematic Literature Review
 
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...
 
How to Identify Class Comment Types? A Multi-language Approach for Class Com...
How to Identify Class Comment Types?  A Multi-language Approach for Class Com...How to Identify Class Comment Types?  A Multi-language Approach for Class Com...
How to Identify Class Comment Types? A Multi-language Approach for Class Com...
 
PhD defense presenation
PhD defense presenationPhD defense presenation
PhD defense presenation
 
Speculative analysis for comment quality assessment
Speculative analysis for comment quality assessmentSpeculative analysis for comment quality assessment
Speculative analysis for comment quality assessment
 
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
 

Último

chapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineeringchapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineeringmulugeta48
 
Block diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.pptBlock diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.pptNANDHAKUMARA10
 
Thermal Engineering Unit - I & II . ppt
Thermal Engineering  Unit - I & II . pptThermal Engineering  Unit - I & II . ppt
Thermal Engineering Unit - I & II . pptDineshKumar4165
 
Design For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startDesign For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startQuintin Balsdon
 
Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayEpec Engineered Technologies
 
notes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptnotes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptMsecMca
 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptDineshKumar4165
 
Employee leave management system project.
Employee leave management system project.Employee leave management system project.
Employee leave management system project.Kamal Acharya
 
Thermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VThermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VDineshKumar4165
 
Minimum and Maximum Modes of microprocessor 8086
Minimum and Maximum Modes of microprocessor 8086Minimum and Maximum Modes of microprocessor 8086
Minimum and Maximum Modes of microprocessor 8086anil_gaur
 
Hostel management system project report..pdf
Hostel management system project report..pdfHostel management system project report..pdf
Hostel management system project report..pdfKamal Acharya
 
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfKamal Acharya
 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756dollysharma2066
 
Bhosari ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready For ...
Bhosari ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready For ...Bhosari ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready For ...
Bhosari ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready For ...tanu pandey
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXssuser89054b
 
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night StandCall Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Standamitlee9823
 
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...SUHANI PANDEY
 

Último (20)

chapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineeringchapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineering
 
Block diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.pptBlock diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.ppt
 
Thermal Engineering Unit - I & II . ppt
Thermal Engineering  Unit - I & II . pptThermal Engineering  Unit - I & II . ppt
Thermal Engineering Unit - I & II . ppt
 
Design For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startDesign For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the start
 
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced LoadsFEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
 
Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power Play
 
notes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptnotes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.ppt
 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.ppt
 
Employee leave management system project.
Employee leave management system project.Employee leave management system project.
Employee leave management system project.
 
Thermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VThermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - V
 
Minimum and Maximum Modes of microprocessor 8086
Minimum and Maximum Modes of microprocessor 8086Minimum and Maximum Modes of microprocessor 8086
Minimum and Maximum Modes of microprocessor 8086
 
Hostel management system project report..pdf
Hostel management system project report..pdfHostel management system project report..pdf
Hostel management system project report..pdf
 
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
 
Bhosari ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready For ...
Bhosari ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready For ...Bhosari ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready For ...
Bhosari ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready For ...
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
 
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night StandCall Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
 
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
 
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
 
Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024
 

Can We Automatically Generate Class Comments in Pharo?

  • 1. Can We Automatically Generate Class Comments in Pharo? Pooja Rani, Alexandre Bergel, Lino Hess, Timo Kehrer, Oscar Nierstrasz University of Bern, Switzerland   International Workshop on Smalltalk Technologies, Novi Sad, Serbia, 2022
  • 2. 2
  • 3. 3 High-quality code comments assist developers
  • 4. 4 Developers find writing comments a boring and effort-intensive task
  • 5. 5 To support developers in writing comments, communities suggest coding guidelines Apache Oracle Google Pharo PEP8/257
  • 6. 6 To support developers in writing comments, communities suggest coding guidelines Apache Oracle Google Pharo PEP8/257
  • 7. 7 To support developers in writing comments, communities suggest coding guidelines Apache Oracle Google Pharo PEP8/257
  • 8. 8 To support developers in writing comments, communities suggest coding guidelines Apache Oracle Google Pharo PEP8/257
  • 9. 9 - Rani et al., Empirical Software Engineering, 2021 Developers follow template inspired information types more often To support developers in writing comments, communities suggest coding guidelines Apache Oracle Google Pharo PEP8/257
  • 10. 10 Color scale according to number of comments falling into a category 0 25 52 0 26 52 1 (52) 2 (52) 3 (52) 4 (52) 5 (52) 6 (52) 7 (52) O t h e r L i c e n s e D e p e n d e n c i e s C o n t r a c t s O b s e r v a t i o n s R e c o m m e n d a t i o n s E x t e n s i o s L i n k s D i s c o u r s e W a r n i n g s C o d i n g G u i d e l i n e s N a m i n g C o n v e n t i o n s T o d o c o m m e n t s C l a s s R e f e r e n c e s S u b c l a s s e s E x p l a n a t i o n R e f e r e n c e O t h e r R e s o u r c e s I m p l e m e n t a t i o n P o i n t s E x a m p l e s K e y M e s s a g e s I n s t a n c e V a r i a b l e s C o l l a b a r t o r s R e s p o n s i b i l i t y I n t e n t Categories Pharo versions (total classes) Developers follow template inspired information types more often - Rani et al., Empirical Software Engineering, 2021
  • 11. 11 Can we automatically generate these information types? Color scale according to number of comments falling into a category 0 25 52 0 26 52 1 (52) 2 (52) 3 (52) 4 (52) 5 (52) 6 (52) 7 (52) O t h e r L i c e n s e D e p e n d e n c i e s C o n t r a c t s O b s e r v a t i o n s R e c o m m e n d a t i o n s E x t e n s i o s L i n k s D i s c o u r s e W a r n i n g s C o d i n g G u i d e l i n e s N a m i n g C o n v e n t i o n s T o d o c o m m e n t s C l a s s R e f e r e n c e s S u b c l a s s e s E x p l a n a t i o n R e f e r e n c e O t h e r R e s o u r c e s I m p l e m e n t a t i o n P o i n t s E x a m p l e s K e y M e s s a g e s I n s t a n c e V a r i a b l e s C o l l a b a r t o r s R e s p o n s i b i l i t y I n t e n t Categories Pharo versions (total classes)
  • 12. 12 Objects are responsible members of an object community Rebecca Wirfs-Brock Object role stereotypes in 1992 in a Smalltalk Report article
  • 13. 13 Objects are responsible members of an object community Rebecca Wirfs-Brock Object role stereotypes in 1992 in a Smalltalk Report article
  • 14. 14 Controller Coordinator Structure Interface Information holder Objects are responsible members of an object community Rebecca Wirfs-Brock Object role stereotypes in 1992 in a Smalltalk Report article
  • 15. 15 Controller Coordinator Structure Interface Information holder Objects are responsible members of an object community Object role stereotypes in 1992 in a Smalltalk Report article Stereotype-based approach
  • 20. 20 Methodology Dataset Can We Automatically Generate Class Comments in Pharo? Previous works
  • 21. 21 Methodology Identify class stereotype Identify method stereotypes Pharo 8 Extract method information Extract class information Fill template 1 2 3 4 5
  • 22. 22 • Accessor • Getter • Mutator • Setter • Creational • Collaborator • Degnerate • Controller Method Stereotypes 1
  • 23. 23 4% 4% 4% 5% 10% 16% 28% 33% Set Get Controller Creational Mutator Degenerate Collaborator Accessor Distribution of Stereotypes • Accessor • Getter • Mutator • Setter • Creational • Collaborator • Degnerate • Controller Method Stereotypes 1
  • 24. 24 • Entity • Minimal Entity • Data Provider • Commander • Boundary • Factory • Empty • Small • Controller • Pure Controller • Large • Lazy • Degenerate • Data Class Stereotypes 2 4% 4% 4% 5% 10% 16% 28% 33% Set Get Controller Creational Mutator Degenerate Collaborator Accessor • Accessor • Getter • Mutator • Setter • Creational • Collaborator • Degnerate • Controller Method Stereotypes 1 Distribution of Stereotypes
  • 25. 25 0% 1% 2% 2% 2% 2% 2% 3% 5% 6% 7% 9% 23% 42% PureController Lazy Controller Data Entity Factory MinimalEntity Empty Commander Small Large Degenerate Boundary DataProvider 4% 4% 4% 5% 10% 16% 28% 33% Set Get Controller Creational Mutator Degenerate Collaborator Accessor • Entity • Minimal Entity • Data Provider • Commander • Boundary • Factory • Empty • Small • Controller • Pure Controller • Large • Lazy • Degenerate • Data Class Stereotypes 2 • Accessor • Getter • Mutator • Setter • Creational • Collaborator • Degnerate • Controller Method Stereotypes 1 Distribution of Stereotypes
  • 26. 26 • Entity • Minimal Entity • Data Provider • Commander • Boundary • Factory • Empty • Small • Controller • Pure Controller • Large • Lazy • Degenerate • Data Class Stereotypes 2 • Accessor • Getter • Mutator • Setter • Creational • Collaborator • Degnerate • Controller Method Stereotypes 1
  • 28. 28 • External used methods • Internally used methods Method Information 3 • Class name • Class stereotype description • Classes used by the class • Dependent classes • Relevant keywords Class Information 4 Small Controller Pure Controller Large Lazy Degenerate Data otypes reational ollaborator egnerate ontroller eotypes
  • 29. 29 • External used methods • Internally used methods Method Information 3 • Class name • Class stereotype description • Classes used by the class • Dependent classes • Relevant keywords Class Information 4 Small Controller Pure Controller Large Lazy Degenerate Data otypes reational ollaborator egnerate ontroller eotypes
  • 30. 30 • External used methods • Internally used methods Method Information 3 • Class name • Class stereotype description • Classes used by the class • Dependent classes • Relevant keywords Class Information 4 Small Controller Pure Controller Large Lazy Degenerate Data otypes reational ollaborator egnerate ontroller eotypes
  • 31. 31 24 class comments (auto generated) 3 developers: each comment evaluated by three 42 evaluations: 7 developers completed it 3 metrics: Adequacy, Conciseness, Comprehensibility Evaluation
  • 32. 32 Evaluation Adequacy: 44% participants said the comment is missing some important information
  • 33. 33 Conciseness- 54% participants said the comment contains a lot of unnecessary information Evaluation Adequacy: 44% participants said the comment is missing some important information