Keyword Programming in Java - PowerPoint PPT Presentation

1 / 80
About This Presentation
Title:

Keyword Programming in Java

Description:

This work was supported in part by the National ... Azureus. 340. kloc. Buddi. 28. kloc. CAROL. 18. kloc. Dnsjava. 17. kloc. Jakarta CC. 10. kloc. jEdit ... – PowerPoint PPT presentation

Number of Views:32
Avg rating:3.0/5.0
Slides: 81
Provided by: Gre9206
Category:

less

Transcript and Presenter's Notes

Title: Keyword Programming in Java


1
Keyword Programming in Java
  • Greg Little and Robert C. Miller
  • MIT CSAIL
  • This work was supported in part by the National
    Science Foundation under award number
    IIS-0447800,
  • and by Quanta Computer as part of the TParty
    project.

2
Keyword Programming
3
Problem
src
array
cursor
4
AutoComplete
5
AutoComplete
6
AutoComplete
7
AutoComplete
8
AutoComplete
9
AutoComplete
10
AutoComplete
11
AutoComplete
12
Keyword Programming
13
Keyword Programming
14
Keyword Programming
15
Keyword Programming
16
Keyword Programming
17
Related Work
AutoComplete syntactically valid prefix
Jungloids Mandelin et al PLDI 05 XSnippet
Sahavechaphan et al OOPSLA 06 input and output
types
Keyword Programming keywords from expression
18
Motivation
19
Overview
  • Algorithm
  • Evaluation

20
Algorithm
array.add(src.readLine())
21
Algorithm
array.add(src.readLine) array
readLine src
22
Algorithm
array.add(src.readLine) array
readLine src
String
ListltStringgt
BufferedReader
23
Algorithm
24
Algorithm
Function
25
Algorithm
Function Database
Dynamic Program
Extract Tree
26
Function Database
27
Function Database
28
Function Database
29
List Functions
30
Function Database
31
Score Functions
32
Score Functions
add line
33
Score Functions
add line
34
Score Functions
add line
35
Dynamic Program
src
array
array
src
boolean
array
src
new String
?
36
Extract Tree
src
array
array
src
array
src
new String
37
Extract Tree
src
array
array
src
array
src
new String
38
Extract Tree
src
array
array
src
array
src
new String
39
Extract Tree
src
array
array
src
array
src
new String
40
Extract Tree
boolean
array
BufferedReader
src
41
Render as Java
array.add(src.readLine())
boolean
array
BufferedReader
src
42
More Complex
.Math.max(x, y)..........
Keep best n functions per box
max x y .
.Math.max(x, x)..........
Discourage double counting
43
Evaluation
Artificial Corpus
sense of speed in real projects
sense of accuracy in wide variety of contexts
User Study
sense of accuracy on real inputs
sense for how real inputs look
44
Artificial Corpus
multiple open source repositories
Popular
Could Compile
45
Artificial Corpus
46
Artificial Corpus
RubySymbol.newSymbol(getRuntime(), name)
47
Artificial Corpus
RubySymbol.newSymbol(getRuntime(), name)
RubySymbol newSymbol getRuntime name
48
Artificial Corpus
RubySymbol.newSymbol(getRuntime(), name)
RubySymbol newSymbol getRuntime name Ruby
Symbol new Symbol get Runtime name
49
Artificial Corpus
RubySymbol.newSymbol(getRuntime(), name)
RubySymbol newSymbol getRuntime name Ruby
Symbol new Symbol get Runtime name ruby symbol
new symbol get runtime name
50
Artificial Corpus
RubySymbol.newSymbol(getRuntime(), name)
RubySymbol newSymbol getRuntime name Ruby
Symbol new Symbol get Runtime name ruby symbol
new symbol get runtime name name runtime get
symbol symbol ruby new
51
Artificial Corpus
RubySymbol.newSymbol(getRuntime(), name)
name runtime get symbol symbol ruby new
52
Artificial Corpus
RubySymbol.newSymbol(getRuntime(), name)
name runtime get symbol symbol ruby new
Algorithm
53
Artificial Corpus
RubySymbol.newSymbol(getRuntime(), name)
name runtime get symbol symbol ruby new
Algorithm
54
Artificial Corpus
RubySymbol.newSymbol(getRuntime(), name)
  • Record
  • - match?
  • how long?
  • how many keywords?

name runtime get symbol symbol ruby new
Algorithm
55
Results
overall 91
56
Results
under 500ms
57
Results
58
Results
59
User Study
solicited experienced Java programmers (from
college mailing lists)
motivated with moneychance to win 20
web based study
good data for 49 participants
ages 18 - 74
about 70 students
3 females
60
User Study
61
User Study
62
Results
Correct
Incorrect
as-is
vowels.indexOf(c)
vowels.index(c)
vowels.index(c)
vowels.isIn(c)
vowels.charAt(c)
Algorithm
index of c in vowels
check vowels for c, return neg -1 if c is in
vowels
vowels.indexOf(c,Integer.SIZE))
vowels search c
search
c
63
Results
as-is
Algorithm
64
Results
java
key/pseudo
using
as
-
is
using algorithm
65
Results
java
key/pseudo
using
as
-
is
53
using algorithm
71
53
66
Future Work
a priori word weights
print name of f
want
becomes
System.out.print(f.getName())
Integer.valueOf(f.getName())
of f name
print f name
67
Future Work
a priori function weights
println f name
want
becomes
System.out.println(f.getName())
System.err.println(f.getName())
println f name
println f name
68
Future Work
spell correction
lowercase
toLowerCase
synonyms
add vs append
69
Conclusion
array.add(src.readLine())
70
Backup Slides
71
E-mail
glittle_at_gmail.com
72
(No Transcript)
73
(No Transcript)
74
(No Transcript)
75
(No Transcript)
76
(No Transcript)
77
(No Transcript)
78
(No Transcript)
79
(No Transcript)
80
(No Transcript)
Write a Comment
User Comments (0)
About PowerShow.com