eclipse code recommenderswiki.eclipse.org/images/8/8b/eclipse_stammtisch_zurich_code... ·...

68
Eclipse Code Recommenders IDE 2.0: Eclipse meets Social (and Crowds) tw: @MarcelBruch g+: +Marcel Bruch Eclipse Stamm;sch Zurich

Upload: others

Post on 14-Aug-2020

5 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Eclipse Code Recommenderswiki.eclipse.org/images/8/8b/Eclipse_Stammtisch_Zurich_Code... · Developers Who Called “new Text()” Method Also Called What Do Developers Ultimately

Eclipse Code Recommenders

IDE  2.0:  Eclipse  meets  Social  (and  Crowds)

tw:  @MarcelBruchg+:  +Marcel  Bruch

Eclipse  Stam

m;sch

 Zurich

Page 2: Eclipse Code Recommenderswiki.eclipse.org/images/8/8b/Eclipse_Stammtisch_Zurich_Code... · Developers Who Called “new Text()” Method Also Called What Do Developers Ultimately

2

Page 3: Eclipse Code Recommenderswiki.eclipse.org/images/8/8b/Eclipse_Stammtisch_Zurich_Code... · Developers Who Called “new Text()” Method Also Called What Do Developers Ultimately

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

CodeAll Frameworks

Eclipse  Code  Recommenders            Code

3

Page 4: Eclipse Code Recommenderswiki.eclipse.org/images/8/8b/Eclipse_Stammtisch_Zurich_Code... · Developers Who Called “new Text()” Method Also Called What Do Developers Ultimately

INTELLIGENT  CODE  COMPLETION“Other  developers  frequently  bought  used  the  following  methods…”

Page 5: Eclipse Code Recommenderswiki.eclipse.org/images/8/8b/Eclipse_Stammtisch_Zurich_Code... · Developers Who Called “new Text()” Method Also Called What Do Developers Ultimately

@Overrideprotected Control createDialogArea(final Composite parent) { Composite container = (Composite) super.createDialogArea(parent); swtTextWidget = new Text(container, SWT.BORDER); swtTextWidget.| return container;}

Code  Comple8on…

What  does  the  developer  need,  i.e.,  which  methods  should  the  code  comple;on  present  to  the  user?

5

Page 6: Eclipse Code Recommenderswiki.eclipse.org/images/8/8b/Eclipse_Stammtisch_Zurich_Code... · Developers Who Called “new Text()” Method Also Called What Do Developers Ultimately

All  164  Methods  of  Text  ?

Page 7: Eclipse Code Recommenderswiki.eclipse.org/images/8/8b/Eclipse_Stammtisch_Zurich_Code... · Developers Who Called “new Text()” Method Also Called What Do Developers Ultimately

JBuSon?  381  Methods.

Page 8: Eclipse Code Recommenderswiki.eclipse.org/images/8/8b/Eclipse_Stammtisch_Zurich_Code... · Developers Who Called “new Text()” Method Also Called What Do Developers Ultimately

@Override protected Control createDialogArea(final Composite parent) { final Composite container = (Composite) super.createDialogArea(parent); swtTextWidget = new Text(container, SWT.BORDER); swtTextWidget.| return container; }

Code  Comple8on…

What  does  the  developer  need,  i.e.,  which  methods  should  the  code  comple;on  present  to  the  user?

8

Page 9: Eclipse Code Recommenderswiki.eclipse.org/images/8/8b/Eclipse_Stammtisch_Zurich_Code... · Developers Who Called “new Text()” Method Also Called What Do Developers Ultimately

Intelligent  Code  Comple8on

…  or  just  the  three  missing  ones?  

9

Page 10: Eclipse Code Recommenderswiki.eclipse.org/images/8/8b/Eclipse_Stammtisch_Zurich_Code... · Developers Who Called “new Text()” Method Also Called What Do Developers Ultimately

Smart  Bug  Detec8on

What  have  I  missed?

Tools  Outline

Extended  Documenta8on

Intelligent  Code  Comple8on

Code  Example  Recommender

How  do  I  get  an  instance  of…?

Stacktrace  Search  Engine

What  caused  that  stacktrace?

10

x=

Page 11: Eclipse Code Recommenderswiki.eclipse.org/images/8/8b/Eclipse_Stammtisch_Zurich_Code... · Developers Who Called “new Text()” Method Also Called What Do Developers Ultimately

USAGE-­‐DRIVEN  JAVADOC“Developers  who  bought  overwrote  this  method  typically  also  overwrote...”

Page 12: Eclipse Code Recommenderswiki.eclipse.org/images/8/8b/Eclipse_Stammtisch_Zurich_Code... · Developers Who Called “new Text()” Method Also Called What Do Developers Ultimately

In  good  documenta8on  we  trust...

12

/** * 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?

...}

good

Page 13: Eclipse Code Recommenderswiki.eclipse.org/images/8/8b/Eclipse_Stammtisch_Zurich_Code... · Developers Who Called “new Text()” Method Also Called What Do Developers Ultimately

/** * 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; }

Genera8ng  high-­‐quality  API  documenta8on

13

Page 14: Eclipse Code Recommenderswiki.eclipse.org/images/8/8b/Eclipse_Stammtisch_Zurich_Code... · Developers Who Called “new Text()” Method Also Called What Do Developers Ultimately

/** * 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; }

Genera8ng  high-­‐quality  API  documenta8on

14

high-­‐quality

Page 15: Eclipse Code Recommenderswiki.eclipse.org/images/8/8b/Eclipse_Stammtisch_Zurich_Code... · Developers Who Called “new Text()” Method Also Called What Do Developers Ultimately

What  people  say  about  JAutodoc...

15

User: Anonymous Rating: 9 2009-08-02 11:32:37

Wow exactly what I needed!Wow exactly what I needed!Wow exactly what I needed!

User: Anonymous Rating: 9 2009-02-13 19:58:32

Thank you... this plugin rocks!Thank you... this plugin rocks!Thank you... this plugin rocks!

User: Anonymous Rating: 9 2009-02-13 19:58:32

Works perfectly. Smarter than I expected!Works perfectly. Smarter than I expected!Works perfectly. Smarter than I expected!

WTH?  What  did  you  expect?!

Page 16: Eclipse Code Recommenderswiki.eclipse.org/images/8/8b/Eclipse_Stammtisch_Zurich_Code... · Developers Who Called “new Text()” Method Also Called What Do Developers Ultimately

How  Recommenders  is  coming  to  rescue...

16

Page 17: Eclipse Code Recommenderswiki.eclipse.org/images/8/8b/Eclipse_Stammtisch_Zurich_Code... · Developers Who Called “new Text()” Method Also Called What Do Developers Ultimately

SNIPMATCH“Templates  meet  Social  -­‐  reloaded!”

Page 18: Eclipse Code Recommenderswiki.eclipse.org/images/8/8b/Eclipse_Stammtisch_Zurich_Code... · Developers Who Called “new Text()” Method Also Called What Do Developers Ultimately

Eclipse  Java  Editor  Templates

42x  Java  Templates.35x  SWT  Templates.

7  Years.

Page 19: Eclipse Code Recommenderswiki.eclipse.org/images/8/8b/Eclipse_Stammtisch_Zurich_Code... · Developers Who Called “new Text()” Method Also Called What Do Developers Ultimately

The  rise  of  code  snippet  repositories

and  many  more...

Page 20: Eclipse Code Recommenderswiki.eclipse.org/images/8/8b/Eclipse_Stammtisch_Zurich_Code... · Developers Who Called “new Text()” Method Also Called What Do Developers Ultimately

Searching  snippets  in  your  IDE...

Page 21: Eclipse Code Recommenderswiki.eclipse.org/images/8/8b/Eclipse_Stammtisch_Zurich_Code... · Developers Who Called “new Text()” Method Also Called What Do Developers Ultimately

CODE-­‐SEARCH  ENGINES  LIFT  OFF“Why  is  Google  Codesearch  not  ‘google  for  code  search’?  ”

Page 22: Eclipse Code Recommenderswiki.eclipse.org/images/8/8b/Eclipse_Stammtisch_Zurich_Code... · Developers Who Called “new Text()” Method Also Called What Do Developers Ultimately

How  many  request  per  minutes  docode  search  engines  have?

22

Page 23: Eclipse Code Recommenderswiki.eclipse.org/images/8/8b/Eclipse_Stammtisch_Zurich_Code... · Developers Who Called “new Text()” Method Also Called What Do Developers Ultimately

23

20Number  for  koders.com  in  2009  according  to    “Analyzing  and  mining  a  code  search  engine  usage  log”

hap://dx.doi.org/10.1007/s10664-­‐010-­‐9144-­‐6

Page 24: Eclipse Code Recommenderswiki.eclipse.org/images/8/8b/Eclipse_Stammtisch_Zurich_Code... · Developers Who Called “new Text()” Method Also Called What Do Developers Ultimately

Naviga8ng  the  API  jungle…

How  to  solveString  -­‐>  ASTParser  -­‐>  Compila;onUnit?

24

private CompilationUnit createCompilationUnit(String source) {

// how can I create and configure an ASTParser? ASTParser parser = null; parser.setSource(source.toCharArray());

// ASTParser --> CompilationUnit: how? CompilationUnit cu = null; return cu; }

Page 25: Eclipse Code Recommenderswiki.eclipse.org/images/8/8b/Eclipse_Stammtisch_Zurich_Code... · Developers Who Called “new Text()” Method Also Called What Do Developers Ultimately

When  asking  Google  code  search...

25

Page 26: Eclipse Code Recommenderswiki.eclipse.org/images/8/8b/Eclipse_Stammtisch_Zurich_Code... · Developers Who Called “new Text()” Method Also Called What Do Developers Ultimately

Why?

Text-basedretrieval!

Ignores prior knowledge!

26

Inexpressive query language!

Page 27: Eclipse Code Recommenderswiki.eclipse.org/images/8/8b/Eclipse_Stammtisch_Zurich_Code... · Developers Who Called “new Text()” Method Also Called What Do Developers Ultimately

Example  code  search  engine

public class MyJavaEditor extends EditorPart {

private CompilationUnit createCompilationUnit(String source) {

// how can I create and configure an ASTParser? ASTParser parser = null; parser.setSource(source.toCharArray());

// ASTParser --> CompilationUnit: how? CompilationUnit cu = null; return cu; }

27

Query

Page 28: Eclipse Code Recommenderswiki.eclipse.org/images/8/8b/Eclipse_Stammtisch_Zurich_Code... · Developers Who Called “new Text()” Method Also Called What Do Developers Ultimately

Sample  search  query

28

Extracted from MyJavaEditor.createCompilationUnit():

--- data ---extends: org.eclipse.ui.EditorPartuses: org.eclipse.jdt.core.CompilationUnituses: org.eclipse.jdt.core.ASTParsercalls: org.eclipse.jdt.core.ASTParser.setSource(char[])

--- requested ---def: org.eclipse.jdt.core.CompilationUnit (def=null)def: org.eclipse.jdt.core.ASTParser (def=null)

In  deve

lopme

nt...

Page 29: Eclipse Code Recommenderswiki.eclipse.org/images/8/8b/Eclipse_Stammtisch_Zurich_Code... · Developers Who Called “new Text()” Method Also Called What Do Developers Ultimately

LEVERAGING  USER  FEEDBACK  TOIMPROVE  CODE  SEARCH  ENGINES

“Why  is  Google  Codesearch  not  ‘google  for  code  search’?  ”

Page 30: Eclipse Code Recommenderswiki.eclipse.org/images/8/8b/Eclipse_Stammtisch_Zurich_Code... · Developers Who Called “new Text()” Method Also Called What Do Developers Ultimately

Leveraging  user  feedback

30

Page 31: Eclipse Code Recommenderswiki.eclipse.org/images/8/8b/Eclipse_Stammtisch_Zurich_Code... · Developers Who Called “new Text()” Method Also Called What Do Developers Ultimately

Refine  the  ranking  based  on  feedback

31

Page 32: Eclipse Code Recommenderswiki.eclipse.org/images/8/8b/Eclipse_Stammtisch_Zurich_Code... · Developers Who Called “new Text()” Method Also Called What Do Developers Ultimately

Learning  how  to  rank

32

Page 33: Eclipse Code Recommenderswiki.eclipse.org/images/8/8b/Eclipse_Stammtisch_Zurich_Code... · Developers Who Called “new Text()” Method Also Called What Do Developers Ultimately

Ranking  the  examples

33

weight  (-­‐∞..+∞)

feature-­‐score  i[0..1]

documentquery

Page 34: Eclipse Code Recommenderswiki.eclipse.org/images/8/8b/Eclipse_Stammtisch_Zurich_Code... · Developers Who Called “new Text()” Method Also Called What Do Developers Ultimately

Upda8ng  the  feature  weights...

34

10.000  ∗

Page 35: Eclipse Code Recommenderswiki.eclipse.org/images/8/8b/Eclipse_Stammtisch_Zurich_Code... · Developers Who Called “new Text()” Method Also Called What Do Developers Ultimately

SMART  BUG  DETECTION  –  DRIVEN  BY  REAL  USAGES

“The  good  ones  in  the  crock,  the  bad  ones  in…  the  problem  view.”

Page 36: Eclipse Code Recommenderswiki.eclipse.org/images/8/8b/Eclipse_Stammtisch_Zurich_Code... · Developers Who Called “new Text()” Method Also Called What Do Developers Ultimately

What’s  wrong  with  this  code?

“Hello!”

“id”

36

Page 37: Eclipse Code Recommenderswiki.eclipse.org/images/8/8b/Eclipse_Stammtisch_Zurich_Code... · Developers Who Called “new Text()” Method Also Called What Do Developers Ultimately

At  run8me  you  get…

37

Page 38: Eclipse Code Recommenderswiki.eclipse.org/images/8/8b/Eclipse_Stammtisch_Zurich_Code... · Developers Who Called “new Text()” Method Also Called What Do Developers Ultimately

...and  a  lengthy  stacktrace

38

org.eclipse.core.run8me.Asser8onFailedExcep8on:  null  argument:at  org.eclipse.core.run8me.Assert.isNotNull(Assert.java:85)at  org.eclipse.core.run8me.Assert.isNotNull(Assert.java:73)at  org.eclipse.jface.wizard.Wizard.createPageControls(Wizard.java:174)at  org.eclipse.jface.wizard.WizardDialog.createPageControls(WizardDialog.java:734)at  org.eclipse.jface.wizard.WizardDialog.setWizard(WizardDialog.java:1162)at  org.eclipse.jface.wizard.WizardDialog.updateForPage(WizardDialog.java:1221)at  org.eclipse.jface.wizard.WizardDialog.access$4(WizardDialog.java:1218)at  org.eclipse.jface.wizard.WizardDialog$6.run(WizardDialog.java:1207)at  org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)at  org.eclipse.jface.wizard.WizardDialog.showPage(WizardDialog.java:1205)at  org.eclipse.ui.internal.dialogs.ImportExportPage.treeDoubleClicked(ImportExportPage.java)at  org.eclipse.ui.internal.dialogs.ImportPage$2.doubleClick(ImportPage.java:72)at  org.eclipse.jface.viewers.StructuredViewer$1.run(StructuredViewer.java:824)at  org.eclipse.core.run8me.SafeRunner.run(SafeRunner.java:42)at  org.eclipse.ui.internal.JFaceU8l$1.run(JFaceU8l.java:49)at  org.eclipse.jface.u8l.SafeRunnable.run(SafeRunnable.java:175)at  org.eclipse.jface.viewers.StructuredViewer.fireDoubleClick(StructuredViewer.java:822)at  org.eclipse.jface.viewers.AbstractTreeViewer.handleDoubleSelect(AbstractTreeViewer.java)at  org.eclipse.jface.viewers.StructuredViewer$4.widgetDefaultSelected(StructuredViewer.java)

...

Page 39: Eclipse Code Recommenderswiki.eclipse.org/images/8/8b/Eclipse_Stammtisch_Zurich_Code... · Developers Who Called “new Text()” Method Also Called What Do Developers Ultimately

So what have we missed?39

Page 40: Eclipse Code Recommenderswiki.eclipse.org/images/8/8b/Eclipse_Stammtisch_Zurich_Code... · Developers Who Called “new Text()” Method Also Called What Do Developers Ultimately

If  all  of  your  colleagues  do  it  –  why  don’t  you?

40

Page 41: Eclipse Code Recommenderswiki.eclipse.org/images/8/8b/Eclipse_Stammtisch_Zurich_Code... · Developers Who Called “new Text()” Method Also Called What Do Developers Ultimately

How  to  detect  such  wrong  uses?

That’s  “strange”

41

Page 42: Eclipse Code Recommenderswiki.eclipse.org/images/8/8b/Eclipse_Stammtisch_Zurich_Code... · Developers Who Called “new Text()” Method Also Called What Do Developers Ultimately

How  to  detect  such  wrong  uses?

42

Page 43: Eclipse Code Recommenderswiki.eclipse.org/images/8/8b/Eclipse_Stammtisch_Zurich_Code... · Developers Who Called “new Text()” Method Also Called What Do Developers Ultimately

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}43

10 .9.5

Page 44: Eclipse Code Recommenderswiki.eclipse.org/images/8/8b/Eclipse_Stammtisch_Zurich_Code... · Developers Who Called “new Text()” Method Also Called What Do Developers Ultimately

Missing  Calls  Detector  in  Eclipse

44In  d

evelop

ment...

Page 45: Eclipse Code Recommenderswiki.eclipse.org/images/8/8b/Eclipse_Stammtisch_Zurich_Code... · Developers Who Called “new Text()” Method Also Called What Do Developers Ultimately

Applied  on  Eclipse  3.5...

45

Page 46: Eclipse Code Recommenderswiki.eclipse.org/images/8/8b/Eclipse_Stammtisch_Zurich_Code... · Developers Who Called “new Text()” Method Also Called What Do Developers Ultimately

ECLIPSE  CODE  RECOMMENDERS“IDE  2.0?  Leveraging  the  wisdom  of  the  (Eclipse)  community…”

Page 47: Eclipse Code Recommenderswiki.eclipse.org/images/8/8b/Eclipse_Stammtisch_Zurich_Code... · Developers Who Called “new Text()” Method Also Called What Do Developers Ultimately

From  IDE  1.0  to  IDE  2.0

47

Page 48: Eclipse Code Recommenderswiki.eclipse.org/images/8/8b/Eclipse_Stammtisch_Zurich_Code... · Developers Who Called “new Text()” Method Also Called What Do Developers Ultimately

Leveraging  your  IDE’s  build  environment

object usage

selectedproposals

project environment

context

Stacktraces

clickfeedback

48

Page 49: Eclipse Code Recommenderswiki.eclipse.org/images/8/8b/Eclipse_Stammtisch_Zurich_Code... · Developers Who Called “new Text()” Method Also Called What Do Developers Ultimately

Crowd-­‐sourcing...

49

Page 50: Eclipse Code Recommenderswiki.eclipse.org/images/8/8b/Eclipse_Stammtisch_Zurich_Code... · Developers Who Called “new Text()” Method Also Called What Do Developers Ultimately

Eclipse  Code  RecommendersTechnology  Stack

50

!"#$%&'()*'+,'%)&$-).$'&

!"#$%%!&$"#'()*$'()+,%$-)"

()*$'.$/0(1'$"&!"$

23&'*$#$(-)"'#))%

.#/(4#0/($'.$/0(1'$"&!"$

."!,,$#.'()+,%$-)"

$5#$"*$*'*)(3+$"#/-)"

Page 51: Eclipse Code Recommenderswiki.eclipse.org/images/8/8b/Eclipse_Stammtisch_Zurich_Code... · Developers Who Called “new Text()” Method Also Called What Do Developers Ultimately

Eclipse  Code  RecommendersTechnology  Stack

51

!"#$%&'()*'+,'%)&$-).$'&

!"#$%%!&$"#'()*$'()+,%$-)"

()*$'.$/0(1'$"&!"$

23&'*$#$(-)"'#))%

.#/(4#0/($'.$/0(1'$"&!"$

."!,,$#.'()+,%$-)"

$5#$"*$*'*)(3+$"#/-)"

!"#$%&"'()$*+,-.%

/"*-&0(1"2*,-&3"4,'

506$2*"4,'(/"0&7&3"4,'

8"',6#(9(:;*,2<"%%

:%%,2&"4,'(=;<$%

!$%*(/"*2>&'?()$&?>@,-%

A$'$-"<(B$"-2>(/$*-&2%

8,'2$6*(C"D2$%

E,7"&'(B6$2&F2((B$"-2>(/$*-&2%

GGG

CE:6CB:

GGG

!"#$%&'%"(& !)*$'$*+,-! %./%0)1$"#-1'(*)*

!)*+%'*,*.2!&!

%"(&'!,/33&)! %"(&'%"43.&+",

5.)&$/,-/,(&6/,-

!"#$%&$'()*#*+,'-.#-. #/&0),).+!"#$+1##*23,4 )5&0),).+!"#$+1##*23,4

Page 52: Eclipse Code Recommenderswiki.eclipse.org/images/8/8b/Eclipse_Stammtisch_Zurich_Code... · Developers Who Called “new Text()” Method Also Called What Do Developers Ultimately

TEAM  SERVER  FOR  ANDROID“Support  your  own  framework.  Live  walk-­‐through...”

Page 53: Eclipse Code Recommenderswiki.eclipse.org/images/8/8b/Eclipse_Stammtisch_Zurich_Code... · Developers Who Called “new Text()” Method Also Called What Do Developers Ultimately

Code  Recommenders  team  server

PowerBook G4

PowerBook G4PowerBook G4

server

devel  #1

devel  #2 devel  #3

In  deve

lopme

nt...

Page 54: Eclipse Code Recommenderswiki.eclipse.org/images/8/8b/Eclipse_Stammtisch_Zurich_Code... · Developers Who Called “new Text()” Method Also Called What Do Developers Ultimately

Demo  setup

PowerBook G4

PowerBook G4

Eclipse  “blue” Eclipse  “red”

developer  ws

examples  ws

Page 55: Eclipse Code Recommenderswiki.eclipse.org/images/8/8b/Eclipse_Stammtisch_Zurich_Code... · Developers Who Called “new Text()” Method Also Called What Do Developers Ultimately

55

Contributors  so  far…Jan  Kassens,    Peter  Schroeder,  Daniel  Glöckner,  Maik  Görtz,  Johannes  Lerch,  Johannes  Born,  Mohsen  Parisay,  Andreas  Sewe,  Sebas;an  Ahlfeld,  Sebas;an  Kasten,  Daniel  Staesche,  David  Kalnischkies,   Sebas;an   Wörner,   Boyan   Yurukov,   Jan   Stolzenburg,   Nico   Wombacher,   Dirk  Kröhan,   Florianrian   Jakob,   Julius  Rückert,   Steffen  Remus,   Christopher  Mann,  Stefan  Henss,  Andreas  Kaluza,   Nikolay   Shindov,  Michael   Novotny,   Kris;n  Arand,   Sinem  Emeröz,  Michael  Kutschke,   Sebas;an   Proksch,   Tomasz   Kalbarczyk,   Marko   Mar;n,   Sheip   Dargutev,   David  Schuld,   Jens   Krause,   Kris;jan   Madunic,   Daniel   Brandtner,   Roman   GeSo,   Chris;an   Kilb,  Johannes   Kastl,  Dennis   Sänger,   Annie   Liu,  Markus  Migenda,   Tjark  Vandommele,   Sebas;an  Denel,  Florian  Nöll,  Gary  Fritz,  Dennis  Siebert,  Peter  Sinzig,  Laura  Altmüller,  Paul  Schatygin,  Jan-­‐Michael  Heller,  Minh  Hoang  Nguyen,  Sascha  Nordquist,  Paul  Emmanuel  Faidherbe,  ...

Page 56: Eclipse Code Recommenderswiki.eclipse.org/images/8/8b/Eclipse_Stammtisch_Zurich_Code... · Developers Who Called “new Text()” Method Also Called What Do Developers Ultimately

Q  &  A

56

Page 57: Eclipse Code Recommenderswiki.eclipse.org/images/8/8b/Eclipse_Stammtisch_Zurich_Code... · Developers Who Called “new Text()” Method Also Called What Do Developers Ultimately

Q  &  A

Smart  Bug  Detec8on

What  have  I  missed?

Usage-­‐Driven  JavadocsIntelligent  Code  Comple8on

Code  Example  Recommender

How  do  I  get  an  instance  of…?

57

Leverage  the  Wisdom  of  the  Crowds!

x=

Page 58: Eclipse Code Recommenderswiki.eclipse.org/images/8/8b/Eclipse_Stammtisch_Zurich_Code... · Developers Who Called “new Text()” Method Also Called What Do Developers Ultimately

It’s  there.

hap://eclipse.org/recommenders/Follow  me  on  twiaer:  @MarcelBruch

google+:  +Marcel  Bruch 58

Page 59: Eclipse Code Recommenderswiki.eclipse.org/images/8/8b/Eclipse_Stammtisch_Zurich_Code... · Developers Who Called “new Text()” Method Also Called What Do Developers Ultimately

WHAT  CAUSED  THAT  STACKTRACE?“People  that  bought  had  this  NullPointerExcepTon,  made  this  mistake:...”

Page 60: Eclipse Code Recommenderswiki.eclipse.org/images/8/8b/Eclipse_Stammtisch_Zurich_Code... · Developers Who Called “new Text()” Method Also Called What Do Developers Ultimately

So  far  we  have…

60

Smart  Bug  Detec8on

What  have  I  missed?

Extended  Documenta8onIntelligent  Code  Comple8on

Code  Example  Recommender

How  do  I  get  an  instance  of…?

Page 61: Eclipse Code Recommenderswiki.eclipse.org/images/8/8b/Eclipse_Stammtisch_Zurich_Code... · Developers Who Called “new Text()” Method Also Called What Do Developers Ultimately

But  what  if  you  get  this?

61

Page 62: Eclipse Code Recommenderswiki.eclipse.org/images/8/8b/Eclipse_Stammtisch_Zurich_Code... · Developers Who Called “new Text()” Method Also Called What Do Developers Ultimately

Debugging  –  the  old  way

62

Page 63: Eclipse Code Recommenderswiki.eclipse.org/images/8/8b/Eclipse_Stammtisch_Zurich_Code... · Developers Who Called “new Text()” Method Also Called What Do Developers Ultimately

Debugging  –  the  old  way

63

Page 64: Eclipse Code Recommenderswiki.eclipse.org/images/8/8b/Eclipse_Stammtisch_Zurich_Code... · Developers Who Called “new Text()” Method Also Called What Do Developers Ultimately

But  more  ouen  we  get…

64

Page 65: Eclipse Code Recommenderswiki.eclipse.org/images/8/8b/Eclipse_Stammtisch_Zurich_Code... · Developers Who Called “new Text()” Method Also Called What Do Developers Ultimately

How  can  we  fix  that?  Don’t  stacktraces  share  some  commonali8es?

65

excep8on  type message

stackframes other  informa8on

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)

Page 66: Eclipse Code Recommenderswiki.eclipse.org/images/8/8b/Eclipse_Stammtisch_Zurich_Code... · Developers Who Called “new Text()” Method Also Called What Do Developers Ultimately

How  about  stacktraces.org?

66

Page 67: Eclipse Code Recommenderswiki.eclipse.org/images/8/8b/Eclipse_Stammtisch_Zurich_Code... · Developers Who Called “new Text()” Method Also Called What Do Developers Ultimately

Knowledge  sources

67

Eclipse Forums

Mailing  ListsWebplaworm

hap://stacktraces.org

Page 68: Eclipse Code Recommenderswiki.eclipse.org/images/8/8b/Eclipse_Stammtisch_Zurich_Code... · Developers Who Called “new Text()” Method Also Called What Do Developers Ultimately

Applica8on  scenarios  for  your    company

68

Community-­‐driven  (forums,  mailinglists,...)

CompanyKnowledgebase