Your SlideShare is downloading. ×
0
A Metric for Code Readability
A Metric for Code Readability
A Metric for Code Readability
A Metric for Code Readability
A Metric for Code Readability
A Metric for Code Readability
A Metric for Code Readability
A Metric for Code Readability
A Metric for Code Readability
A Metric for Code Readability
A Metric for Code Readability
A Metric for Code Readability
A Metric for Code Readability
A Metric for Code Readability
A Metric for Code Readability
A Metric for Code Readability
A Metric for Code Readability
A Metric for Code Readability
A Metric for Code Readability
A Metric for Code Readability
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

A Metric for Code Readability

1,989

Published on

0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
1,989
On Slideshare
0
From Embeds
0
Number of Embeds
4
Actions
Shares
0
Downloads
0
Comments
0
Likes
1
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. A Metric for Software Readability Ray Buse ∙ Westley Weimer ISSTA 2008
  • 2. 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. 3
  • 4. 4
  • 5. 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. 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. 7 Outline  Acquiring Human Readability Judgments  Extracting a Model  Model Performance  Correlation with External Notions of Software Quality  Readability and the Software Lifecycle
  • 8. 8 Snippet Sniper Demo
  • 9. 9
  • 10. 10
  • 11. 11 Scoring Data
  • 12. 12 Score Distribution
  • 13. 13 Setup
  • 14. 14 Features We choose “local” code features  Line length  Length of identifier names  Comment density  Blank lines  Presence of numbers  [and 20 others]
  • 15. 15 Model Performance
  • 16. 16 External Notions of Quality
  • 17. 17 Software Lifecycle
  • 18. 18 Software Lifecycle 2
  • 19. 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. 20 Questions? Questions?

×