eclipse democamp zurich

38
Eclipse Code Recommenders What’s in Juno and what will be in Kepler? tw: @MarcelBruch g+: +Marcel Bruch DemoCamp Zurich Samstag, 23. Juni 2012

Upload: marcel-bruch

Post on 24-May-2015

852 views

Category:

Technology


0 download

DESCRIPTION

What's in Juno and what will be in Kepler?

TRANSCRIPT

Page 1: Eclipse Democamp Zurich

Eclipse Code Recommenders

What’s  in  Juno  and  what  will  be  in  Kepler?tw:  @MarcelBruchg+:  +Marcel  Bruch

Demo

Camp  Zurich

Samstag, 23. Juni 2012

Page 2: Eclipse Democamp Zurich

Samstag, 23. Juni 2012

Page 3: Eclipse Democamp Zurich

Developers Who Called “new Text()” 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()

CodeAll Frameworks

Eclipse  Code  Recommenders            Code

Samstag, 23. Juni 2012

Page 4: Eclipse Democamp Zurich

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

Samstag, 23. Juni 2012

Page 5: Eclipse Democamp Zurich

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

Code  Comple6on…

What  does  a  developer  need,  i.e.,  which  methods  should  the  code  compleHon  present  to  him?

Samstag, 23. Juni 2012

Page 6: Eclipse Democamp Zurich

Samstag, 23. Juni 2012

Page 7: Eclipse Democamp Zurich

All  164  Methods  of  Text  ?

Samstag, 23. Juni 2012

Page 8: Eclipse Democamp Zurich

Intelligent  Call  Comple6on

...  what  the  developer  actually  needed.

Samstag, 23. Juni 2012

Page 9: Eclipse Democamp Zurich

SUBWORDS  COMPLETION“BecausePureCamelCaseMatching****s!”

Samstag, 23. Juni 2012

Page 10: Eclipse Democamp Zurich

Clean  Code  encourages  you  to  use  speaking  method  names.  But  some6mes....

Samstag, 23. Juni 2012

Page 11: Eclipse Democamp Zurich

10

Samstag, 23. Juni 2012

Page 12: Eclipse Democamp Zurich

WHAT’S  PLANNED  FOR  KEPLER?“Rethinking  your  tool  suite.  Again.”

ABen6on:    We  are  leaving  “what’s  there”  now!

Samstag, 23. Juni 2012

Page 13: Eclipse Democamp Zurich

RETHINKING  ARGUMENT  GUESSING“Oh  SWT  -­‐  your  style  bits...”

Samstag, 23. Juni 2012

Page 14: Eclipse Democamp Zurich

Oh  SWT,  your  style  bits...

13

@Overrideprotected Control createControl(final Composite parent) {

! ! textWidget = new Text(toolbar, SWT.BORDER);! ! textWidget.addListener(eventType, listener)

Which  event  type,  i.e.,    which  int  constant  defined  somewhere,  should  he  insert  here?  0?

Samstag, 23. Juni 2012

Page 15: Eclipse Democamp Zurich

Samstag, 23. Juni 2012

Page 16: Eclipse Democamp Zurich

SWT.<^Space>?    454

Samstag, 23. Juni 2012

Page 17: Eclipse Democamp Zurich

SWT.<^Space>?    454 ±  3

Samstag, 23. Juni 2012

Page 18: Eclipse Democamp Zurich

What  you’d  like  to  see  is...

15

Samstag, 23. Juni 2012

Page 19: Eclipse Democamp Zurich

e4  Annota6on  Recommender

16

Samstag, 23. Juni 2012

Page 20: Eclipse Democamp Zurich

RETHINKING  CODE  SEARCH“Why    is    was  Google  Codesearch  not  ‘google  for  code  search’?  ”

Samstag, 23. Juni 2012

Page 21: Eclipse Democamp Zurich

What  do  you  think?

18

Samstag, 23. Juni 2012

Page 22: Eclipse Democamp Zurich

How  many  request  per  minutes  docode  search  engines  have?

Samstag, 23. Juni 2012

Page 23: Eclipse Democamp Zurich

20

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

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

Samstag, 23. Juni 2012

Page 24: Eclipse Democamp Zurich

RETHINKING  CODE  SNIPPETS“Templates  meet  Social  and  Machine  Learning!”

Samstag, 23. Juni 2012

Page 25: Eclipse Democamp Zurich

Eclipse  Java  Templates

42x  Java  Templates.35x  SWT  Templates.

Samstag, 23. Juni 2012

Page 26: Eclipse Democamp Zurich

The  rise  of  code  snippet  repositories

and  many  more...

Samstag, 23. Juni 2012

Page 27: Eclipse Democamp Zurich

Snipmatch:  Community  provided,searchable  templates...

Samstag, 23. Juni 2012

Page 28: Eclipse Democamp Zurich

RETHINKING  STACKTRACE  SEARCH“People  who  ‘bought’  this  NullPointerException  typically  fixed  this  by...”

Samstag, 23. Juni 2012

Page 29: Eclipse Democamp Zurich

But  what  if  you  get  this?

Samstag, 23. Juni 2012

Page 30: Eclipse Democamp Zurich

Debugging  –  the  old  way

Samstag, 23. Juni 2012

Page 31: Eclipse Democamp Zurich

Debugging  –  the  old  way

Samstag, 23. Juni 2012

Page 32: Eclipse Democamp Zurich

Debugging  –  the  old  way

Samstag, 23. Juni 2012

Page 33: Eclipse Democamp Zurich

But  more  oden  we  get…

Samstag, 23. Juni 2012

Page 34: Eclipse Democamp Zurich

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)

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

Samstag, 23. Juni 2012

Page 35: Eclipse Democamp Zurich

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)

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

Samstag, 23. Juni 2012

Page 36: Eclipse Democamp Zurich

How  about  “stacktrace  recommenders”?

Samstag, 23. Juni 2012

Page 37: Eclipse Democamp Zurich

4  Tool  Candidates  for  Eclipse  Kepler

32

❶  Arguments  &  AnnotaHon  Recommender

❸  Code  Snippet  Mining

❷  Code  Search

❹  Stacktrace  Search

❺  One  of  these!

Samstag, 23. Juni 2012

Page 38: Eclipse Democamp Zurich

hBp://eclipse.org/recommenders/Follow  me  on  twiBer:  @MarcelBruch

google+:  +Marcel  Bruch 33

Samstag, 23. Juni 2012