2. • Project Lead of Eclipse Code Recommenders
• Eclipse Committer since 2010
• Plug-in Developer for 10 years (Eclipse 2.1)
• Member of the Eclipse Architecture Council
• Co-Lead of Java User Group Darmstadt
• Speaker at JUGs, EclipseCon, JAX, JavaOne…
• PhD in Computer Science
• CEO of Codetrails
!
• Passion to improve developers day-to-day work
with intelligent and practical tools - mostly using
Data Mining on Big (Software Engineering) Data.
About Me
2
@MarcelBruch
+MarcelBruch
3. Codetrails at a Glance
• The company behind Eclipse Code Recommenders
• Eclipse RCP Experts & Consultants
• Software Tool Developers
• Data Mining Specialists
• Research Spin-off Darmstadt University of Technology
3
supported by
4. About Eclipse Code Recommenders
4
2006 2009 2011
2012 2013 2014
Research
begins
CR
published
CR goes
Eclipse
CR 1.0
Part of IDE CR 2.0
CR 2.1
5. Awards & Traction
5
2012
• >3.000.000 downloads
Top 20
• Talks at 50+ Democamps, Eclipse Days,
and Java User Groups all over Europe.
• Talks at 10+ intl. and
local conferences.
• articles every 4 months,
• lots of general coverage
11. A typical developer day
11
Comprehend Task
3 %
Handling Interruptions
20 %
Navigate Code
14 %
Study Code
19 %
Searching Web
12 %
Reading Docs
6 %
Write Code
27 %
51% of their time, developers invest in searching
and understanding code
17. 17
Code Completion
Frequency : 100 completions / day
Duration (⌀) : 27 seconds / completion
Sum : 45 minutes / day
9% of their time developers spent
searching in their code completion
19. Problem
19
Comprehend Task
3 %
Handling Interruptions
20 %
Searching Code
12 %
Navigate Code
14 %
Reading Code
19 %
Reading Docs
6 %
Edit Code
27 %
• 51% of their time, developers spent searching the
web and existing code for help
• In addition, even when programming, they spent
9% searching in their code completion
• In total, 60% is about finding the right information
to solve a programming task
25. @Override!
protected Control createDialogArea(final Composite parent) {!
Composite container = (Composite) super.createDialogArea(parent);!
!
swtTextWidget = new Text(container, SWT.BORDER);!
swtTextWidget.|!
return container;!
}
Code Completion…
What does the developer need, i.e., which methods
should the code completion present to the user?
25
35. public class MyView extends ViewPart {!
!
public void updateMessage(final String newMessage) {!
!
// How do I get an instance of IStatusLineManager?!
final IStatusLineManager manager = |!
!
}
How to obtain an instance of...
There is no trivial solution.
Again, what should code completion return?
35
41. In good documentation we trust...
41
good
/**!
* Rollsback the transaction if any and clears different lists to!
* start with an empty resource again.!
* Note that the super.doUnload is not called because that clears!
* the list resulting in all kinds of undesirable inverseremoves.!
*/!
@Override!
protected void doUnload() {!
super.doUnload();!
}!
!
No? Are you sure?
42. Generating high-quality API documentation
42
/**!
* The number of questions.!
*/!
private int numberOfQuestions;!
!
!
/**!
* Sets the number of questions.!
* !
* @param numberOfQuestions the number of questions!
* @throws IllegalArgumentException the illegal argument exception!
*/!
public void setNumberOfQuestions(int numberOfQuestions) !
throws IllegalArgumentException {!
if (numberOfQuestions < 0) {!
throw new IllegalArgumentException("numberOfQuestions < 0");!
}!
this.numberOfQuestions = numberOfQuestions;!
}
43. What people say about JAutodoc...
43
User: Anonymous Rating: 9 2009-08-02 11:32:37
Wow exactly what I needed!
User: Anonymous Rating: 9 2009-02-13 19:58:32
Thank you... this plugin rocks!
User: Anonymous Rating: 9 2009-02-13 19:58:32
Works perfectly. Smarter than I expected!
WTH? What did you expect?!
45. What documentation would you expect when
subclassing Dialog?
45
package org.eclipse.recommenders.examples.demo;!
!
import org.eclipse.jface.*;!
!
public class MyDialog extends Dialog {!
!
protected MyDialog(final IShellProvider parentShell) {!
super(parentShell);!
} !
}!
!
46. What Javadoc gives you...
46
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 cus to
the first dialog potentially blocking the UI.
But what are the
hot-spots of Dialog?
org.eclipse.jface.dialogs.Dialog
72. What if we‘d just count calls...?
72
Codetrails Connect Community Edition,
Install from http://www.codetrails.com/connect
73. !
void ctor() {
!
List l = new A…
}
Crowdsourced Constructor Completion
73
What is the mostly likely completion a
developer looks for in this particular situation ?
75. !
void ctor() {
!
List l = new A…
}
Use (costly) subtype checks
75
Codetrails Completion Tweaks for Eclipse,
Install from http://download.codetrails.com/updates/connect/
76. Crowdsourcing constructor completions...?
76
It learns from you. From the very 1st moment.
Codetrails Connect Community Edition,
Install from http://download.codetrails.com/updates/connect/
77. public class MyDialog extends Dialog {
!
|
!
!
Crowdsourcing override completions...?
77
78. !
void quickfix() {
!
List l = new A
}
How about fixing quick-fix?
78
Not fixed yet. But could be easily - when you start sharing your knowledge…
79. 39.000.000 clicks for a smarter IDE
79
Read more (October 2013)
http://www.codetrails.com/blog/powered-33-million-code-completions-codetrails-connect-12
Method Overrides
1.579.303
Constructor Calls
8.915.540
Method Calls
38.254.438
48.749.281
Bootstrapped with
30++ GB Java Bytecode.
Powered by Maven Central
and EclipseSource Yoxos.
88. Still scared of crowdsourcing?
88
Do you also suffer from Anatidaephobia?
„Big Brother is watching you“
http://anniemachon.ch/annie_machon/2013/11/cryptofestival-london-30th-november.html