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

More Related Content

PDF
PhD Proposal talk
PDF
The Next Static Code Analysis Tool - Today and Tomorrow
PDF
ICSME 2016: Search-Based Peer Reviewers Recommendation in Modern Code Review
PPT
CASA: Context-Aware Scalable Authentication, at SOUPS 2013
PDF
ICGSE2020: On the Detection of Community Smells Using Genetic Programming-bas...
PDF
A Mono- and Multi-objective Approach for Recommending Software Refactoring
DOC
Test Engineer_NanYang
PPTX
An Empirical Study on the Adequacy of Testing in Open Source Projects
PhD Proposal talk
The Next Static Code Analysis Tool - Today and Tomorrow
ICSME 2016: Search-Based Peer Reviewers Recommendation in Modern Code Review
CASA: Context-Aware Scalable Authentication, at SOUPS 2013
ICGSE2020: On the Detection of Community Smells Using Genetic Programming-bas...
A Mono- and Multi-objective Approach for Recommending Software Refactoring
Test Engineer_NanYang
An Empirical Study on the Adequacy of Testing in Open Source Projects

What's hot (20)

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

Viewers also liked (20)

PDF
MSR End of Internship Talk
PDF
The Road Not Taken: Estimating Path Execution Frequency Statically
PDF
Documentation Inference for Exceptions
PDF
Synthesizing API Usage Examples
PDF
Analytics for Software Development
PDF
Information Needs for Software Development Analytics
PPTX
Automatically Documenting Program Changes
PDF
Automatically Describing Program Structure and Behavior (PhD Defense)
PPTX
Engineering Highly Maintainable Code: Maintain or Innovate
PDF
Mining Development Repositories to Study the Impact of Collaboration on Softw...
PPT
Icpc 2011 storey
PDF
ICSE 2011: Research industry panel
PDF
Mining Software Repositories: Using Humans to Better Software
PPTX
Msr2016 tarek
PDF
ICPE2015
PDF
MSR 2009
PDF
ICSE2013
PDF
ICSME2014
PDF
WCRE2011
PDF
ICSE2014
MSR End of Internship Talk
The Road Not Taken: Estimating Path Execution Frequency Statically
Documentation Inference for Exceptions
Synthesizing API Usage Examples
Analytics for Software Development
Information Needs for Software Development Analytics
Automatically Documenting Program Changes
Automatically Describing Program Structure and Behavior (PhD Defense)
Engineering Highly Maintainable Code: Maintain or Innovate
Mining Development Repositories to Study the Impact of Collaboration on Softw...
Icpc 2011 storey
ICSE 2011: Research industry panel
Mining Software Repositories: Using Humans to Better Software
Msr2016 tarek
ICPE2015
MSR 2009
ICSE2013
ICSME2014
WCRE2011
ICSE2014
Ad

Similar to A Metric for Code Readability (20)

PDF
Shift AI 2020: Using AI for automatic synthesis | Boris Cergol (Comtrade Digi...
PDF
‘CodeAliker’ - Plagiarism Detection on the Cloud
PPT
Overview of Information Engineering
PDF
Analyzing Big Data's Weakest Link (hint: it might be you)
PDF
Deepcoder to Self-Code with Machine Learning
DOCX
Conversational Networks for AutomaticOnline Moderation
PPTX
Big Data: the weakest link
PDF
IRJET- Hand Sign Recognition using Convolutional Neural Network
PDF
IDE Code Compiler for the physically challenged (Deaf, Blind & Mute)
PDF
An Overview Of The Singularity Project
PDF
Sign Language Recognition
PDF
GasMASk Annotation-based Code Generator as an Embedded Domain-Specific Langua...
PDF
How to Use Generative AI in Software Testing.pdf
PDF
Achieving Consistent and Reliable AI Code Generation - Medusa AI
PDF
Hand Gesture Recognition System Using Holistic Mediapipe
PDF
IRJET- Wearable AI Device for Blind
PDF
AI pitch SSideri
PDF
Live Sign Language Translation: A Survey
PDF
genai principles booklet with details of
PDF
J034057065
Shift AI 2020: Using AI for automatic synthesis | Boris Cergol (Comtrade Digi...
‘CodeAliker’ - Plagiarism Detection on the Cloud
Overview of Information Engineering
Analyzing Big Data's Weakest Link (hint: it might be you)
Deepcoder to Self-Code with Machine Learning
Conversational Networks for AutomaticOnline Moderation
Big Data: the weakest link
IRJET- Hand Sign Recognition using Convolutional Neural Network
IDE Code Compiler for the physically challenged (Deaf, Blind & Mute)
An Overview Of The Singularity Project
Sign Language Recognition
GasMASk Annotation-based Code Generator as an Embedded Domain-Specific Langua...
How to Use Generative AI in Software Testing.pdf
Achieving Consistent and Reliable AI Code Generation - Medusa AI
Hand Gesture Recognition System Using Holistic Mediapipe
IRJET- Wearable AI Device for Blind
AI pitch SSideri
Live Sign Language Translation: A Survey
genai principles booklet with details of
J034057065

A Metric for Code Readability