SlideShare a Scribd company logo
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?

More Related Content

Similar to Can We Automatically Generate Class Comments in Pharo?

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
 
We’re All UX: Designing a Whole Company Design Team - Giant Conf 2014
We’re All UX:  Designing a Whole Company Design Team - Giant Conf 2014We’re All UX:  Designing a Whole Company Design Team - Giant Conf 2014
We’re All UX: Designing a Whole Company Design Team - Giant Conf 2014Phillip Hunter
 
Importance of Solution Architecture in Automation
Importance of Solution Architecture in AutomationImportance of Solution Architecture in Automation
Importance of Solution Architecture in Automation
Cristina 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
 
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
Vimal Suba
 
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
Carole Goble
 
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
Akond Rahman
 
EPS Workshop JFall - 1.0
EPS Workshop JFall - 1.0EPS Workshop JFall - 1.0
EPS Workshop JFall - 1.0
Rick Ossendrijver
 
SUGCON 2015 Modelling
SUGCON 2015 ModellingSUGCON 2015 Modelling
SUGCON 2015 Modelling
Glasslu
 
Rails tools
Rails toolsRails tools
Rails tools
Reuven Lerner
 
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
 
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
Grace Jansen
 
Rails Conf 2014 Concerns, Decorators, Presenters, Service-objects, Helpers, H...
Rails Conf 2014 Concerns, Decorators, Presenters, Service-objects, Helpers, H...Rails Conf 2014 Concerns, Decorators, Presenters, Service-objects, Helpers, H...
Rails Conf 2014 Concerns, Decorators, Presenters, Service-objects, Helpers, H...
Justin Gordon
 
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
 
RA21: An Update on RA21
RA21: An Update on RA21RA21: An Update on RA21
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
Matteo Meucci
 
DataONE_Guided Metadata Improvement
DataONE_Guided Metadata ImprovementDataONE_Guided Metadata Improvement
DataONE_Guided Metadata Improvement
Lindsay Powers
 
Machine Learning Applied - Contextual Chatbots Coding, Oracle JET and TensorFlow
Machine Learning Applied - Contextual Chatbots Coding, Oracle JET and TensorFlowMachine Learning Applied - Contextual Chatbots Coding, Oracle JET and TensorFlow
Machine Learning Applied - Contextual Chatbots Coding, Oracle JET and TensorFlow
andrejusb
 

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

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
 
We’re All UX: Designing a Whole Company Design Team - Giant Conf 2014
We’re All UX:  Designing a Whole Company Design Team - Giant Conf 2014We’re All UX:  Designing a Whole Company Design Team - Giant Conf 2014
We’re All UX: Designing a Whole Company Design Team - Giant Conf 2014
 
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)
 
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
 
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
 
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
 
EPS Workshop JFall - 1.0
EPS Workshop JFall - 1.0EPS Workshop JFall - 1.0
EPS Workshop JFall - 1.0
 
SUGCON 2015 Modelling
SUGCON 2015 ModellingSUGCON 2015 Modelling
SUGCON 2015 Modelling
 
Rails tools
Rails toolsRails tools
Rails tools
 
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 ...
 
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
 
Rails Conf 2014 Concerns, Decorators, Presenters, Service-objects, Helpers, H...
Rails Conf 2014 Concerns, Decorators, Presenters, Service-objects, Helpers, H...Rails Conf 2014 Concerns, Decorators, Presenters, Service-objects, Helpers, H...
Rails Conf 2014 Concerns, Decorators, Presenters, Service-objects, Helpers, H...
 
CI-CD Jenkins, GitHub Actions, Tekton
CI-CD Jenkins, GitHub Actions, Tekton CI-CD Jenkins, GitHub Actions, Tekton
CI-CD Jenkins, GitHub Actions, Tekton
 
RA21: An Update on RA21
RA21: An Update on RA21RA21: An Update on RA21
RA21: An Update on RA21
 
10 Ways To Improve Your Code
10 Ways To Improve Your Code10 Ways To Improve Your Code
10 Ways To Improve Your Code
 
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
 
DataONE_Guided Metadata Improvement
DataONE_Guided Metadata ImprovementDataONE_Guided Metadata Improvement
DataONE_Guided Metadata Improvement
 
Machine Learning Applied - Contextual Chatbots Coding, Oracle JET and TensorFlow
Machine Learning Applied - Contextual Chatbots Coding, Oracle JET and TensorFlowMachine Learning Applied - Contextual Chatbots Coding, Oracle JET and TensorFlow
Machine Learning Applied - Contextual Chatbots Coding, Oracle JET and TensorFlow
 

More from ESUG

Workshop: Identifying concept inventories in agile programming
Workshop: Identifying concept inventories in agile programmingWorkshop: Identifying concept inventories in agile programming
Workshop: Identifying concept inventories in agile programming
ESUG
 
Technical documentation support in Pharo
Technical documentation support in PharoTechnical documentation support in Pharo
Technical documentation support in Pharo
ESUG
 
The Pharo Debugger and Debugging tools: Advances and Roadmap
The Pharo Debugger and Debugging tools: Advances and RoadmapThe Pharo Debugger and Debugging tools: Advances and Roadmap
The Pharo Debugger and Debugging tools: Advances and Roadmap
ESUG
 
Sequence: Pipeline modelling in Pharo
Sequence: Pipeline modelling in PharoSequence: Pipeline modelling in Pharo
Sequence: Pipeline modelling in Pharo
ESUG
 
Migration process from monolithic to micro frontend architecture in mobile ap...
Migration process from monolithic to micro frontend architecture in mobile ap...Migration process from monolithic to micro frontend architecture in mobile ap...
Migration process from monolithic to micro frontend architecture in mobile ap...
ESUG
 
Analyzing Dart Language with Pharo: Report and early results
Analyzing Dart Language with Pharo: Report and early resultsAnalyzing Dart Language with Pharo: Report and early results
Analyzing Dart Language with Pharo: Report and early results
ESUG
 
Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6
Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6
Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6
ESUG
 
A Unit Test Metamodel for Test Generation
A Unit Test Metamodel for Test GenerationA Unit Test Metamodel for Test Generation
A Unit Test Metamodel for Test Generation
ESUG
 
Creating Unit Tests Using Genetic Programming
Creating Unit Tests Using Genetic ProgrammingCreating Unit Tests Using Genetic Programming
Creating Unit Tests Using Genetic Programming
ESUG
 
Threaded-Execution and CPS Provide Smooth Switching Between Execution Modes
Threaded-Execution and CPS Provide Smooth Switching Between Execution ModesThreaded-Execution and CPS Provide Smooth Switching Between Execution Modes
Threaded-Execution and CPS Provide Smooth Switching Between Execution Modes
ESUG
 
Exploring GitHub Actions through EGAD: An Experience Report
Exploring GitHub Actions through EGAD: An Experience ReportExploring GitHub Actions through EGAD: An Experience Report
Exploring GitHub Actions through EGAD: An Experience Report
ESUG
 
Pharo: a reflective language A first systematic analysis of reflective APIs
Pharo: a reflective language A first systematic analysis of reflective APIsPharo: a reflective language A first systematic analysis of reflective APIs
Pharo: a reflective language A first systematic analysis of reflective APIs
ESUG
 
Garbage Collector Tuning
Garbage Collector TuningGarbage Collector Tuning
Garbage Collector Tuning
ESUG
 
Improving Performance Through Object Lifetime Profiling: the DataFrame Case
Improving Performance Through Object Lifetime Profiling: the DataFrame CaseImproving Performance Through Object Lifetime Profiling: the DataFrame Case
Improving Performance Through Object Lifetime Profiling: the DataFrame Case
ESUG
 
Pharo DataFrame: Past, Present, and Future
Pharo DataFrame: Past, Present, and FuturePharo DataFrame: Past, Present, and Future
Pharo DataFrame: Past, Present, and Future
ESUG
 
thisContext in the Debugger
thisContext in the DebuggerthisContext in the Debugger
thisContext in the Debugger
ESUG
 
Websockets for Fencing Score
Websockets for Fencing ScoreWebsockets for Fencing Score
Websockets for Fencing Score
ESUG
 
ShowUs: PharoJS.org Develop in Pharo, Run on JavaScript
ShowUs: PharoJS.org Develop in Pharo, Run on JavaScriptShowUs: PharoJS.org Develop in Pharo, Run on JavaScript
ShowUs: PharoJS.org Develop in Pharo, Run on JavaScript
ESUG
 
Advanced Object- Oriented Design Mooc
Advanced Object- Oriented Design MoocAdvanced Object- Oriented Design Mooc
Advanced Object- Oriented Design Mooc
ESUG
 
A New Architecture Reconciling Refactorings and Transformations
A New Architecture Reconciling Refactorings and TransformationsA New Architecture Reconciling Refactorings and Transformations
A New Architecture Reconciling Refactorings and Transformations
ESUG
 

More from ESUG (20)

Workshop: Identifying concept inventories in agile programming
Workshop: Identifying concept inventories in agile programmingWorkshop: Identifying concept inventories in agile programming
Workshop: Identifying concept inventories in agile programming
 
Technical documentation support in Pharo
Technical documentation support in PharoTechnical documentation support in Pharo
Technical documentation support in Pharo
 
The Pharo Debugger and Debugging tools: Advances and Roadmap
The Pharo Debugger and Debugging tools: Advances and RoadmapThe Pharo Debugger and Debugging tools: Advances and Roadmap
The Pharo Debugger and Debugging tools: Advances and Roadmap
 
Sequence: Pipeline modelling in Pharo
Sequence: Pipeline modelling in PharoSequence: Pipeline modelling in Pharo
Sequence: Pipeline modelling in Pharo
 
Migration process from monolithic to micro frontend architecture in mobile ap...
Migration process from monolithic to micro frontend architecture in mobile ap...Migration process from monolithic to micro frontend architecture in mobile ap...
Migration process from monolithic to micro frontend architecture in mobile ap...
 
Analyzing Dart Language with Pharo: Report and early results
Analyzing Dart Language with Pharo: Report and early resultsAnalyzing Dart Language with Pharo: Report and early results
Analyzing Dart Language with Pharo: Report and early results
 
Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6
Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6
Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6
 
A Unit Test Metamodel for Test Generation
A Unit Test Metamodel for Test GenerationA Unit Test Metamodel for Test Generation
A Unit Test Metamodel for Test Generation
 
Creating Unit Tests Using Genetic Programming
Creating Unit Tests Using Genetic ProgrammingCreating Unit Tests Using Genetic Programming
Creating Unit Tests Using Genetic Programming
 
Threaded-Execution and CPS Provide Smooth Switching Between Execution Modes
Threaded-Execution and CPS Provide Smooth Switching Between Execution ModesThreaded-Execution and CPS Provide Smooth Switching Between Execution Modes
Threaded-Execution and CPS Provide Smooth Switching Between Execution Modes
 
Exploring GitHub Actions through EGAD: An Experience Report
Exploring GitHub Actions through EGAD: An Experience ReportExploring GitHub Actions through EGAD: An Experience Report
Exploring GitHub Actions through EGAD: An Experience Report
 
Pharo: a reflective language A first systematic analysis of reflective APIs
Pharo: a reflective language A first systematic analysis of reflective APIsPharo: a reflective language A first systematic analysis of reflective APIs
Pharo: a reflective language A first systematic analysis of reflective APIs
 
Garbage Collector Tuning
Garbage Collector TuningGarbage Collector Tuning
Garbage Collector Tuning
 
Improving Performance Through Object Lifetime Profiling: the DataFrame Case
Improving Performance Through Object Lifetime Profiling: the DataFrame CaseImproving Performance Through Object Lifetime Profiling: the DataFrame Case
Improving Performance Through Object Lifetime Profiling: the DataFrame Case
 
Pharo DataFrame: Past, Present, and Future
Pharo DataFrame: Past, Present, and FuturePharo DataFrame: Past, Present, and Future
Pharo DataFrame: Past, Present, and Future
 
thisContext in the Debugger
thisContext in the DebuggerthisContext in the Debugger
thisContext in the Debugger
 
Websockets for Fencing Score
Websockets for Fencing ScoreWebsockets for Fencing Score
Websockets for Fencing Score
 
ShowUs: PharoJS.org Develop in Pharo, Run on JavaScript
ShowUs: PharoJS.org Develop in Pharo, Run on JavaScriptShowUs: PharoJS.org Develop in Pharo, Run on JavaScript
ShowUs: PharoJS.org Develop in Pharo, Run on JavaScript
 
Advanced Object- Oriented Design Mooc
Advanced Object- Oriented Design MoocAdvanced Object- Oriented Design Mooc
Advanced Object- Oriented Design Mooc
 
A New Architecture Reconciling Refactorings and Transformations
A New Architecture Reconciling Refactorings and TransformationsA New Architecture Reconciling Refactorings and Transformations
A New Architecture Reconciling Refactorings and Transformations
 

Recently uploaded

Large Language Models and the End of Programming
Large Language Models and the End of ProgrammingLarge Language Models and the End of Programming
Large Language Models and the End of Programming
Matt Welsh
 
A Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of PassageA Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of Passage
Philip Schwarz
 
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus
 
Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024
Paco van Beckhoven
 
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus
 
Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...
Globus
 
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing SuiteAI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
Google
 
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdfAutomated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
timtebeek1
 
Lecture 1 Introduction to games development
Lecture 1 Introduction to games developmentLecture 1 Introduction to games development
Lecture 1 Introduction to games development
abdulrafaychaudhry
 
APIs for Browser Automation (MoT Meetup 2024)
APIs for Browser Automation (MoT Meetup 2024)APIs for Browser Automation (MoT Meetup 2024)
APIs for Browser Automation (MoT Meetup 2024)
Boni García
 
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data AnalysisProviding Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
Globus
 
Vitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume MontevideoVitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume Montevideo
Vitthal Shirke
 
BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024
Ortus Solutions, Corp
 
Top 7 Unique WhatsApp API Benefits | Saudi Arabia
Top 7 Unique WhatsApp API Benefits | Saudi ArabiaTop 7 Unique WhatsApp API Benefits | Saudi Arabia
Top 7 Unique WhatsApp API Benefits | Saudi Arabia
Yara Milbes
 
Prosigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology SolutionsProsigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology Solutions
Prosigns
 
Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024
Globus
 
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
Juraj Vysvader
 
Graspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code AnalysisGraspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code Analysis
Aftab Hussain
 
How Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptxHow Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptx
wottaspaceseo
 
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Crescat
 

Recently uploaded (20)

Large Language Models and the End of Programming
Large Language Models and the End of ProgrammingLarge Language Models and the End of Programming
Large Language Models and the End of Programming
 
A Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of PassageA Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of Passage
 
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024
 
Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024
 
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024
 
Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...
 
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing SuiteAI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
 
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdfAutomated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
 
Lecture 1 Introduction to games development
Lecture 1 Introduction to games developmentLecture 1 Introduction to games development
Lecture 1 Introduction to games development
 
APIs for Browser Automation (MoT Meetup 2024)
APIs for Browser Automation (MoT Meetup 2024)APIs for Browser Automation (MoT Meetup 2024)
APIs for Browser Automation (MoT Meetup 2024)
 
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data AnalysisProviding Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
 
Vitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume MontevideoVitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume Montevideo
 
BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024
 
Top 7 Unique WhatsApp API Benefits | Saudi Arabia
Top 7 Unique WhatsApp API Benefits | Saudi ArabiaTop 7 Unique WhatsApp API Benefits | Saudi Arabia
Top 7 Unique WhatsApp API Benefits | Saudi Arabia
 
Prosigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology SolutionsProsigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology Solutions
 
Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024
 
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
 
Graspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code AnalysisGraspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code Analysis
 
How Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptxHow Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptx
 
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
 

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