SlideShare ist ein Scribd-Unternehmen logo
1 von 20
A Metric for
Software
Readability
Ray Buse ∙ Westley Weimer
ISSTA 2008
2
Readability
“The quality that enables the observer to correctly
perceive the message”
Metrics for Natural Language
 Flesch-Kincaid Grade Level
 Gunning-Fog Index
 SMOG Index
 Automated Readability Index
3
4
5
Readability and Software
Code maintenance = 70% of lifecycle cost.
And most of maintenance effort is spent reading
code!
But do we have any way to gain some level of
assurance in code readability?
6
Hypothesis
Employing a simple set of local features, we can
derive, from a set of human judgments, an accurate
model of readability for code.
 To what extent do humans agree on code
readability?
 We know readability is important, but can we create
a predictive model of it?
 What could such a model teach us?
7
Outline
 Acquiring Human Readability Judgments
 Extracting a Model
 Model Performance
 Correlation with External Notions of Software
Quality
 Readability and the Software Lifecycle
8
Snippet Sniper Demo
9
10
11
Scoring Data
12
Score Distribution
13
Setup
14
Features
We choose “local” code features
 Line length
 Length of identifier names
 Comment density
 Blank lines
 Presence of numbers
 [and 20 others]
15
Model Performance
16
External Notions of Quality
17
Software Lifecycle
18
Software Lifecycle 2
19
Conclusions
We can automatically judge readability about as
well as the “average” human can
This notion of readability shows significant
correlation with:
 Version Changes
 The output of a bug finder
 Self-reported program maturity
We may also learn more about software readability
by looking at the predictive power of our model’s
features
20
Questions?
Questions?

Weitere ähnliche Inhalte

Was ist angesagt?

A Study of the Quality-Impacting Practices of Modern Code Review at Sony Mobile
A Study of the Quality-Impacting Practices of Modern Code Review at Sony MobileA Study of the Quality-Impacting Practices of Modern Code Review at Sony Mobile
A Study of the Quality-Impacting Practices of Modern Code Review at Sony Mobile
SAIL_QU
 
A Multi-Objective Refactoring Approach to Introduce Design Patterns and Fix A...
A Multi-Objective Refactoring Approach to Introduce Design Patterns and Fix A...A Multi-Objective Refactoring Approach to Introduce Design Patterns and Fix A...
A Multi-Objective Refactoring Approach to Introduce Design Patterns and Fix A...
Ali Ouni
 
Analysing the Performance of Different Population Structures for an Agent-bas...
Analysing the Performance of Different Population Structures for an Agent-bas...Analysing the Performance of Different Population Structures for an Agent-bas...
Analysing the Performance of Different Population Structures for an Agent-bas...
Juan Luis Jiménez Laredo
 

Was ist angesagt? (20)

Software Analytics: Data Analytics for Software Engineering and Security
Software Analytics: Data Analytics for Software Engineering and SecuritySoftware Analytics: Data Analytics for Software Engineering and Security
Software Analytics: Data Analytics for Software Engineering and Security
 
Recommending Software Refactoring Using Search-based Software Enginnering
Recommending Software Refactoring Using Search-based Software EnginneringRecommending Software Refactoring Using Search-based Software Enginnering
Recommending Software Refactoring Using Search-based Software Enginnering
 
A Study of the Quality-Impacting Practices of Modern Code Review at Sony Mobile
A Study of the Quality-Impacting Practices of Modern Code Review at Sony MobileA Study of the Quality-Impacting Practices of Modern Code Review at Sony Mobile
A Study of the Quality-Impacting Practices of Modern Code Review at Sony Mobile
 
MSRA 2018: Intelligent Software Engineering: Synergy between AI and Software ...
MSRA 2018: Intelligent Software Engineering: Synergy between AI and Software ...MSRA 2018: Intelligent Software Engineering: Synergy between AI and Software ...
MSRA 2018: Intelligent Software Engineering: Synergy between AI and Software ...
 
Defect Prediction: Accomplishments and Future Challenges
Defect Prediction: Accomplishments and Future ChallengesDefect Prediction: Accomplishments and Future Challenges
Defect Prediction: Accomplishments and Future Challenges
 
A Multi-Objective Refactoring Approach to Introduce Design Patterns and Fix A...
A Multi-Objective Refactoring Approach to Introduce Design Patterns and Fix A...A Multi-Objective Refactoring Approach to Introduce Design Patterns and Fix A...
A Multi-Objective Refactoring Approach to Introduce Design Patterns and Fix A...
 
IS3242 Case Presentation
IS3242 Case PresentationIS3242 Case Presentation
IS3242 Case Presentation
 
ACM Chicago March 2019 meeting: Software Engineering and AI - Prof. Tao Xie, ...
ACM Chicago March 2019 meeting: Software Engineering and AI - Prof. Tao Xie, ...ACM Chicago March 2019 meeting: Software Engineering and AI - Prof. Tao Xie, ...
ACM Chicago March 2019 meeting: Software Engineering and AI - Prof. Tao Xie, ...
 
Adoption of Software Testing in Open Source Projects - A Preliminary Study on...
Adoption of Software Testing in Open Source Projects - A Preliminary Study on...Adoption of Software Testing in Open Source Projects - A Preliminary Study on...
Adoption of Software Testing in Open Source Projects - A Preliminary Study on...
 
Understanding software metrics
Understanding software metricsUnderstanding software metrics
Understanding software metrics
 
SETTA'18 Keynote: Intelligent Software Engineering: Synergy between AI and So...
SETTA'18 Keynote: Intelligent Software Engineering: Synergy between AI and So...SETTA'18 Keynote: Intelligent Software Engineering: Synergy between AI and So...
SETTA'18 Keynote: Intelligent Software Engineering: Synergy between AI and So...
 
Intelligent Software Engineering: Synergy between AI and Software Engineering...
Intelligent Software Engineering: Synergy between AI and Software Engineering...Intelligent Software Engineering: Synergy between AI and Software Engineering...
Intelligent Software Engineering: Synergy between AI and Software Engineering...
 
Software Analytics: Data Analytics for Software Engineering
Software Analytics: Data Analytics for Software EngineeringSoftware Analytics: Data Analytics for Software Engineering
Software Analytics: Data Analytics for Software Engineering
 
Software bug prediction
Software bug prediction Software bug prediction
Software bug prediction
 
Analysing the Performance of Different Population Structures for an Agent-bas...
Analysing the Performance of Different Population Structures for an Agent-bas...Analysing the Performance of Different Population Structures for an Agent-bas...
Analysing the Performance of Different Population Structures for an Agent-bas...
 
MDD and the Tautology Problem: Discussion Notes.
MDD and the Tautology Problem: Discussion Notes.MDD and the Tautology Problem: Discussion Notes.
MDD and the Tautology Problem: Discussion Notes.
 
My life as a cyborg
My life as a cyborg My life as a cyborg
My life as a cyborg
 
NLP and its application in Insurance -Short story presentation
NLP and its application in Insurance -Short story presentationNLP and its application in Insurance -Short story presentation
NLP and its application in Insurance -Short story presentation
 
Why is Test Driven Development for Analytics or Data Projects so Hard?
Why is Test Driven Development for Analytics or Data Projects so Hard?Why is Test Driven Development for Analytics or Data Projects so Hard?
Why is Test Driven Development for Analytics or Data Projects so Hard?
 
Why is TDD so hard for Data Engineering and Analytics Projects?
Why is TDD so hard for Data Engineering and Analytics Projects?Why is TDD so hard for Data Engineering and Analytics Projects?
Why is TDD so hard for Data Engineering and Analytics Projects?
 

Andere mochten auch

MSR End of Internship Talk
MSR End of Internship TalkMSR End of Internship Talk
MSR End of Internship Talk
Ray Buse
 
The Road Not Taken: Estimating Path Execution Frequency Statically
The Road Not Taken: Estimating Path Execution Frequency StaticallyThe Road Not Taken: Estimating Path Execution Frequency Statically
The Road Not Taken: Estimating Path Execution Frequency Statically
Ray Buse
 
Documentation Inference for Exceptions
Documentation Inference for ExceptionsDocumentation Inference for Exceptions
Documentation Inference for Exceptions
Ray Buse
 
Analytics for Software Development
Analytics for Software DevelopmentAnalytics for Software Development
Analytics for Software Development
Ray Buse
 
Information Needs for Software Development Analytics
Information Needs for Software Development AnalyticsInformation Needs for Software Development Analytics
Information Needs for Software Development Analytics
Ray Buse
 
Automatically Describing Program Structure and Behavior (PhD Defense)
Automatically Describing Program Structure and Behavior (PhD Defense)Automatically Describing Program Structure and Behavior (PhD Defense)
Automatically Describing Program Structure and Behavior (PhD Defense)
Ray Buse
 

Andere mochten auch (20)

MSR End of Internship Talk
MSR End of Internship TalkMSR End of Internship Talk
MSR End of Internship Talk
 
The Road Not Taken: Estimating Path Execution Frequency Statically
The Road Not Taken: Estimating Path Execution Frequency StaticallyThe Road Not Taken: Estimating Path Execution Frequency Statically
The Road Not Taken: Estimating Path Execution Frequency Statically
 
Documentation Inference for Exceptions
Documentation Inference for ExceptionsDocumentation Inference for Exceptions
Documentation Inference for Exceptions
 
Synthesizing API Usage Examples
Synthesizing API Usage Examples Synthesizing API Usage Examples
Synthesizing API Usage Examples
 
Analytics for Software Development
Analytics for Software DevelopmentAnalytics for Software Development
Analytics for Software Development
 
Information Needs for Software Development Analytics
Information Needs for Software Development AnalyticsInformation Needs for Software Development Analytics
Information Needs for Software Development Analytics
 
Automatically Documenting Program Changes
Automatically Documenting Program ChangesAutomatically Documenting Program Changes
Automatically Documenting Program Changes
 
Automatically Describing Program Structure and Behavior (PhD Defense)
Automatically Describing Program Structure and Behavior (PhD Defense)Automatically Describing Program Structure and Behavior (PhD Defense)
Automatically Describing Program Structure and Behavior (PhD Defense)
 
Engineering Highly Maintainable Code: Maintain or Innovate
Engineering Highly Maintainable Code: Maintain or InnovateEngineering Highly Maintainable Code: Maintain or Innovate
Engineering Highly Maintainable Code: Maintain or Innovate
 
Mining Development Repositories to Study the Impact of Collaboration on Softw...
Mining Development Repositories to Study the Impact of Collaboration on Softw...Mining Development Repositories to Study the Impact of Collaboration on Softw...
Mining Development Repositories to Study the Impact of Collaboration on Softw...
 
Icpc 2011 storey
Icpc 2011 storeyIcpc 2011 storey
Icpc 2011 storey
 
ICSE 2011: Research industry panel
ICSE 2011: Research industry panelICSE 2011: Research industry panel
ICSE 2011: Research industry panel
 
Mining Software Repositories: Using Humans to Better Software
Mining Software Repositories: Using Humans to Better SoftwareMining Software Repositories: Using Humans to Better Software
Mining Software Repositories: Using Humans to Better Software
 
Msr2016 tarek
Msr2016 tarek Msr2016 tarek
Msr2016 tarek
 
ICPE2015
ICPE2015ICPE2015
ICPE2015
 
MSR 2009
MSR 2009MSR 2009
MSR 2009
 
ICSE2013
ICSE2013ICSE2013
ICSE2013
 
ICSME2014
ICSME2014ICSME2014
ICSME2014
 
WCRE2011
WCRE2011WCRE2011
WCRE2011
 
ICSE2014
ICSE2014ICSE2014
ICSE2014
 

Ähnlich wie A Metric for Code Readability

An Overview Of The Singularity Project
An  Overview Of The  Singularity  ProjectAn  Overview Of The  Singularity  Project
An Overview Of The Singularity Project
alanocu
 
A Novel Biometric Technique Benchmark Analysis For Selection Of Best Biometri...
A Novel Biometric Technique Benchmark Analysis For Selection Of Best Biometri...A Novel Biometric Technique Benchmark Analysis For Selection Of Best Biometri...
A Novel Biometric Technique Benchmark Analysis For Selection Of Best Biometri...
CSCJournals
 

Ähnlich wie A Metric for Code Readability (20)

Shift AI 2020: Using AI for automatic synthesis | Boris Cergol (Comtrade Digi...
Shift AI 2020: Using AI for automatic synthesis | Boris Cergol (Comtrade Digi...Shift AI 2020: Using AI for automatic synthesis | Boris Cergol (Comtrade Digi...
Shift AI 2020: Using AI for automatic synthesis | Boris Cergol (Comtrade Digi...
 
‘CodeAliker’ - Plagiarism Detection on the Cloud
‘CodeAliker’ - Plagiarism Detection on the Cloud ‘CodeAliker’ - Plagiarism Detection on the Cloud
‘CodeAliker’ - Plagiarism Detection on the Cloud
 
Overview of Information Engineering
Overview of Information EngineeringOverview of Information Engineering
Overview of Information Engineering
 
Analyzing Big Data's Weakest Link (hint: it might be you)
Analyzing Big Data's Weakest Link  (hint: it might be you)Analyzing Big Data's Weakest Link  (hint: it might be you)
Analyzing Big Data's Weakest Link (hint: it might be you)
 
Deepcoder to Self-Code with Machine Learning
Deepcoder to Self-Code with Machine LearningDeepcoder to Self-Code with Machine Learning
Deepcoder to Self-Code with Machine Learning
 
Conversational Networks for AutomaticOnline Moderation
Conversational Networks for AutomaticOnline ModerationConversational Networks for AutomaticOnline Moderation
Conversational Networks for AutomaticOnline Moderation
 
Big Data: the weakest link
Big Data: the weakest linkBig Data: the weakest link
Big Data: the weakest link
 
IRJET- Hand Sign Recognition using Convolutional Neural Network
IRJET- Hand Sign Recognition using Convolutional Neural NetworkIRJET- Hand Sign Recognition using Convolutional Neural Network
IRJET- Hand Sign Recognition using Convolutional Neural Network
 
IDE Code Compiler for the physically challenged (Deaf, Blind & Mute)
IDE Code Compiler for the physically challenged (Deaf, Blind & Mute)IDE Code Compiler for the physically challenged (Deaf, Blind & Mute)
IDE Code Compiler for the physically challenged (Deaf, Blind & Mute)
 
An Overview Of The Singularity Project
An  Overview Of The  Singularity  ProjectAn  Overview Of The  Singularity  Project
An Overview Of The Singularity Project
 
Sign Language Recognition
Sign Language RecognitionSign Language Recognition
Sign Language Recognition
 
Hand Gesture Recognition System Using Holistic Mediapipe
Hand Gesture Recognition System Using Holistic MediapipeHand Gesture Recognition System Using Holistic Mediapipe
Hand Gesture Recognition System Using Holistic Mediapipe
 
IRJET- Wearable AI Device for Blind
IRJET- Wearable AI Device for BlindIRJET- Wearable AI Device for Blind
IRJET- Wearable AI Device for Blind
 
AI pitch SSideri
 AI pitch SSideri  AI pitch SSideri
AI pitch SSideri
 
Live Sign Language Translation: A Survey
Live Sign Language Translation: A SurveyLive Sign Language Translation: A Survey
Live Sign Language Translation: A Survey
 
J034057065
J034057065J034057065
J034057065
 
DeepPavlov 2019
DeepPavlov 2019DeepPavlov 2019
DeepPavlov 2019
 
OPTICAL CHARACTER RECOGNITION IN HEALTHCARE
OPTICAL CHARACTER RECOGNITION IN HEALTHCAREOPTICAL CHARACTER RECOGNITION IN HEALTHCARE
OPTICAL CHARACTER RECOGNITION IN HEALTHCARE
 
Handwritten Digit Recognition Using CNN
Handwritten Digit Recognition Using CNNHandwritten Digit Recognition Using CNN
Handwritten Digit Recognition Using CNN
 
A Novel Biometric Technique Benchmark Analysis For Selection Of Best Biometri...
A Novel Biometric Technique Benchmark Analysis For Selection Of Best Biometri...A Novel Biometric Technique Benchmark Analysis For Selection Of Best Biometri...
A Novel Biometric Technique Benchmark Analysis For Selection Of Best Biometri...
 

A Metric for Code Readability