Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Making Sense of OnlineCode SnippetsSiddharth Subramanian, Reid HolmesUniversity of Waterloo
2Indexes millions of random codesnippets from the internetPublicCode onthe InternetTraditional CodeSearchcrawlerMAKING SEN...
Curated CodeSearch3Indexes millions of random codesnippets from the internetIndexes a limited set of goodquality code snip...
Code Search Challenges
Code Search Challenges5chrono -Type unknown!run()- 20 different methods java.util.TimerTask.run() android.os.HandlerThre...
Code Search ChallengesPROBLEMS WITH LEXICAL SEARCH6 Code is treated as plain-text Underlying API linkage is lost Method...
Code Search Challenges7chrono -android.widget.Chronometerrun()-java.lang.Runnable.run()start()- android.widget.Chronometer...
Code Search ChallengesPROBLEMS WITH LEXICAL SEARCH PROBLEMS WITH PARSING CODE Code snippets are often incomplete Missing...
Approach
Approach[Parnin et. al., Georgia Tech, Tech. Rep., 2012]
ApproachSnipParse1Code Snippet Parser
ApproachMAKING SENSE OF ONLINE CODE SNIPPETS - SIDDHARTH SUBRAMANIAN, REID HOLMESMSR 13 12SnipParseCurated SnippetReposito...
ApproachMAKING SENSE OF ONLINE CODE SNIPPETS - SIDDHARTH SUBRAMANIAN, REID HOLMESMSR 13 13SnipParseCurated SnippetReposito...
Summary Enabling Curated Search http://awenda.cs.uwaterloo.ca/snippet/https://cs.uwaterloo.ca/~rtholmes/papers/msr_2013...
Upcoming SlideShare
Loading in …5
×

Making Sense of Online Code Snippets

1,775 views

Published on

Presentation for MSR '13, San Francisco.

Published in: Education, Technology
  • Be the first to comment

Making Sense of Online Code Snippets

  1. 1. Making Sense of OnlineCode SnippetsSiddharth Subramanian, Reid HolmesUniversity of Waterloo
  2. 2. 2Indexes millions of random codesnippets from the internetPublicCode onthe InternetTraditional CodeSearchcrawlerMAKING SENSE OF ONLINE CODE SNIPPETS - SIDDHARTH SUBRAMANIAN, REID HOLMESMSR 13
  3. 3. Curated CodeSearch3Indexes millions of random codesnippets from the internetIndexes a limited set of goodquality code snippetsPublicCode onthe InternetTraditional CodeSearchcrawlerMAKING SENSE OF ONLINE CODE SNIPPETS - SIDDHARTH SUBRAMANIAN, REID HOLMESMSR 13crawler
  4. 4. Code Search Challenges
  5. 5. Code Search Challenges5chrono -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 HOLMESMSR 13
  6. 6. Code Search ChallengesPROBLEMS WITH LEXICAL SEARCH6 Code is treated as plain-text Underlying API linkage is lost Method name collisionsMAKING SENSE OF ONLINE CODE SNIPPETS - SIDDHARTH SUBRAMANIAN, REID HOLMESMSR 13
  7. 7. Code Search Challenges7chrono -android.widget.Chronometerrun()-java.lang.Runnable.run()start()- android.widget.Chronometer.start()MAKING SENSE OF ONLINE CODE SNIPPETS - SIDDHARTH SUBRAMANIAN, REID HOLMESMSR 13
  8. 8. Code Search ChallengesPROBLEMS WITH LEXICAL SEARCH PROBLEMS WITH PARSING CODE Code snippets are often incomplete Missing class declarations Missing method declarations Incomplete code fragments8 Code is treated as plain-text Underlying API linkage is lost Method name collisionsMAKING SENSE OF ONLINE CODE SNIPPETS - SIDDHARTH SUBRAMANIAN, REID HOLMESMSR 13
  9. 9. Approach
  10. 10. Approach[Parnin et. al., Georgia Tech, Tech. Rep., 2012]
  11. 11. ApproachSnipParse1Code Snippet Parser
  12. 12. ApproachMAKING SENSE OF ONLINE CODE SNIPPETS - SIDDHARTH SUBRAMANIAN, REID HOLMESMSR 13 12SnipParseCurated SnippetRepository• Android Types• Android Methods1Code Snippet Parser
  13. 13. ApproachMAKING SENSE OF ONLINE CODE SNIPPETS - SIDDHARTH SUBRAMANIAN, REID HOLMESMSR 13 13SnipParseCurated SnippetRepository• Android Types• Android Methods1CodeHunter2Code SearchWeb InterfaceCode Snippet Parser
  14. 14. Summary Enabling Curated Search http://awenda.cs.uwaterloo.ca/snippet/https://cs.uwaterloo.ca/~rtholmes/papers/msr_2013_subramanian.pdf14MAKING SENSE OF ONLINE CODE SNIPPETS - SIDDHARTH SUBRAMANIAN, REID HOLMESMSR 13SnipParseCurated SnippetRepository• Android Types• Android Methods1CodeHunterCode SearchWeb InterfaceCode Snippet Parser

×