2010 06-24 karlsruher entwicklertag
-
Upload
marcel-bruch -
Category
Documents
-
view
1.708 -
download
1
description
Transcript of 2010 06-24 karlsruher entwicklertag
![Page 1: 2010 06-24 karlsruher entwicklertag](https://reader035.fdocuments.net/reader035/viewer/2022062616/5496099fac795959288b5104/html5/thumbnails/1.jpg)
Eclipse Code Recommenders
“IDE 2.0” Collective Intelligence in Software DevelopmentLeveraging the Wisdom of the Crowds
Marcel Bruch
![Page 2: 2010 06-24 karlsruher entwicklertag](https://reader035.fdocuments.net/reader035/viewer/2022062616/5496099fac795959288b5104/html5/thumbnails/2.jpg)
![Page 3: 2010 06-24 karlsruher entwicklertag](https://reader035.fdocuments.net/reader035/viewer/2022062616/5496099fac795959288b5104/html5/thumbnails/3.jpg)
Developers Who Called “new Text()” Method Also Called
What Do Developers Ultimately Override After Extending This Class?
setText()
89%
addListener()
53%
setLayout()
99%
setFont()
35%
100 % overwrotePreferencePage.createContents()
96 % overwrotePreferencePage.performOk()
5 % overwrotePreferencePage.performCancel()
Eclipse Code Recommenders – do what most people do! (where appropriate)
CodeAll Frameworks
Eclipse Code Recommenders
Code
![Page 4: 2010 06-24 karlsruher entwicklertag](https://reader035.fdocuments.net/reader035/viewer/2022062616/5496099fac795959288b5104/html5/thumbnails/4.jpg)
INTELLIGENT CODE COMPLETION“Other developers frequently bought used the following methods…”
![Page 5: 2010 06-24 karlsruher entwicklertag](https://reader035.fdocuments.net/reader035/viewer/2022062616/5496099fac795959288b5104/html5/thumbnails/5.jpg)
Code Completion…
What does the developer need, i.e., which methods should the code completion present to the user?
![Page 6: 2010 06-24 karlsruher entwicklertag](https://reader035.fdocuments.net/reader035/viewer/2022062616/5496099fac795959288b5104/html5/thumbnails/6.jpg)
All 164 Methods of Text ?
![Page 7: 2010 06-24 karlsruher entwicklertag](https://reader035.fdocuments.net/reader035/viewer/2022062616/5496099fac795959288b5104/html5/thumbnails/7.jpg)
JButton? 381 Methods.
![Page 8: 2010 06-24 karlsruher entwicklertag](https://reader035.fdocuments.net/reader035/viewer/2022062616/5496099fac795959288b5104/html5/thumbnails/8.jpg)
Code Completion…
What does the developer need, i.e., which methods should the code completion present to the user?
![Page 9: 2010 06-24 karlsruher entwicklertag](https://reader035.fdocuments.net/reader035/viewer/2022062616/5496099fac795959288b5104/html5/thumbnails/9.jpg)
Intelligent Code Completion
… or just the three missing ones?
![Page 10: 2010 06-24 karlsruher entwicklertag](https://reader035.fdocuments.net/reader035/viewer/2022062616/5496099fac795959288b5104/html5/thumbnails/10.jpg)
Eclipse Code Recommenders
![Page 11: 2010 06-24 karlsruher entwicklertag](https://reader035.fdocuments.net/reader035/viewer/2022062616/5496099fac795959288b5104/html5/thumbnails/11.jpg)
Why just one when you can have templates…
![Page 12: 2010 06-24 karlsruher entwicklertag](https://reader035.fdocuments.net/reader035/viewer/2022062616/5496099fac795959288b5104/html5/thumbnails/12.jpg)
How it works – in a nutshell…
Framework
FrameworkInstantiation 1 … Framework
Instantiation n
Mining
RecommenderModel
If you extend A,you should
call B.c
…
extract facts about how the framework is reused
<extends:A><overrides:A.d>
<calls:B.c>…
<extends:A><overrides:A.b>
<calls:B.c>…
![Page 13: 2010 06-24 karlsruher entwicklertag](https://reader035.fdocuments.net/reader035/viewer/2022062616/5496099fac795959288b5104/html5/thumbnails/13.jpg)
How it works – in a nutshell…
![Page 14: 2010 06-24 karlsruher entwicklertag](https://reader035.fdocuments.net/reader035/viewer/2022062616/5496099fac795959288b5104/html5/thumbnails/14.jpg)
How it works – in a nutshell…
Observation Recommendations
![Page 15: 2010 06-24 karlsruher entwicklertag](https://reader035.fdocuments.net/reader035/viewer/2022062616/5496099fac795959288b5104/html5/thumbnails/15.jpg)
USAGE-DRIVEN JAVADOCS“What do Developers Ultimately buy override after extending this class?”
![Page 16: 2010 06-24 karlsruher entwicklertag](https://reader035.fdocuments.net/reader035/viewer/2022062616/5496099fac795959288b5104/html5/thumbnails/16.jpg)
Some Facts About TheDocumentation of Overridable Methods
623
2074overridable
overridden
![Page 17: 2010 06-24 karlsruher entwicklertag](https://reader035.fdocuments.net/reader035/viewer/2022062616/5496099fac795959288b5104/html5/thumbnails/17.jpg)
What Clients Do With Your API…
overridden
documented*155
623
*: documented as overridable by using phrases like “clients may/should/must override/extend this method”
478
![Page 18: 2010 06-24 karlsruher entwicklertag](https://reader035.fdocuments.net/reader035/viewer/2022062616/5496099fac795959288b5104/html5/thumbnails/18.jpg)
What documentation would you expect when subclassing a Dialog?
![Page 19: 2010 06-24 karlsruher entwicklertag](https://reader035.fdocuments.net/reader035/viewer/2022062616/5496099fac795959288b5104/html5/thumbnails/19.jpg)
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 windows, making it very confusing for the user.
If there is more than one modal dialog is open the second one should be parented off 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.
But what are the hot-spots of Dialog?
![Page 20: 2010 06-24 karlsruher entwicklertag](https://reader035.fdocuments.net/reader035/viewer/2022062616/5496099fac795959288b5104/html5/thumbnails/20.jpg)
What Code Completion offers…
Which of the 56 methods should we override?
![Page 21: 2010 06-24 karlsruher entwicklertag](https://reader035.fdocuments.net/reader035/viewer/2022062616/5496099fac795959288b5104/html5/thumbnails/21.jpg)
What You Need…
![Page 22: 2010 06-24 karlsruher entwicklertag](https://reader035.fdocuments.net/reader035/viewer/2022062616/5496099fac795959288b5104/html5/thumbnails/22.jpg)
Method-level Subclassing Directives
![Page 23: 2010 06-24 karlsruher entwicklertag](https://reader035.fdocuments.net/reader035/viewer/2022062616/5496099fac795959288b5104/html5/thumbnails/23.jpg)
This way, or that way? Subclassing Patterns for ViewerSorter
![Page 24: 2010 06-24 karlsruher entwicklertag](https://reader035.fdocuments.net/reader035/viewer/2022062616/5496099fac795959288b5104/html5/thumbnails/24.jpg)
How it works? Clustering in a nutshell
http://upload.wikimedia.org/wikipedia/en/2/29/Bernoulli-Mixture-Model.gif
![Page 25: 2010 06-24 karlsruher entwicklertag](https://reader035.fdocuments.net/reader035/viewer/2022062616/5496099fac795959288b5104/html5/thumbnails/25.jpg)
SMART BUG DETECTION – DRIVEN BY REAL USAGES
“The good ones in the potty, the bad ones in… the problem view.”
![Page 26: 2010 06-24 karlsruher entwicklertag](https://reader035.fdocuments.net/reader035/viewer/2022062616/5496099fac795959288b5104/html5/thumbnails/26.jpg)
What’s wrong with this code?
![Page 27: 2010 06-24 karlsruher entwicklertag](https://reader035.fdocuments.net/reader035/viewer/2022062616/5496099fac795959288b5104/html5/thumbnails/27.jpg)
At runtime your error log shows…
An error has occurred. See error log for more details. org.eclipse.core.runtime.AssertionFailedException
null argument:
![Page 28: 2010 06-24 karlsruher entwicklertag](https://reader035.fdocuments.net/reader035/viewer/2022062616/5496099fac795959288b5104/html5/thumbnails/28.jpg)
At runtime your error log shows…
So what have we missed?
![Page 29: 2010 06-24 karlsruher entwicklertag](https://reader035.fdocuments.net/reader035/viewer/2022062616/5496099fac795959288b5104/html5/thumbnails/29.jpg)
If all of your colleagues do it – why don’t you?
![Page 30: 2010 06-24 karlsruher entwicklertag](https://reader035.fdocuments.net/reader035/viewer/2022062616/5496099fac795959288b5104/html5/thumbnails/30.jpg)
How it works – a conceptual view
That’s “strange”
![Page 31: 2010 06-24 karlsruher entwicklertag](https://reader035.fdocuments.net/reader035/viewer/2022062616/5496099fac795959288b5104/html5/thumbnails/31.jpg)
How it works – a conceptual view
![Page 32: 2010 06-24 karlsruher entwicklertag](https://reader035.fdocuments.net/reader035/viewer/2022062616/5496099fac795959288b5104/html5/thumbnails/32.jpg)
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}
|)(||)(|
|)(|1)(
xAxE
xExsstrangenes
![Page 33: 2010 06-24 karlsruher entwicklertag](https://reader035.fdocuments.net/reader035/viewer/2022062616/5496099fac795959288b5104/html5/thumbnails/33.jpg)
Find your bugs… during development!
![Page 34: 2010 06-24 karlsruher entwicklertag](https://reader035.fdocuments.net/reader035/viewer/2022062616/5496099fac795959288b5104/html5/thumbnails/34.jpg)
Find your bugs… during development!
![Page 35: 2010 06-24 karlsruher entwicklertag](https://reader035.fdocuments.net/reader035/viewer/2022062616/5496099fac795959288b5104/html5/thumbnails/35.jpg)
CODE SEARCH ENGINES – LIFT OFF!“Why is Google Codesearch not ‘google for code search’? ”
![Page 36: 2010 06-24 karlsruher entwicklertag](https://reader035.fdocuments.net/reader035/viewer/2022062616/5496099fac795959288b5104/html5/thumbnails/36.jpg)
Navigating the API jungle…
How do I get an IStatusLineManager?
![Page 37: 2010 06-24 karlsruher entwicklertag](https://reader035.fdocuments.net/reader035/viewer/2022062616/5496099fac795959288b5104/html5/thumbnails/37.jpg)
When asking Google Codesearch
No IDEintegration
Manual query creation
Text-basedretrieval
Ignores prior knowledge
![Page 38: 2010 06-24 karlsruher entwicklertag](https://reader035.fdocuments.net/reader035/viewer/2022062616/5496099fac795959288b5104/html5/thumbnails/38.jpg)
Code Example Recommender
Query
![Page 39: 2010 06-24 karlsruher entwicklertag](https://reader035.fdocuments.net/reader035/viewer/2022062616/5496099fac795959288b5104/html5/thumbnails/39.jpg)
Code Example Recommender
![Page 40: 2010 06-24 karlsruher entwicklertag](https://reader035.fdocuments.net/reader035/viewer/2022062616/5496099fac795959288b5104/html5/thumbnails/40.jpg)
Code Example Recommender
![Page 41: 2010 06-24 karlsruher entwicklertag](https://reader035.fdocuments.net/reader035/viewer/2022062616/5496099fac795959288b5104/html5/thumbnails/41.jpg)
LEVERAGING USER FEEDBACK TO IMPROVE CODE SEARCH ENGINES
“Why is Google Codesearch not ‘google for code search’? ”
![Page 42: 2010 06-24 karlsruher entwicklertag](https://reader035.fdocuments.net/reader035/viewer/2022062616/5496099fac795959288b5104/html5/thumbnails/42.jpg)
Leveraging User Feedback
42
...
...
...
...
![Page 43: 2010 06-24 karlsruher entwicklertag](https://reader035.fdocuments.net/reader035/viewer/2022062616/5496099fac795959288b5104/html5/thumbnails/43.jpg)
Refine the ranking based on feedback
![Page 44: 2010 06-24 karlsruher entwicklertag](https://reader035.fdocuments.net/reader035/viewer/2022062616/5496099fac795959288b5104/html5/thumbnails/44.jpg)
Leveraging User Feedback
44
1
3
2
2
3
1
Support Vector MachineSkipped
SVMRank
![Page 45: 2010 06-24 karlsruher entwicklertag](https://reader035.fdocuments.net/reader035/viewer/2022062616/5496099fac795959288b5104/html5/thumbnails/45.jpg)
WHAT CAUSEDTHAT STACKTRACE?
Stackoverflow.com – Reloaded!
![Page 46: 2010 06-24 karlsruher entwicklertag](https://reader035.fdocuments.net/reader035/viewer/2022062616/5496099fac795959288b5104/html5/thumbnails/46.jpg)
So far we have…
Usage-Driven JavadocsIntelligent Code Completion
Code Example Recommender Smart Bug Dectection
![Page 47: 2010 06-24 karlsruher entwicklertag](https://reader035.fdocuments.net/reader035/viewer/2022062616/5496099fac795959288b5104/html5/thumbnails/47.jpg)
But what if you get this?
![Page 48: 2010 06-24 karlsruher entwicklertag](https://reader035.fdocuments.net/reader035/viewer/2022062616/5496099fac795959288b5104/html5/thumbnails/48.jpg)
Debugging – the old way
![Page 49: 2010 06-24 karlsruher entwicklertag](https://reader035.fdocuments.net/reader035/viewer/2022062616/5496099fac795959288b5104/html5/thumbnails/49.jpg)
Debugging – the old way
![Page 50: 2010 06-24 karlsruher entwicklertag](https://reader035.fdocuments.net/reader035/viewer/2022062616/5496099fac795959288b5104/html5/thumbnails/50.jpg)
But more often we get…
![Page 51: 2010 06-24 karlsruher entwicklertag](https://reader035.fdocuments.net/reader035/viewer/2022062616/5496099fac795959288b5104/html5/thumbnails/51.jpg)
How can we fix that? Don’t stacktraces share some commonalities?
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)
ExceptionType Feature(evaluates identical exception type) Message Similarity Feature
(counts of similar words)
TraceDiff Similarity Feature(counts similar stackframes per trace)
![Page 52: 2010 06-24 karlsruher entwicklertag](https://reader035.fdocuments.net/reader035/viewer/2022062616/5496099fac795959288b5104/html5/thumbnails/52.jpg)
Having a central exception repository
![Page 53: 2010 06-24 karlsruher entwicklertag](https://reader035.fdocuments.net/reader035/viewer/2022062616/5496099fac795959288b5104/html5/thumbnails/53.jpg)
How about stacktraces.org?
![Page 54: 2010 06-24 karlsruher entwicklertag](https://reader035.fdocuments.net/reader035/viewer/2022062616/5496099fac795959288b5104/html5/thumbnails/54.jpg)
LAST.FM 4 ECLIPSE“IDE 2.0? Leveraging the wisdom of the (Eclipse) community…”
![Page 55: 2010 06-24 karlsruher entwicklertag](https://reader035.fdocuments.net/reader035/viewer/2022062616/5496099fac795959288b5104/html5/thumbnails/55.jpg)
How It Works Today
Framework
FrameworkInstantiation 1 … Framework
Instantiation n
Mining
RecommenderModel
If you extend A,you should
call B.c
…
extract facts about how the framework is reused
<extends:A><overrides:A.d>
<calls:B.c>…
<extends:A><overrides:A.b>
<calls:B.c>…
![Page 56: 2010 06-24 karlsruher entwicklertag](https://reader035.fdocuments.net/reader035/viewer/2022062616/5496099fac795959288b5104/html5/thumbnails/56.jpg)
How it Works Tomorrow
Framework
FrameworkInstantiation 1 … Framework
Instantiation n
Mining
RecommenderModel
If you extend A,you should
call B.c
…
extract facts about how the framework is reused
<extends:A><overrides:A.d>
<calls:B.c>…
<extends:A><overrides:A.b>
<calls:B.c>…
![Page 57: 2010 06-24 karlsruher entwicklertag](https://reader035.fdocuments.net/reader035/viewer/2022062616/5496099fac795959288b5104/html5/thumbnails/57.jpg)
Leveraging your IDE’s build environment
framework indication
object usage
selected proposals
project environment
context
![Page 58: 2010 06-24 karlsruher entwicklertag](https://reader035.fdocuments.net/reader035/viewer/2022062616/5496099fac795959288b5104/html5/thumbnails/58.jpg)
WRAP UP“I’ve seen much but why do you call it IDE 2.0 ?”
![Page 59: 2010 06-24 karlsruher entwicklertag](https://reader035.fdocuments.net/reader035/viewer/2022062616/5496099fac795959288b5104/html5/thumbnails/59.jpg)
From IDE 1.0 to IDE 2.0
![Page 60: 2010 06-24 karlsruher entwicklertag](https://reader035.fdocuments.net/reader035/viewer/2022062616/5496099fac795959288b5104/html5/thumbnails/60.jpg)
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…
![Page 61: 2010 06-24 karlsruher entwicklertag](https://reader035.fdocuments.net/reader035/viewer/2022062616/5496099fac795959288b5104/html5/thumbnails/61.jpg)
Milestones
21.03.2009v0.1 Release
01.07.2010v0.1 Example Code
Recommender
01.12.2010Stacktrace
Recommender
01.09.2010Moving to Eclipse.org
01.02.2011v0.1 Last.FM
01.10.2010v0.1 Bugs
Recommender
…
![Page 62: 2010 06-24 karlsruher entwicklertag](https://reader035.fdocuments.net/reader035/viewer/2022062616/5496099fac795959288b5104/html5/thumbnails/62.jpg)
Resources
• Contact
• Marcel Bruch [email protected]•
• 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/
![Page 63: 2010 06-24 karlsruher entwicklertag](https://reader035.fdocuments.net/reader035/viewer/2022062616/5496099fac795959288b5104/html5/thumbnails/63.jpg)
Credits – innumerable hours have spent…
Daniel Staesche
Jan Stolzenburg
Julius Rückert
Minh Hoang Nguyen
Nico Wombacher
Sebastian Ahlfeld
Gary Fritz
Laura Altmüller
Dirk KröhanChristopher Mann
Florian Jakob
Jan KassensJohannes Born
Kristijan Madunic
Mohsen Parisay
Sinem Emeröz
Tjark VandommeleDennis Siebert
Roman Getto
Florian Nöll
Markus Migenda
Paul Schatygin
Sheip Dargutev
Nikolay Shindov
Peter Schroeder Johannes LerchMaik Görtz
Christian KilbDaniel Brandtner
David Kalnischkies
Jan-Michael Heller
Michael KutschkeMichael Novotny
Sascha Nordquist
Sebastian Denel
Sebastian Kasten
Steffen Remus Sebastian Proksch
Dennis Sänger
Boyan Yurukov
Jens KrauseDavid Schuld
Tomasz Kalbarczyk
Daniel Glöckner
Sebastian Wörner
Peter Sinzig
Johannes Kastl
Veronika Kostadinova
![Page 64: 2010 06-24 karlsruher entwicklertag](https://reader035.fdocuments.net/reader035/viewer/2022062616/5496099fac795959288b5104/html5/thumbnails/64.jpg)
Q & A
![Page 65: 2010 06-24 karlsruher entwicklertag](https://reader035.fdocuments.net/reader035/viewer/2022062616/5496099fac795959288b5104/html5/thumbnails/65.jpg)
Summary
Usage-Driven JavadocsIntelligent Code Completion
Code Example Recommender Smart Bug Dectection
![Page 66: 2010 06-24 karlsruher entwicklertag](https://reader035.fdocuments.net/reader035/viewer/2022062616/5496099fac795959288b5104/html5/thumbnails/66.jpg)
Affiliation
Prof. Dr. Mira MeziniSoftware Technology GroupFachbereich InformatikTechnische Universität Darmstadt