SlideShare una empresa de Scribd logo
1 de 14
Making Sense of Online
Code Snippets
Siddharth Subramanian, Reid Holmes
University of Waterloo
2
Indexes millions of random code
snippets from the internet
Public
Code on
the Internet
Traditional Code
Search
crawler
MAKING SENSE OF ONLINE CODE SNIPPETS - SIDDHARTH SUBRAMANIAN, REID HOLMES
MSR '13
Curated Code
Search
3
Indexes millions of random code
snippets from the internet
Indexes a limited set of good
quality code snippets
Public
Code on
the Internet
Traditional Code
Search
crawler
MAKING SENSE OF ONLINE CODE SNIPPETS - SIDDHARTH SUBRAMANIAN, REID HOLMES
MSR '13
crawler
Code Search Challenges
Code Search Challenges
5
chrono -Type unknown!
run()- 20 different methods
 java.util.TimerTask.run()
 android.os.HandlerThread.run()
 …
start()- 26 different methods
 android.media.MediaPlayer.start()
 android.animation.Animator.start()
 …
MAKING SENSE OF ONLINE CODE SNIPPETS - SIDDHARTH SUBRAMANIAN, REID HOLMES
MSR '13
Code Search Challenges
PROBLEMS WITH LEXICAL SEARCH
6
 Code is treated as plain-text
 Underlying API linkage is lost
 Method name collisions
MAKING SENSE OF ONLINE CODE SNIPPETS - SIDDHARTH SUBRAMANIAN, REID HOLMES
MSR '13
Code Search Challenges
7
chrono -android.widget.Chronometer
run()-java.lang.Runnable.run()
start()- android.widget.Chronometer.start()
MAKING SENSE OF ONLINE CODE SNIPPETS - SIDDHARTH SUBRAMANIAN, REID HOLMES
MSR '13
Code Search Challenges
PROBLEMS WITH LEXICAL SEARCH PROBLEMS WITH PARSING CODE
 Code snippets are often incomplete
 Missing class declarations
 Missing method declarations
 Incomplete code fragments
8
 Code is treated as plain-text
 Underlying API linkage is lost
 Method name collisions
MAKING SENSE OF ONLINE CODE SNIPPETS - SIDDHARTH SUBRAMANIAN, REID HOLMES
MSR '13
Approach
Approach
[Parnin et. al., Georgia Tech, Tech. Rep., 2012]
Approach
SnipParse
1
Code Snippet Parser
Approach
MAKING SENSE OF ONLINE CODE SNIPPETS - SIDDHARTH SUBRAMANIAN, REID HOLMES
MSR '13 12
SnipParse
Curated Snippet
Repository
• Android Types
• Android Methods
1
Code Snippet Parser
Approach
MAKING SENSE OF ONLINE CODE SNIPPETS - SIDDHARTH SUBRAMANIAN, REID HOLMES
MSR '13 13
SnipParse
Curated Snippet
Repository
• Android Types
• Android Methods
1
CodeHunter
2
Code Search
Web Interface
Code Snippet Parser
Summary
 Enabling Curated Search
 http://awenda.cs.uwaterloo.ca/snippet/
https://cs.uwaterloo.ca/~rtholmes/papers/msr_2013_subramanian.pdf
14
MAKING SENSE OF ONLINE CODE SNIPPETS - SIDDHARTH SUBRAMANIAN, REID HOLMES
MSR '13
SnipParse
Curated Snippet
Repository
• Android Types
• Android Methods
1
CodeHunter
Code Search
Web Interface
Code Snippet Parser

Más contenido relacionado

Último

Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Shubhangi Sonawane
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.pptRamjanShidvankar
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin ClassesCeline George
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docxPoojaSen20
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfJayanti Pande
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxVishalSingh1417
 
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...KokoStevan
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...christianmathematics
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfAdmir Softic
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxnegromaestrong
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Disha Kariya
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingTeacherCyreneCayanan
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docxPoojaSen20
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactPECB
 

Último (20)

INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docx
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writing
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docx
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 

Destacado

Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Applitools
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at WorkGetSmarter
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...DevGAMM Conference
 
Barbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationBarbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationErica Santiago
 
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them wellGood Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them wellSaba Software
 

Destacado (20)

Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 
ChatGPT webinar slides
ChatGPT webinar slidesChatGPT webinar slides
ChatGPT webinar slides
 
More than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike RoutesMore than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike Routes
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
 
Barbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationBarbie - Brand Strategy Presentation
Barbie - Brand Strategy Presentation
 
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them wellGood Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
 

Making Sense of Online Code Snippets

  • 1. Making Sense of Online Code Snippets Siddharth Subramanian, Reid Holmes University of Waterloo
  • 2. 2 Indexes millions of random code snippets from the internet Public Code on the Internet Traditional Code Search crawler MAKING SENSE OF ONLINE CODE SNIPPETS - SIDDHARTH SUBRAMANIAN, REID HOLMES MSR '13
  • 3. Curated Code Search 3 Indexes millions of random code snippets from the internet Indexes a limited set of good quality code snippets Public Code on the Internet Traditional Code Search crawler MAKING SENSE OF ONLINE CODE SNIPPETS - SIDDHARTH SUBRAMANIAN, REID HOLMES MSR '13 crawler
  • 5. Code Search Challenges 5 chrono -Type unknown! run()- 20 different methods  java.util.TimerTask.run()  android.os.HandlerThread.run()  … start()- 26 different methods  android.media.MediaPlayer.start()  android.animation.Animator.start()  … MAKING SENSE OF ONLINE CODE SNIPPETS - SIDDHARTH SUBRAMANIAN, REID HOLMES MSR '13
  • 6. Code Search Challenges PROBLEMS WITH LEXICAL SEARCH 6  Code is treated as plain-text  Underlying API linkage is lost  Method name collisions MAKING SENSE OF ONLINE CODE SNIPPETS - SIDDHARTH SUBRAMANIAN, REID HOLMES MSR '13
  • 7. Code Search Challenges 7 chrono -android.widget.Chronometer run()-java.lang.Runnable.run() start()- android.widget.Chronometer.start() MAKING SENSE OF ONLINE CODE SNIPPETS - SIDDHARTH SUBRAMANIAN, REID HOLMES MSR '13
  • 8. Code Search Challenges PROBLEMS WITH LEXICAL SEARCH PROBLEMS WITH PARSING CODE  Code snippets are often incomplete  Missing class declarations  Missing method declarations  Incomplete code fragments 8  Code is treated as plain-text  Underlying API linkage is lost  Method name collisions MAKING SENSE OF ONLINE CODE SNIPPETS - SIDDHARTH SUBRAMANIAN, REID HOLMES MSR '13
  • 10. Approach [Parnin et. al., Georgia Tech, Tech. Rep., 2012]
  • 12. Approach MAKING SENSE OF ONLINE CODE SNIPPETS - SIDDHARTH SUBRAMANIAN, REID HOLMES MSR '13 12 SnipParse Curated Snippet Repository • Android Types • Android Methods 1 Code Snippet Parser
  • 13. Approach MAKING SENSE OF ONLINE CODE SNIPPETS - SIDDHARTH SUBRAMANIAN, REID HOLMES MSR '13 13 SnipParse Curated Snippet Repository • Android Types • Android Methods 1 CodeHunter 2 Code Search Web Interface Code Snippet Parser
  • 14. Summary  Enabling Curated Search  http://awenda.cs.uwaterloo.ca/snippet/ https://cs.uwaterloo.ca/~rtholmes/papers/msr_2013_subramanian.pdf 14 MAKING SENSE OF ONLINE CODE SNIPPETS - SIDDHARTH SUBRAMANIAN, REID HOLMES MSR '13 SnipParse Curated Snippet Repository • Android Types • Android Methods 1 CodeHunter Code Search Web Interface Code Snippet Parser

Notas del editor

  1. Good morning everybody, I’m Siddharth Subramanian and I’m here to explain our submission to the MSR Challenge, which was work done in collaboration with Reid Holmes at the University of Waterloo. We built a system that helps developers better find API usage examples from the internet. We do so by extracting structural information hidden in code snippets on to guide code search and to construct a repository of curated source code examples from StackOVerflow.
  2. Developers frequently reuse source code or search for examples to learn about a new API. In the process, they frequently use websites like Google code or Krugle to look for examples. How do these code search engines work? They index millions of code snippets that are publicly available on the internet. However, a lot of these code snippets are of poor quality and there is no assurance if they would actually work. To overcome this issue, we built a curated code search engine that searches through code snippets in accepted answers on stack overflow. This way, developers can search for code examples with have a guarantee that the results they get would actually work.What it does? Problem? What we do? Why android?
  3. Developers frequently reuse source code or search for examples to learn about a new API. In the process, they frequently use websites like Google code or Krugle to look for examples. How do these code search engines work? They index millions of code snippets that are publicly available on the internet. However, a lot of these code snippets are of poor quality and there is no assurance if they would actually work. To overcome this issue, we built a curated code search engine that searches through code snippets in accepted answers on stack overflow. This way, developers can search for code examples with have a guarantee that the results they get would actually work.What it does? Problem? What we do? Why android?
  4. However, lexically searching through source code is lossy. Consider the following code snippet from a post on SO. The type declaration of the chrono object is missing, so we do not know which particular methods run(), setbase() and start() methods are from the android API are being called. The android API has 20 different methods named run() and 26 methods named start() and It is not clear which ones are being called in this context. However, on parsing and analysing the code snippet, we can infer that the chrono object belongs to android.widget.chronometer type and the method run() being overridden is the ___ and start is ___. But since stack overflow deals with code snippets, parsing them is difficult.
  5. However, lexically searching through source code is lossy. Consider the following code snippet from a post on SO. The type declaration of the chrono object is missing, so we do not know which particular methods run(), setbase() and start() methods are from the android API are being called. The android API has 20 different methods named run() and 26 methods named start() and It is not clear which ones are being called in this context. However, on parsing and analysing the code snippet, we can infer that the chrono object belongs to android.widget.chronometer type and the method run() being overridden is the ___ and start is ___. But since stack overflow deals with code snippets, parsing them is difficult.
  6. However, lexically searching through source code is lossy. Consider the following code snippet from a post on SO. The type declaration of the chrono object is missing, so we do not know which particular methods run(), setbase() and start() methods are from the android API are being called. The android API has 20 different methods named run() and 26 methods named start() and It is not clear which ones are being called in this context. However, on parsing and analysing the code snippet, we can infer that the chrono object belongs to android.widget.chronometer type and the method run() being overridden is the ___ and start is ___. But since stack overflow deals with code snippets, parsing them is difficult.
  7. However, lexically searching through source code is lossy. Consider the following code snippet from a post on SO. The type declaration of the chrono object is missing, so we do not know which particular methods run(), setbase() and start() methods are from the android API are being called. The android API has 20 different methods named run() and 26 methods named start() and It is not clear which ones are being called in this context. However, on parsing and analysing the code snippet, we can infer that the chrono object belongs to android.widget.chronometer type and the method run() being overridden is the ___ and start is ___. But since stack overflow deals with code snippets, parsing them is difficult.
  8. However, lexically searching through source code is lossy. Consider the following code snippet from a post on SO. The type declaration of the chrono object is missing, so we do not know which particular methods run(), setbase() and start() methods are from the android API are being called. The android API has 20 different methods named run() and 26 methods named start() and It is not clear which ones are being called in this context. However, on parsing and analysing the code snippet, we can infer that the chrono object belongs to android.widget.chronometer type and the method run() being overridden is the ___ and start is ___. But since stack overflow deals with code snippets, parsing them is difficult.
  9. We built a tool called snipparse that can parse through incomplete java source code snippets and extract structural information from them. We populated results using this tool on the posts belonging to the android framework since previous research by Parnin and others has shown that SO discussions cover a significant portion of the android API. We used this tool to build a curated source code repository where code is indexed based on the types and methods that are being used in them. This repository is made accessible through a web interface called codehunter that allows users search for precise API usage examples.
  10. We built a tool called snipparse that can parse through incomplete java source code snippets and extract structural information from them. We populated results using this tool on the posts belonging to the android framework since previous research by Parnin and others has shown that SO discussions cover a significant portion of the android API. We used this tool to build a curated source code repository where code is indexed based on the types and methods that are being used in them. This repository is made accessible through a web interface called codehunter that allows users search for precise API usage examples.
  11. We built a tool called snipparse that can parse through incomplete java source code snippets and extract structural information from them. We populated results using this tool on the posts belonging to the android framework since previous research by Parnin and others has shown that SO discussions cover a significant portion of the android API. We used this tool to build a curated source code repository where code is indexed based on the types and methods that are being used in them. This repository is made accessible through a web interface called codehunter that allows users search for precise API usage examples.
  12. We built a tool called snipparse that can parse through incomplete java source code snippets and extract structural information from them. We populated results using this tool on the posts belonging to the android framework since previous research by Parnin and others has shown that SO discussions cover a significant portion of the android API. We used this tool to build a curated source code repository where code is indexed based on the types and methods that are being used in them. This repository is made accessible through a web interface called codehunter that allows users search for precise API usage examples.
  13. We built a tool called snipparse that can parse through incomplete java source code snippets and extract structural information from them. We populated results using this tool on the posts belonging to the android framework since previous research by Parnin and others has shown that SO discussions cover a significant portion of the android API. We used this tool to build a curated source code repository where code is indexed based on the types and methods that are being used in them. This repository is made accessible through a web interface called codehunter that allows users search for precise API usage examples.
  14. To summarize, we built a tool that can identify structy