Spoken Language Support for Software Development

101
1 Spoken Language Support for Software Development Andrew Begel Advisor: Susan L. Graham Computer Science Division, EECS University of California, Berkeley

description

Spoken Language Support for Software Development. Andrew Begel Advisor: Susan L. Graham Computer Science Division, EECS University of California, Berkeley. while (counter < limit) {  }. Motivation. Programmers conventionally use keyboard - PowerPoint PPT Presentation

Transcript of Spoken Language Support for Software Development

Page 1: Spoken Language Support for Software Development

1

Spoken Language Support for Software

Development

Andrew BegelAdvisor: Susan L. GrahamComputer Science Division, EECSUniversity of California, Berkeley

Page 2: Spoken Language Support for Software Development

2

Motivation

• Programmers conventionally use keyboard– Long hours at keyboard leads to higher risk of

RSI• Can a programmer code using speech?• Can a computer understand what the

developer says?

while (counter < limit) { }

Page 3: Spoken Language Support for Software Development

3

Programming by Voice

• My Goal1. Find out how developers use code verbally. Use this to

develop a naturally verbalizable input form.2. Build development environment that supports verbal

authoring, navigation, modification.• Extend conventional compiler analyses to support ambiguities

generated by speech.3. Learn how developers can use voice-based

programming, and iterate design.

while counter is lessthan limit do ...

Page 4: Spoken Language Support for Software Development

4

Challenges

Speech is inherently ambiguous.Programming tools were not designed for

ambiguity.Speech tools are poorly suited for

programming tasks.Programmers are not used to verbal software

development.

Page 5: Spoken Language Support for Software Development

5

Talk Outline

• Introduction and Motivation Programming by Voice• Program Analyses for Ambiguous Inputs• SPEech EDitor Programming Environment• SPEED User Study• Conclusion

Page 6: Spoken Language Support for Software Development

6

How do Programmers Speak Code?

• 10 programmers read Java code out loud (Begel ‘05)– Graduate students in Computer Science– Five knew Java, five did not– Five were native English speakers, five were not– Five were educated in U.S.A., five were not

• Read pre-written code into tape recorder– As if speaking to a sophomore-level CS undergrad

who knows Java, but does not know the program

• Most programmers spoke the same way

Page 7: Spoken Language Support for Software Development

7

for int i equals zero i less than ten i plus plus

for (int i = 0; i < 10; i++ ) { ▌}

How do Programmers Speak Code?

Page 8: Spoken Language Support for Software Development

8

Spoken Words Can Be Hard To Write Down

2

How Do Programmers Speak Code?

Page 9: Spoken Language Support for Software Development

9

Spoken Words Can Be Hard To Write Down

2 2, two, to, too

How Do Programmers Speak Code?

Page 10: Spoken Language Support for Software Development

10

Spoken Words Can Be Hard To Write Down

2 2, two, to, too

print

How Do Programmers Speak Code?

Page 11: Spoken Language Support for Software Development

11

Spoken Words Can Be Hard To Write Down

2 2, two, to, too

print print, Print

How Do Programmers Speak Code?

Page 12: Spoken Language Support for Software Development

12

Spoken Words Can Be Hard To Write Down

2 2, two, to, too

print print, Print

drop stack process

How Do Programmers Speak Code?

Page 13: Spoken Language Support for Software Development

13

Spoken Words Can Be Hard To Write Down

2 2, two, to, too

print print, Print

drop stack process drop stack processdrop stackprocessdropstack processdropstackprocess

How Do Programmers Speak Code?

Page 14: Spoken Language Support for Software Development

14

Many Ways to Say the Same Thing

bar[i]

How Do Programmers Speak Code?

Page 15: Spoken Language Support for Software Development

15

Many Ways to Say the Same Thing

bar[i] bar sub i, bar of i, i from bar

How Do Programmers Speak Code?

Page 16: Spoken Language Support for Software Development

16

Many Ways to Say the Same Thing

bar[i] bar sub i, bar of i, i from bar

.

How Do Programmers Speak Code?

Page 17: Spoken Language Support for Software Development

17

Many Ways to Say the Same Thing

bar[i] bar sub i, bar of i, i from bar

. period, dot

How Do Programmers Speak Code?

Page 18: Spoken Language Support for Software Development

18

Many Ways to Say the Same Thing

bar[i] bar sub i, bar of i, i from bar

. period, dot

}

How Do Programmers Speak Code?

Page 19: Spoken Language Support for Software Development

19

Many Ways to Say the Same Thing

bar[i] bar sub i, bar of i, i from bar

. period, dot

} right brace, close the if, end method

How Do Programmers Speak Code?

Page 20: Spoken Language Support for Software Development

20

Many Ways to Say the Same Thing

bar[i] bar sub i, bar of i, i from bar

. period, dot

} right brace, close the if, end method

println

How Do Programmers Speak Code?

Page 21: Spoken Language Support for Software Development

21

Many Ways to Say the Same Thing

bar[i] bar sub i, bar of i, i from bar

. period, dot

} right brace, close the if, end method

println print line, print lin, print l n

How Do Programmers Speak Code?

Page 22: Spoken Language Support for Software Development

22

One Utterance May Mean Many Things

object stack

How Do Programmers Speak Code?

Page 23: Spoken Language Support for Software Development

23

One Utterance May Mean Many Things

object stack Object stack;object.stackobject(stack)

object().stack()

How Do Programmers Speak Code?

Page 24: Spoken Language Support for Software Development

24

One Utterance May Mean Many Things

object stack Object stack;object.stackobject(stack)

object().stack()

array sub i plus plus

How Do Programmers Speak Code?

Page 25: Spoken Language Support for Software Development

25

One Utterance May Mean Many Things

object stack Object stack;object.stackobject(stack)

object().stack()

array sub i plus plus array[i]++array[i++]

How Do Programmers Speak Code?

Page 26: Spoken Language Support for Software Development

26

People Have Trouble Saying Some Things

System.out.println

How Do Programmers Speak Code?

Page 27: Spoken Language Support for Software Development

27

People Have Trouble Saying Some Things

System.out.println system out print linesystem dot out print line

system dot out dot print line

How Do Programmers Speak Code?

Page 28: Spoken Language Support for Software Development

28

People Have Trouble Saying Some Things

System.out.println system out print linesystem dot out print line

system dot out dot print line

(int)foo

How Do Programmers Speak Code?

Page 29: Spoken Language Support for Software Development

29

People Have Trouble Saying Some Things

System.out.println system out print linesystem dot out print line

system dot out dot print line

(int)foo cast foo to integer int foo

cast something to integer. that something is foo.

How Do Programmers Speak Code?

Page 30: Spoken Language Support for Software Development

30

Sometimes They Describe the Code

And then there’s a class.

How Do Programmers Speak Code?

Page 31: Spoken Language Support for Software Development

31

Sometimes They Describe the Code

And then there’s a class.

Set all the fields of that object to null.

How Do Programmers Speak Code?

Page 32: Spoken Language Support for Software Development

32

Sometimes They Describe the Code

And then there’s a class.

Set all the fields of that object to null.

All of these are just assignment operations.

How Do Programmers Speak Code?

Page 33: Spoken Language Support for Software Development

33

Design Tradeoffs

CommandLanguage

Easy to analyze,but prescriptive

NaturalLanguage

Flexible,but ambiguous

Programmingby Voice

Page 34: Spoken Language Support for Software Development

34

Programming by Voice Related Work

Human-CentricComputer-Centric

MultipleTasks

AuthoringOnly

Arnold ‘00

Snell ‘00

Price ‘00 ‘02

Desilets ‘01 ‘04

Gray ‘03

Begel ‘05

Page 35: Spoken Language Support for Software Development

35

A More Natural Way to Code

public class symbol implements serializable

public class Symbol implements Serializable { ▌}

Page 36: Spoken Language Support for Software Development

36

A More Natural Way to Code

static hash map hash table gets new hash map

public class Symbol implements Serializable { static HashMap hashtbl = new HashMap();

▌}

Page 37: Spoken Language Support for Software Development

37

A More Natural Way to Code

end the class

public class Symbol implements Serializable { static HashMap hashtbl = new HashMap();

}▌

Page 38: Spoken Language Support for Software Development

38

A More Natural Way to Code

for int i equals zero i less than ten i plus plus

for (int i = 0; i < 10; i++ ) { ▌}

Page 39: Spoken Language Support for Software Development

39

Too Many Ambiguities

for (int i = 0; i < 10; i++ ) { ▌}

4 int eye equals 0 aye less then ten i plus plus

KW or #?Spelling of ID?

KW or ID?for int i equals zero i less than ten i plus plus

Page 40: Spoken Language Support for Software Development

40

Sometimes It’s Non-Obvious

for (times = 8; file(2, load); times == one) {▌

}

for times equals 8 file 2 load times equals one

fore *= 8; file.tooLode.times = won ▌

4; times = ate(file).to(load).equals(1) ▌

Page 41: Spoken Language Support for Software Development

41

Spoken Java• Semantically identical to Java• Syntactically easier to say than Java

– Methodology generalizable to any computer language

1. All punctuation has English equivalents• Open Brace, End For Loop

2. Most punctuation is optional3. Provide verbalization for all abbreviations4. Relaxed phrasing for better fit with English

• (int)foo “cast foo to integer”• foo = 6 “set foo to 6”• foo[i]++ “increment the ith element of array foo”

Page 42: Spoken Language Support for Software Development

42

SPEED: Speech Editor• Build an editor that supports naturally verbalized

programs• SPEED: SPEech EDitor

• Based on IBM ViaVoice, Eclipse IDE, Harmonia

– Spoken Java Language for Composition– Spoken Command language for Navigation,

Editing, Template instantiation, Refactorings, Search

– Audible and visual feedback• Similar to JavaSpeak (Smith 2000)

Page 43: Spoken Language Support for Software Development

43

Harmonia Analysis Framework

• Framework to support interactive editors– Language-based, programmer-oriented tools

• Incremental analyses– Lexing (Wagner ‘97), GLR Parsing (Wagner ‘97, Begel ‘04), Static

Semantics (Garrison ‘87, Begel, Jamison)

• C, Java, Titanium, Cool, Flex, Bison– Also, languages where indentation and CRs are

significant• Interactive Program Transformations (Boshernitsan)

• CodeLink (Toomim et. al. ‘04)

• Shorthand Editing

Page 44: Spoken Language Support for Software Development

44

Talk Outline

• Introduction and Motivation• Programming by Voice Program Analyses for Ambiguous Inputs • SPEech EDitor Programming Environment• SPEED User Study• Conclusion

Page 45: Spoken Language Support for Software Development

45

Traditional Compiler Analyses

LexicalAnalysis

FOR I

Parsing SemanticAnalysis

for (i = 0; i < 10; i++ ) { }

Programming languages are designed to be unambiguous

For Loop

FOR Assign Expr

I = 0

i LocalVar int

Page 46: Spoken Language Support for Software Development

46

Ambiguity-Aware Analysesfor i equals zero ...

Handles input stream, syntactic and semantic ambiguities

LexicalAnalysis

FOR I

AmbiguousParsing

SemanticAmbiguityResolution

For Loop

FOR Assign Expr

I = 0

i LocalVar int

foureye

LocalVar ?4 EYE FOUREYE

Assign Expr

= 0

Ambig Stmt

Page 47: Spoken Language Support for Software Development

47

Scan Input Stream

CommercialSpeech

Recognizer

HomophoneDictionary Lexical

Analysis

Page 48: Spoken Language Support for Software Development

48

Homophones Cause Ambiguities

for i equals

for i =

4 i equals

foreeye ==

fore ayeequals foureyeequals

foriequals

Concatenated words cause them too

4

forefour

eyeaye

===

Page 49: Spoken Language Support for Software Development

49

Ambiguity-Aware Analysesfor i equals zero ...

LexicalAnalysis

FOR I

XGLRAmbiguous

Parsing

SemanticAmbiguityResolution

For Loop

FOR Assign Expr

I = 0

i LocalVar int

foureye

LocalVar ?4 EYE FOUREYE

Assign Expr

= 0

Ambig Stmt

Page 50: Spoken Language Support for Software Development

50

XGLR Parsing [Begel 04]

< XIF FIFTY FIVE

Page 51: Spoken Language Support for Software Development

51

XGLR Parsing [ Begel 04 ]

< XIF FIFTY FIVEKW

Page 52: Spoken Language Support for Software Development

52

XGLR Parsing [ Begel 04 ]

< XFIFTY FIVEIFKW

Page 53: Spoken Language Support for Software Development

53

XGLR Parsing [ Begel 04 ]

< XFIFTY FIVEIFKW

FIFTY 5

50 FIVE

50 5

55

ID

ID

#

#

#

#

ID

#

ID

< X

< X

< X

< X

Page 54: Spoken Language Support for Software Development

54

XGLR Parsing [ Begel 04 ]

FIFTY FIVEIFKW

FIFTY 5

50 FIVE

5

ID

ID

#

50#

55#

#

ID

#

ID

IFKW

IFKW

IFKW

IFKW

< X

< X

< X

< X

< XOp

Page 55: Spoken Language Support for Software Development

55

XGLR Parsing [ Begel 04 ]

FIFTY FIVEIFKW

FIFTY 5

50 FIVE

50 5

55

ID

ID

#

#

#

#

ID

#

ID

IFKW

IFKW

IFKW

IFKW

FIFTYIFKW

FIFTY

ID

IDIF

KW (

(

FIFTYIFKW

FIFTY

ID

IDIF

KW ..

< X

< X

< X

< X

X<Op

Page 56: Spoken Language Support for Software Development

56

XGLR Parsing [ Begel 04 ]

FIFTY FIVEIFKW

FIFTY 5

50 FIVE

50 5

55

ID

ID

#

#

#

#

ID

#

ID

IFKW

IFKW

IFKW

IFKW

FIFTYIFKW

FIFTY

ID

IDIF

KW (

(

FIFTYIFKW

FIFTY

ID

IDIF

KW ..

< X

< X

< X

< X

X<Op

FIVE

5

FIVE

5#

ID

#

ID< X

< X

< X

< X

Page 57: Spoken Language Support for Software Development

57

XGLR Parsing [ Begel 04 ]

FIFTY FIVEIFKW

FIFTY 5

50 FIVE

50 5

55

ID

ID

#

#

#

#

ID

#

ID

IFKW

IFKW

IFKW

IFKW

FIFTYIFKW

FIFTY

ID

IDIF

KW (

(

FIFTYIFKW

FIFTY

ID

IDIF

KW ..

< X

< X

< X

< X

X<Op

FIVE

5

FIVE

5#

ID

#

ID< X

< X

< X

< X

Page 58: Spoken Language Support for Software Development

58

XGLR Parsing [ Begel 04 ]

FIFTY FIVEIFKW

FIFTY 5

50 FIVE

50 5

55

ID

ID

#

#

#

#

ID

#

ID

IFKW

IFKW

IFKW

IFKW

FIFTYIFKW

FIFTY

ID

IDIF

KW (

(

FIFTYIFKW

FIFTY

ID

IDIF

KW ..

< X

< X

< X

< X

X<Op

FIVE

5

FIVE

5#

ID

#

ID< X

< X

< X

< X

Page 59: Spoken Language Support for Software Development

59

XGLR Parsing [ Begel 04 ]

55#

IFKW

FIFTYIFKW

FIFTY

ID

IDIF

KW (

(

FIFTYIFKW ID .

X<Op

FIVE

5

FIVEID

#

ID< X

< X

< X

Page 60: Spoken Language Support for Software Development

60

XGLR Parsing [ Begel 04 ]

55#

IFKW

FIFTYIFKW

FIFTY

ID

IDIF

KW (

(

FIFTYIFKW ID .

X<Op

FIVE

5

FIVEID

#

ID< X

< X

< X

FIFTYIFKW ID ( FIVE

ID

FIFTYIFKW ID ( FIVE

ID

FIFTYIFKW ID . FIVE

ID

FIFTYIFKW ID . FIVE

ID .

.(

(

< X

< X

< X

< X

FIFTYIFKW

FIFTY

ID

IDIF

KW (

( FIVE

5#

ID )

)

< X

< X

Page 61: Spoken Language Support for Software Development

61

XGLR Parsing [ Begel 04 ]

55#

IFKW

FIFTYIFKW

FIFTY

ID

IDIF

KW (

(

FIFTYIFKW ID .

X<Op

FIVE

5

FIVEID

#

ID< X

< X

< X

FIFTYIFKW ID ( FIVE

ID

FIFTYIFKW ID ( FIVE

ID

FIFTYIFKW ID . FIVE

ID

FIFTYIFKW ID . FIVE

ID .

.(

(

< X

< X

< X

< X

FIFTYIFKW

FIFTY

ID

IDIF

KW (

( FIVE

5#

ID )

)

< X

< X

Op

Op

Op

Op

Op

Op

Op

Op

Op

ID

Page 62: Spoken Language Support for Software Development

62

XGLR Parsing [ Begel 04 ]

55#

IFKW

FIFTYIFKW

FIFTY

ID

IDIF

KW (

(

FIFTYIFKW ID .

X<Op

FIVE

5

FIVEID

#

ID< X

< X

< X

FIFTYIFKW ID ( FIVE

ID

FIFTYIFKW ID ( FIVE

ID

FIFTYIFKW ID . FIVE

ID

FIFTYIFKW ID . FIVE

ID .

.(

(

< X

< X

< X

< X

FIFTYIFKW

FIFTY

ID

IDIF

KW (

( FIVE

5#

ID )

)

< X

< X

Op

Op

Op

Op

Op

Op

Op

Op

Op

ID

Page 63: Spoken Language Support for Software Development

63

XGLR Parsing [ Begel 04 ]

55#

IFKW

FIFTYIFKW

FIFTY

ID

IDIF

KW (

(

FIFTYIFKW ID .

X<Op

FIVE

5

FIVEID

#

ID< X

< X

< X

FIFTYIFKW

FIFTY

ID

IDIF

KW (

( FIVE

5#

ID )

)

< X

< X

Op

Op

Op

Op

Op

ID

Page 64: Spoken Language Support for Software Development

64

XGLR Parsing [ Begel 04 ]

55#

IFKW

FIFTYIFKW

FIFTY

ID

IDIF

KW (

(

FIFTYIFKW ID .

X<Op

FIVE

5

FIVEID

#

ID< X

< X

< X

FIFTYIFKW

FIFTY

ID

IDIF

KW (

( FIVE

5#

ID )

)

< X

< X

Op

Op

Op

Op

Op

ID

ID

ID

ID

ID

ID

Page 65: Spoken Language Support for Software Development

65

XGLR Parsing [ Begel 04 ]

55#

IFKW

FIFTYIFKW

FIFTY

ID

IDIF

KW (

(

FIFTYIFKW ID .

X<Op

FIVE

5

FIVEID

#

ID< X

< X

< X

FIFTYIFKW

FIFTY

ID

IDIF

KW (

( FIVE

5#

ID )

)

< X

< X

Op

Op

Op

Op

Op

ID

ID

ID

ID

ID

ID

Page 66: Spoken Language Support for Software Development

66

XGLR Parsing [ Begel 04 ]

55#

IFKW

FIFTYIFKW ID .

X<Op

FIVEID

< X

FIFTYIFKW

FIFTY

ID

IDIF

KW (

( FIVE

5#

ID )

)

< X

< X

Op

Op

Op

ID

ID

ID

ID

FIFTYIFKW

FIFTY

ID

IDIF

KW (

( FIVE

5#

ID< X

< X

Op

Op

ID

ID

Page 67: Spoken Language Support for Software Development

67

XGLR Parsing [ Begel 04 ]

55#

IFKW

FIFTYIFKW

FIFTY

ID

IDIF

KW (

(

FIFTYIFKW ID .

X<Op

FIVE

5

FIVEID

#

ID< X

< X

< X

FIFTYIFKW

FIFTY

ID

IDIF

KW (

( FIVE

5#

ID )

)

< X

< X

Op

Op

Op

Op

Op

ID

ID

ID

ID

ID

ID

Expr

ExprExpr

ExprFuncCall

ExprFuncCall

Page 68: Spoken Language Support for Software Development

68

XGLR Summary

• Generalization of traditional GLR algorithm– Forks on structural and lexical ambiguity– Preserves subtree sharing when parses have

different yields– Retains efficiency when parses get out of sync

• Determine parse position w.r.t. ambiguous input

• Blender: Combined lexer and parser generator for XGLR

Page 69: Spoken Language Support for Software Development

69

GLR Parsing Genealogy

Tomita1985

Farshi1991

Rekers1992

Wagner1997

Visser1997

van den Brand2002

Begel2004

Incremental

Scannerless

Johnstone, Scott2002

Input StreamAmbiguities

Page 70: Spoken Language Support for Software Development

70

Ambiguity-Aware Analysesfor i equals zero ...

LexicalAnalysis

FOR I

XGLRAmbiguous

Parsing

SemanticAmbiguityResolution

For Loop

FOR Assign Expr

I = 0

i LocalVar int

foureye

LocalVar ?4 EYE FOUREYE

Assign Expr

= 0

Ambig Stmt

Page 71: Spoken Language Support for Software Development

71

Disambiguation Exampleclass Loader {

public void load() { String filetoload = null;InputStream stream =

getStream();... ▌

}}

file to load equals stream dot read string

filetoload = stream.readString();

Page 72: Spoken Language Support for Software Development

72

Many Interpretations

file(2, lowed)

file(to, load) file(to.lode) file(to(lode)) file(toload)

(file, 2, load)

file.to.lowed file.to(load)

file.toload filetoload() filetoload

Page 73: Spoken Language Support for Software Development

73

Incremental Semantics• What does this name mean? • What names are visible at this program

point?– Or, What can I say here?

• Visibility Graph [Garrison 1987]– Incrementally updated data structure for scopes, names

and bindings– Designed Visibility Graph algorithms for name

propagation and incremental update– Used for type checking, too

• Doesn’t <insert favorite IDE here> do this?

Page 74: Spoken Language Support for Software Development

74

Program Context Can Helpclass Loader {

public void load() {String filetoload = null;InputStream stream =

getStream();... ▌

}}

class Loaderscope

[ load, Method, () void ]

method loadscope

[ filetoload, LocalVar, String ][ stream, LocalVar, InputStream ]

Page 75: Spoken Language Support for Software Development

75

Program Context Can Helpclass Loader {

public void load() {String filetoload = null;InputStream stream =

getStream();... ▌

}}

class Loaderscope

[ load, Method, () void ]

method loadscope

[ filetoload, LocalVar, String ][ stream, LocalVar, InputStream ][ load, Method, () void ]

Page 76: Spoken Language Support for Software Development

76

Semantic Disambiguation

file(2, lowed)

file(to, load) file(to.lode) file(to(lode)) file(toload)

(file, 2, load)

file.to.lowed

file.to(load)

file.toload filetoload() filetoload

class Loaderscope

[ load, Method, () void ]

method loadscope

[ filetoload, LocalVar, String ][ stream, LocalVar, InputStream ][ load, Method, () void ]

Page 77: Spoken Language Support for Software Development

77

Semantic Disambiguation

file(2, lowed)

file(to, load) file(to.lode) file(to(lode)) file(toload)

(file, 2, load)

file.to.lowed

file.to(load)

file.toload filetoload() filetoload

class Loaderscope

[ load, Method, () void ]

method loadscope

Is “file” a visible variable name?

[ filetoload, LocalVar, String ][ stream, LocalVar, InputStream ][ load, Method, () void ]

Page 78: Spoken Language Support for Software Development

78

Semantic Disambiguation

file(2, lowed)

file(to, load) file(to.lode) file(to(lode)) file(toload)

filetoload() filetoload

class Loaderscope

[ load, Method, () void ]

method loadscope

Is “file” a visible method name?

[ filetoload, LocalVar, String ][ stream, LocalVar, InputStream ][ load, Method, () void ]

Page 79: Spoken Language Support for Software Development

79

Semantic Disambiguation

filetoload() filetoload

class Loaderscope

[ load, Method, () void ]

method loadscope

Is “filetoload” a visible method name?

[ filetoload, LocalVar, String ][ stream, LocalVar, InputStream ][ load, Method, () void ]

Page 80: Spoken Language Support for Software Development

80

Manual Disambiguation• Some ambiguities cannot (and should not) be

automatically resolved:

print(“line”) vs. println()

if (pred1) then if (pred2) then foo() else bar()

• If ambiguities remain, ask the user how to resolve them. (e.g. [Mankoff 00])

if

foo()

if

bar()

if

if

foo()

bar()

Page 81: Spoken Language Support for Software Development

81

Talk Outline

• Introduction and Motivation• Programming by Voice• Program Analyses for Ambiguous Inputs SPEech EDitor Programming

Environment• SPEED User Study• Conclusion

Page 82: Spoken Language Support for Software Development

82

SPEED Editor

Page 83: Spoken Language Support for Software Development

83

Speech Editing Model

Code TemplateInsertion

ToggleMicrophone

Page 84: Spoken Language Support for Software Development

84

Speech Editing Model

Choose FromAlternatives

Page 85: Spoken Language Support for Software Development

85

Speech Editing Model

Page 86: Spoken Language Support for Software Development

86

Speech Editing Model

Page 87: Spoken Language Support for Software Development

87

Context-Sensitive Mouse Grid

Page 88: Spoken Language Support for Software Development

88

What Can I Say/Type?

Page 89: Spoken Language Support for Software Development

89

Cache Pad

Page 90: Spoken Language Support for Software Development

90

Talk Outline

• Introduction and Motivation• Programming by Voice• Program Analyses for Ambiguous Inputs• SPEech EDitor Programming Environment SPEED User Study• Conclusion

Page 91: Spoken Language Support for Software Development

91

Study - SPEED UsabilityGoal: Understand how SPEED can be used

by expert programmers

Hypothesis: SPEED is learnable and usable for standard programming tasks

1. Train 5 expert Java programmers on SPEED2. Create and modify code

– Build a Linked List data structure with associated algorithms

• 3 programmers used commercial speech recognizer2 programmers used human speech recognizer

Page 92: Spoken Language Support for Software Development

92

Metrics

• Number of Commands/Dictations• Features Used

– Code Templates, Dictation, Navigation, Editing, Fixing Mistakes

• Quantity and Kinds of Mistakes– Speech Recognition, SPEED, User

Page 93: Spoken Language Support for Software Development

93

Results

• Accuracy of commercial speech recognizers was horrible (25-50%). Human SR was much better (10-20%).

• Recognition delay was equal for both recognizers (0.5-0.75 sec)

Page 94: Spoken Language Support for Software Development

94

Results

• Commands were easy to learn and remember.– Very few user mistakes

• Most commands spoken for code templates and editing.– GOMS analysis predicts speech will be slower

until you can get a lot of text for each utterance• Speakers were apprehensive about speaking

code instead of describing it via code templates.

Page 95: Spoken Language Support for Software Development

95

Study Conclusion

• SPEED is learnable in a short amount of time

• Programming-by-voice is slower than typing– Programmers would not want to use it until

they had to• Programmers believed they would be

efficient enough using SPEED to remain in software engineering jobs

Page 96: Spoken Language Support for Software Development

96

Talk Outline

• Introduction and Motivation• Programming by Voice• Program Analyses for Ambiguous Inputs• SPEech EDitor Programming Environment• SPEED User Study Conclusion

Page 97: Spoken Language Support for Software Development

97

Contributions

1. A study of programmers to understand and design a naturally verbalizable input for programming

2. An interactive editor designed for spoken interaction

3. The use of syntax and semantics of programming for disambiguation– Enhanced lexical, syntactic, semantic analyses for

support of verbal ambiguities4. Evaluation of design and tools by studying

programmers using voice for software development

Page 98: Spoken Language Support for Software Development

98

SPEED Next Steps

• Add more code templates– Enable users to write their own

• Add “Jump To <arbitrary code here>”• Find new ways to edit strings by voice• Integrate speech recognition with other IDE

features– GUI, code completion, debugger

Page 99: Spoken Language Support for Software Development

99

Further SPEED Studies

• Develop methodology for short-term voice recognition studies

• Find out why programmers felt code dictation was weird.

• Evaluate more complex code editing operations by voice

• Evaluate context-sensitive mouse grid usability

Page 100: Spoken Language Support for Software Development

100

Future of Programming by Voice1. Improved automation of semantic disambiguation

– Use ideas from NLP, Machine Learning (team styles)

2. Early pruning of ambiguities using analysis feedback3. Higher-level linguistic programming tools

– Transformations, Paraphrasing– Phonetic search, Audible feedback

4. Support more software engineering tasks by voice– Debuggers, IDEs, Comments, Code reviews

5. Design spoken variants of other formal languages– General (C, C#) Scripting (PL, OS), Design (HCI),

Command (Robotics), Domain-specific languages (SQL)

Page 101: Spoken Language Support for Software Development

101

Any Questions?

Andrew Begel: [email protected]