2010 06-24 karlsruher entwicklertag

2,605 views

Published on

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
2,605
On SlideShare
0
From Embeds
0
Number of Embeds
75
Actions
Shares
0
Downloads
25
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

2010 06-24 karlsruher entwicklertag

  1. 1. Eclipse Code Recommenders “IDE 2.0” Collective Intelligence in Software Development Leveraging the Wisdom of the Crowds Marcel Bruch
  2. 2. Eclipse Code Recommenders All Frameworks Code Code Eclipse Code Recommenders – do what most people do! (where appropriate) Developers Who Called “new Text()” Method Also Called setText() addListener() setLayout() setFont() 89% 53% 99% 35% What Do Developers Ultimately Override After Extending This Class? 100 % overwrote PreferencePage.createContents() 96 % overwrote PreferencePage.performOk() 5 % overwrote PreferencePage.performCancel()
  3. 3. “Other developers frequently bought used the following methods…” INTELLIGENT CODE COMPLETION
  4. 4. Code Completion… What does the developer need, i.e., which methods should the code completion present to the user?
  5. 5. All 164 Methods of Text ?
  6. 6. JButton? 381 Methods.
  7. 7. Code Completion… What does the developer need, i.e., which methods should the code completion present to the user?
  8. 8. Intelligent Code Completion … or just the three missing ones?
  9. 9. Eclipse Code Recommenders
  10. 10. Why just one when you can have templates…
  11. 11. How it works – in a nutshell… Framework If you extend A, you should call B.c Framework Framework Recommender … Model Instantiation 1 Instantiation n extract facts about how the framework is reused <extends:A> <extends:A> <overrides:A.b> <overrides:A.d> … <calls:B.c> <calls:B.c> … … Mining
  12. 12. How it works – in a nutshell…
  13. 13. How it works – in a nutshell… Observation Recommendations
  14. 14. “What do Developers Ultimately buy override after extending this class?” USAGE-DRIVEN JAVADOCS
  15. 15. Some Facts About The Documentation of Overridable Methods overridable 2074 overridden 623
  16. 16. What Clients Do With Your API… overridden 623 documented* 155 478 *: documented as overridable by using phrases like “clients may/should/must override/extend this method”
  17. 17. What documentation would you expect when subclassing a Dialog?
  18. 18. What Javadoc gives to you… A dialog is a specialized window used for narrow-focused communication with the user. Dialogs are usually modal. Consequently, it is generally bad practice to open a dialog without a parent. A modal dialog without a parent is not prevented from disappearing behind the application's other But what are the windows, making it very confusing for the user. If there is more than one modal dialog is open the second one should be parented offDialog? hot-spots of of the shell of the first one otherwise it is possible that the OS will give focus to the first dialog potentially blocking the UI.
  19. 19. What Code Completion offers… Which of the 56 methods should we override?
  20. 20. What You Need…
  21. 21. Method-level Subclassing Directives
  22. 22. This way, or that way? Subclassing Patterns for ViewerSorter
  23. 23. How it works? Clustering in a nutshell http://upload.wikimedia.org/wikipedia/en/2/29/Bernoulli-Mixture-Model.gif
  24. 24. “The good ones in the potty, the bad ones in… the problem view.” SMART BUG DETECTION – DRIVEN BY REAL USAGES
  25. 25. What’s wrong with this code?
  26. 26. At runtime your error log shows… An error has occurred. See error log for more details. org.eclipse.core.runtime.AssertionFailedException null argument:
  27. 27. At runtime your error log shows… So what have we missed?
  28. 28. If all of your colleagues do it – why don’t you?
  29. 29. How it works – a conceptual view That’s “strange”
  30. 30. How it works – a conceptual view
  31. 31. Just one formula… x = {observed method calls on a variable} E(x) = {exact similar usages for variables of type x in the code base} A(x) = {almost similar usages, i.e., x+1 method call} | E ( x) | strangeness( x) 1 | E ( x) | | A( x) |
  32. 32. Find your bugs… during development!
  33. 33. Find your bugs… during development!
  34. 34. “Why is Google Codesearch not ‘google for code search’? ” CODE SEARCH ENGINES – LIFT OFF!
  35. 35. Navigating the API jungle… How do I get an IStatusLineManager?
  36. 36. When asking Google Codesearch No IDE integration Manual query creation Text-based retrieval Ignores prior knowledge
  37. 37. Code Example Recommender Query
  38. 38. Code Example Recommender
  39. 39. Code Example Recommender
  40. 40. “Why is Google Codesearch not ‘google for code search’? ” LEVERAGING USER FEEDBACK TO IMPROVE CODE SEARCH ENGINES
  41. 41. Leveraging User Feedback ... ... ... ... 42
  42. 42. Refine the ranking based on feedback
  43. 43. Leveraging User Feedback 1 2 Support 2 Vector 1 Machine 3 3 44
  44. 44. Stackoverflow.com – Reloaded! WHAT CAUSED THAT STACKTRACE?
  45. 45. So far we have… Intelligent Code Completion Usage-Driven Javadocs Code Example Recommender Smart Bug Dectection
  46. 46. But what if you get this?
  47. 47. Debugging – the old way
  48. 48. Debugging – the old way
  49. 49. But more often we get…
  50. 50. How can we fix that? Don’t stacktraces share some commonalities? ExceptionType Feature (evaluates identical exception type) Message Similarity Feature (counts of similar words) org.eclipse.swt.SWTException: Invalid thread access at org.eclipse.swt.SWT.error(SWT.java:3884) at org.eclipse.swt.SWT.error(SWT.java:3799) at org.eclipse.swt.SWT.error(SWT.java:3770) at org.eclipse.swt.widgets.Widget.error(Widget.java:463) at org.eclipse.swt.widgets.Widget.checkWidget(Widget.java:355) at org.eclipse.swt.widgets.ProgressBar.setSelection(ProgressBar.java:317) at org.eclipselabs.cr.stacktraces.demo.ThreadDemo$1.run(Unknown Source) at java.lang.Thread.run(Thread.java:619) TraceDiff Similarity Feature (counts similar stackframes per trace)
  51. 51. Having a central exception repository
  52. 52. How about stacktraces.org?
  53. 53. “IDE 2.0? Leveraging the wisdom of the (Eclipse) community…” LAST.FM 4 ECLIPSE
  54. 54. How It Works Today Framework If you extend A, you should call B.c Framework Framework Recommender … Model Instantiation 1 Instantiation n extract facts about how the framework is reused <extends:A> <extends:A> <overrides:A.b> <overrides:A.d> … <calls:B.c> <calls:B.c> … … Mining
  55. 55. How it Works Tomorrow Framework If you extend A, you should call B.c Framework Framework Recommender … Model Instantiation 1 Instantiation n extract facts about how the framework is reused <extends:A> <extends:A> <overrides:A.b> <overrides:A.d> … <calls:B.c> <calls:B.c> … … Mining
  56. 56. Leveraging your IDE’s build environment framework context project indication environment object usage selected proposals
  57. 57. “I’ve seen much but why do you call it IDE 2.0 ?” WRAP UP
  58. 58. From IDE 1.0 to IDE 2.0
  59. 59. From Web 2.0 to IDE 2.0 Let’s map the Web 2.0 principles to IDE 2.0 to see how this analogy fits: 1. The Web as Platform… 2. Data as “Intel inside”… 3. Harnessing Collective Intelligence… 4. Rich User Experiences… 5. Lightweight Programming Models…
  60. 60. Milestones … 01.09.2010 01.12.2010 21.03.2009 Moving to Stacktrace v0.1 Release Eclipse.org Recommender 01.07.2010 v0.1 Example Code 01.10.2010 v0.1 Bugs 01.02.2011 Recommender v0.1 Last.FM Recommender
  61. 61. Resources • Contact • Marcel Bruch bruch@cs.tu-darmstadt.de • • Project homepage • http://www.stg.tu-darmstadt.de/research/core/ • Download Release “LISBON” (V.0.2.105) • http://www.stg.tu-darmstadt.de/research/core/download • Source Code • http://eclipselabs.org/p/code-recommenders/
  62. 62. Credits – innumerable hours have spent… Peter Schroeder Daniel Glöckner Johannes Lerch Maik Görtz Mohsen Parisay Jan Kassens Johannes Born Sebastian Kasten Daniel Staesche Sebastian Ahlfeld David Kalnischkies Sebastian Wörner Boyan Yurukov Jan Stolzenburg Florian Jakob Nico Wombacher Dirk Kröhan Christopher Mann Julius Rückert Steffen Remus Sebastian Proksch Sinem Emeröz Veronika Kostadinova Nikolay Shindov Tomasz Kalbarczyk Michael Novotny Jens Krause Michael Kutschke Gary Fritz Kristijan Madunic Sheip Dargutev David Schuld Sebastian Denel Johannes Kastl Roman Getto Daniel Brandtner Christian Kilb Florian Nöll Laura Altmüller Dennis Sänger Tjark Vandommele Dennis Siebert Markus Migenda Minh Hoang Nguyen Peter Sinzig Paul Schatygin Jan-Michael Heller Sascha Nordquist
  63. 63. Q&A
  64. 64. Summary Intelligent Code Completion Usage-Driven Javadocs Code Example Recommender Smart Bug Dectection
  65. 65. Affiliation Prof. Dr. Mira Mezini Software Technology Group Fachbereich Informatik Technische Universität Darmstadt

×