two studies of opportunistic programming: interleaving web foraging, learning, and writing code
DESCRIPTION
Two Studies of Opportunistic Programming: Interleaving Web Foraging, Learning, and Writing Code. Joel Brandt with Philip Guo (S), Joel Leweinstein (S), Mira Dontcheva (A), Scott Klemmer (S), . http:// hci.stanford.edu /opportunistic. - PowerPoint PPT PresentationTRANSCRIPT
Stanford HCI Group Adobe Advanced Technology Labs
Two Studies ofOpportunistic Programming: Interleaving Web Foraging, Learning, and Writing Code
Joel Brandtwith Philip Guo (S), Joel Leweinstein (S), Mira Dontcheva (A), Scott
Klemmer (S),
http://hci.stanford.edu/opportunistic
15
The Web has fundamentally changed the cost structure
of information access.
Enables an opportunistic
approach to programming
16
People program opportunistically to prototype, ideate, and discover
Emphasize speed and ease of development over code robustness
and maintainability
20
By 2012:13 million who program as part of their job…
…but only 3 million who are
professional programmers
[Scaffidi 2005]
22
Related WorkWeb Search for Programmers
[Stylos 06, Hoffmann 07]
Code Cloning in Software Engineering[Kim 04, Ducasse 99]
Learning Barriers of Programming[Ko 04]
Learning on the Web[Torrey 09]
24
Study 1: Web Chat Room 20 participants (9 Graduate, 11
Undergrad) “basic knowledge” of PHP, JS, and
HTML 2.5 hours each use any resources 3 researchers observed,
one asked questions to prompt think aloud
METHOD
25
Chat Room Specifications
1. Set username
2. Post messages
3. Update without page reload
4. Messages have timestamp
5. Limited chat history
METHOD
27
Most Subjects Met All Specs
� � � �� � � � �� � �� � � � �� � � � �� � � � �� � � � �� � � �� � � � �� � � � �� � � � �� � � �� � � � �� � � � �� � � �� � � � �� � � � �� � � � �� � � � �� � � � �
user
nam
epo
st m
essa
geAJ
AX u
pdat
etim
esta
mp
hist
ory
� Specification Met
� Specification Attempted
subj
ects
RESULTS
35
Three Intentions Behind Web UseLearning
just-in-time acquisition of new skills
Clarification connecting high-level knowledge to implementation details
Reminder offloading memory to external resources
RESULTS
37
“There’s some stuff in this code that I don’t really know
what it’s doing, but I’ll just try it and
see what happens.”
38
Just-in-Time Learning-by-DoingCopy and modify code before reading prose
Not concerned with deep learning
RESULTS
39
“I think it’s less expensive for me to just take the first code I find and see how helpful it is at … a very high level … as
opposed to just reading all these
descriptions and text”
40
Just-in-Time Learning-by-DoingCopy and modify code before reading prose
Not concerned with deep learning
Learn new terminology from result snippets
RESULTS
41
Example Query
Terms
TimeNumber of
Refinements
Number of Result Clicks
Types of pages visited
Lines of code
copied
42
Learning
Example Query
Terms
TimeNumber of
Refinements
Number of Result Clicks
Types of pages visited
Lines of code
copied
43
Learning
Example Query ajax tutorial
Terms
TimeNumber of
Refinements
Number of Result Clicks
Types of pages visited
Lines of code
copied
44
Learning
Example Query ajax tutorial
Terms English
TimeNumber of
Refinements
Number of Result Clicks
Types of pages visited
Lines of code
copied
45
Learning
Example Query ajax tutorial
Terms English
Time 10s of minutes
Number of Refinement
sNumber of
Result Clicks
Types of pages visited
Lines of code
copied
46
Learning
Example Query ajax tutorial
Terms English
Time 10s of minutes
Number of Refinement
s2-3
Number of Result Clicks
Types of pages visited
Lines of code
copied
47
Learning
Example Query ajax tutorial
Terms English
Time 10s of minutes
Number of Refinement
s2-3
Number of Result Clicks
5+Types of
pages visited
Lines of code
copied
48
Learning
Example Query ajax tutorial
Terms English
Time 10s of minutes
Number of Refinement
s2-3
Number of Result Clicks
5+Types of
pages visited
tutorials, how-to articles
Lines of code
copied
49
Learning
Example Query ajax tutorial
Terms English
Time 10s of minutes
Number of Refinement
s2-3
Number of Result Clicks
5+Types of
pages visited
tutorials, how-to articles
Lines of code
copieddozens
50
Clarification of Existing Knowledge
Web search enables translations and “language analogies”
Know exactly what code does when they see it
Copied code often not immediately tested
RESULTS
51
Learning
Example Query ajax tutorial
Terms English
Time 10s of minutes
Number of Refinement
s2-3
Number of Result Clicks
5+Types of
pages visited
tutorials, how-to articles
Lines of code
copieddozens
52
Learning Clarification
Example Query ajax tutorial
Terms English
Time 10s of minutes
Number of Refinement
s2-3
Number of Result Clicks
5+Types of
pages visited
tutorials, how-to articles
Lines of code
copieddozens
53
Learning Clarification
Example Query ajax tutorial javascript
thread
Terms English
Time 10s of minutes
Number of Refinement
s2-3
Number of Result Clicks
5+Types of
pages visited
tutorials, how-to articles
Lines of code
copieddozens
54
Learning Clarification
Example Query ajax tutorial javascript
thread
Terms English mix of code and English
Time 10s of minutes
Number of Refinement
s2-3
Number of Result Clicks
5+Types of
pages visited
tutorials, how-to articles
Lines of code
copieddozens
55
Learning Clarification
Example Query ajax tutorial javascript
thread
Terms English mix of code and English
Time 10s of minutes
about 1 minute
Number of Refinement
s2-3
Number of Result Clicks
5+Types of
pages visited
tutorials, how-to articles
Lines of code
copieddozens
56
Learning Clarification
Example Query ajax tutorial javascript
thread
Terms English mix of code and English
Time 10s of minutes
about 1 minute
Number of Refinement
s2-3 0-1
Number of Result Clicks
5+Types of
pages visited
tutorials, how-to articles
Lines of code
copieddozens
57
Learning Clarification
Example Query ajax tutorial javascript
thread
Terms English mix of code and English
Time 10s of minutes
about 1 minute
Number of Refinement
s2-3 0-1
Number of Result Clicks
5+ 1-2Types of
pages visited
tutorials, how-to articles
Lines of code
copieddozens
58
Learning Clarification
Example Query ajax tutorial javascript
thread
Terms English mix of code and English
Time 10s of minutes
about 1 minute
Number of Refinement
s2-3 0-1
Number of Result Clicks
5+ 1-2Types of
pages visited
tutorials, how-to articles
API docs, blogs, forums
Lines of code
copieddozens
59
Learning Clarification
Example Query ajax tutorial javascript
thread
Terms English mix of code and English
Time 10s of minutes
about 1 minute
Number of Refinement
s2-3 0-1
Number of Result Clicks
5+ 1-2Types of
pages visited
tutorials, how-to articles
API docs, blogs, forums
Lines of code
copieddozens several
60
Reminding about forgotten details Explicitly choose not to learn
things Search serves as “Web-
enabled auto-complete”
RESULTS
63
Reminding about forgotten details Explicitly choose not to learn
things Search serves as “Web-
enabled auto-complete” Despite utility, can break flow
RESULTS
64
Learning Clarification
Example Query ajax tutorial javascript
thread
Terms English mix of code and English
Time 10s of minutes
about 1 minute
Number of Refinement
s2-3 0-1
Number of Result Clicks
5+ 1-2Types of
pages visited
tutorials, how-to articles
API docs, blogs, forums
Lines of code
copieddozens several
65
Learning Clarification Reminder
Example Query ajax tutorial javascript
thread
Terms English mix of code and English
Time 10s of minutes
about 1 minute
Number of Refinement
s2-3 0-1
Number of Result Clicks
5+ 1-2Types of
pages visited
tutorials, how-to articles
API docs, blogs, forums
Lines of code
copieddozens several
66
Learning Clarification Reminder
Example Query ajax tutorial javascript
threadfetch_array
php
Terms English mix of code and English
Time 10s of minutes
about 1 minute
Number of Refinement
s2-3 0-1
Number of Result Clicks
5+ 1-2Types of
pages visited
tutorials, how-to articles
API docs, blogs, forums
Lines of code
copieddozens several
67
Learning Clarification Reminder
Example Query ajax tutorial javascript
threadfetch_array
php
Terms English mix of code and English mostly code
Time 10s of minutes
about 1 minute
Number of Refinement
s2-3 0-1
Number of Result Clicks
5+ 1-2Types of
pages visited
tutorials, how-to articles
API docs, blogs, forums
Lines of code
copieddozens several
68
Learning Clarification Reminder
Example Query ajax tutorial javascript
threadfetch_array
php
Terms English mix of code and English mostly code
Time 10s of minutes
about 1 minute
less than 1 minute
Number of Refinement
s2-3 0-1
Number of Result Clicks
5+ 1-2Types of
pages visited
tutorials, how-to articles
API docs, blogs, forums
Lines of code
copieddozens several
69
Learning Clarification Reminder
Example Query ajax tutorial javascript
threadfetch_array
php
Terms English mix of code and English mostly code
Time 10s of minutes
about 1 minute
less than 1 minute
Number of Refinement
s2-3 0-1 0
Number of Result Clicks
5+ 1-2Types of
pages visited
tutorials, how-to articles
API docs, blogs, forums
Lines of code
copieddozens several
70
Learning Clarification Reminder
Example Query ajax tutorial javascript
threadfetch_array
php
Terms English mix of code and English mostly code
Time 10s of minutes
about 1 minute
less than 1 minute
Number of Refinement
s2-3 0-1 0
Number of Result Clicks
5+ 1-2 0-1Types of
pages visited
tutorials, how-to articles
API docs, blogs, forums
Lines of code
copieddozens several
71
Learning Clarification Reminder
Example Query ajax tutorial javascript
threadfetch_array
php
Terms English mix of code and English mostly code
Time 10s of minutes
about 1 minute
less than 1 minute
Number of Refinement
s2-3 0-1 0
Number of Result Clicks
5+ 1-2 0-1Types of
pages visited
tutorials, how-to articles
API docs, blogs, forums
API docs,result
snippetsLines of
code copied
dozens several
72
Learning Clarification Reminder
Example Query ajax tutorial javascript
threadfetch_array
php
Terms English mix of code and English mostly code
Time 10s of minutes
about 1 minute
less than 1 minute
Number of Refinement
s2-3 0-1 0
Number of Result Clicks
5+ 1-2 0-1Types of
pages visited
tutorials, how-to articles
API docs, blogs, forums
API docs,result
snippetsLines of
code copied
dozens several none to several
74
Study 2: Query Log Analysis Adobe Community Help logs from July
2008 ~25,000 programmers performing
101,289 queries about Adobe Flex Framework
Grouped queries into 65,955 search sessions
Analyzed three properties of sessions: Format of query strings Process of query refinement Types of Web pages visited
Hand-coded 300 sessions for intent
METHOD
76
Query format predicts types of pages visited
Page type code only English + code English only
Adobe APIs 38% 16% 10%Adobe tutorials 31% 33% 39%
blogs 15% 22% 19%forums 3% 7% 6%
unclassified 13% 22% 27%All inter-row differences significant at p < 0.001
RESULTS
77
Query format predicts types of pages visited
Page type code only English + code English only
Adobe APIs 38% 16% 10%Adobe tutorials 31% 33% 39%
blogs 15% 22% 19%forums 3% 7% 6%
unclassified 13% 22% 27%
RESULTS
All inter-row differences significant at p < 0.001
78
Query format predicts types of pages visited
Page type code only English + code English only
Adobe APIs 38% 16% 10%Adobe tutorials 31% 33% 39%
blogs 15% 22% 19%forums 3% 7% 6%
unclassified 13% 22% 27%
RESULTS
All inter-row differences significant at p < 0.001
79
Query format predicts types of pages visited
Page type code only English + code English only
Adobe APIs 38% 16% 10%Adobe tutorials 31% 33% 39%
blogs 15% 22% 19%forums 3% 7% 6%
unclassified 13% 22% 27%
RESULTS
All inter-row differences significant at p < 0.001
81
Query format indicative of intention
query format reminding learning
code only 56% 21%English + code 10% 29%
English only 34% 50%
RESULTS
All inter-row differences significant at p < 0.05
84
…and they start out with either words or code
RESULTS
perc
ent o
f que
ries
query number in session
88
Web search often used as a “translator”
Improve search ranking with synonyms,
perform searches automatically
96
Learning Clarification Reminder
Example Query ajax tutorial javascript
threadfetch_array
php
Terms English mix of code and English mostly code
Time 10s of minutes
about 1 minute
less than 1 minute
Number of Refinement
s2-3 0-1 0
Number of Result Clicks
5+ 1-2 0-1Types of
pages visited
tutorials, how-to articles
API docs, blogs, forums
API docs,result
snippetsLines of
code copied
dozens several none to several