Two Studies of Opportunistic Programming: Interleaving Web Foraging, Learning, and Writing Code

Two Studies of Opportunistic Programming: Interleaving Web Foraging, Learning, and Writing Code

CHI 2009 ~ Software Development April 8th, 2009 ~ Boston, MA, USA Two Studies of Opportunistic Programming: Interleaving Web Foraging, Learning, and Writing Code Joel Brandt1,2, Philip J. Guo1, Joel Lewenstein1, Mira Dontcheva2, Scott R. Klemmer1 1Stanford University HCI Group 2Advanced Technology Labs Computer Science Department Adobe Systems Stanford, CA 94305 San Francisco, CA 94103 {jbrandt, pg, jlewenstein, srk}@cs.stanford.edu [email protected] ABSTRACT formation on the Web, learning from that information, and This paper investigates the role of online resources in prob- authoring code. Over the course of two hours, she used the lem solving. We look specifically at how programmers—an Web 27 times, accounting for 28% of the total time she spent exemplar form of knowledge workers—opportunistically in- building her application. This participant’s behavior is il- terleave Web foraging, learning, and writing code. We de- lustrative of programmers’ increasing use of the Web as a scribe two studies of how programmers use online resources. problem-solving tool. How and why do people leverage on- The first, conducted in the lab, observed participants’ Web line resources while programming? use while building an online chat room. We found that pro- grammers leverage online resources with a range of inten- Web use is integral to an opportunistic approach to program- tions: They engage in just-in-time learning of new skills and ming that emphasizes speed and ease of development over approaches, clarify and extend their existing knowledge, and code robustness and maintainability [4, 13, 8]. Program- remind themselves of details deemed not worth remember- mers do this to prototype, ideate, and discover—to address ing. The results also suggest that queries for different pur- questions best answered by creating a piece of functional poses have different styles and durations. Do programmers’ software. This type of programming is widespread, per- queries “in the wild” have the same range of intentions, or formed by novices and experts alike: it happens when de- is this result an artifact of the particular lab setting? We an- signers build functional prototypes to explore ideas, when alyzed a month of queries to an online programming portal, scientists write code to control laboratory experiments, when examining the lexical structure, refinements made, and re- entrepreneurs assemble complex spreadsheets to better un- sult pages visited. Here we also saw traits that suggest the derstand how their business is operating, and when profes- Web is being used for learning and reminding. These results sionals adopt agile development methods to build applica- contribute to a theory of online resource usage in program- tions quickly [4, 8, 30, 25, 27]. Scaffidi, Shaw, and Myers ming, and suggest opportunities for tools to facilitate online estimate that in 2012 there will be 13 million people in the knowledge work. USA that describe themselves as “programmers”, while the Bureau of Labor Statistics estimates that there will only be 3 million “professional programmers” [30]. We believe there Author Keywords is significant value in understanding and designing for this opportunistic programming, prototyping, copy-and-paste large population of amateur programmers. ACM Classification Keywords To create software more quickly, programmers often take a H.5.2 Information Interfaces and Presentation: User bricolage approach by tailoring or mashing up existing sys- Interfaces—prototyping; user-centered design tems [33, 21, 23, 34, 14]. As part of this process, they must often search for suitable components and learn new INTRODUCTION skills [4]. Recently, programmers began using the Web for “Good grief, I don’t even remember the syntax for forms!” this purpose [32, 15]. How do these individuals forage for Less than a minute later, this participant in our Web pro- online resources, and how is Web use integrated into the gramming lab study had found an example of an HTML form broader task of programming? This paper contributes the online, successfully integrated it into her own code, adapted first strong empirical evidence of how programmers use on- it for her needs, and moved onto a new task. As she con- line resources in practice. tinued to work, she frequently interleaved foraging for in- We present the results of two studies that investigate how programmers leverage online resources. The first asked 20 programmers to rapidly prototype a Web application in the Permission to make digital or hard copies of all or part of this work for lab. The second quantitatively analyzed a month-long sam- personal or classroom use is granted without fee provided that copies are ple of Web query data. 24,293 programmers produced the not made or distributed for profit or commercial advantage and that copies 101,289 queries in the sample. We employed this mixed- bear this notice and the full citation on the first page. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific methods approach to gather data that is both contextually permission and/or a fee. rich and authentic [12, 5]. CHI 2009, April 4–9, 2009, Boston, Massachusetts, USA. Copyright 2009 ACM 978-1-60558-246-7/09/04...$5.00. 1589 CHI 2009 ~ Software Development April 8th, 2009 ~ Boston, MA, USA Self-Rated RELATED WORK Tasks Completed Proficiency This paper builds on three bodies of related work: studies of how programmers reason and learn, investigations of code copying and reuse, and the design of systems that help pro- Update grammers better leverage the Web. AJAX HTML AJAX PHP Subject # Username JavaScript Post History Experience Timestamp There is a long history of research on cognitive aspects of 1 11 7 4 6 5 ••••• 2 17 5 4 2 1 •••• programming, summarized well in Detienne’s´ book [11] and 3 13 7 5 5 2 •••• Mayer’s survey on how novices learn to program [26]. Most 4 4 6 4 5 2 ••••• relevant to our work, Ko et al. observed novice program- 5 15 6 7 6 5 ••••• mers for a semester as they learned to use Visual Basic 6 2 6 5 3 4 ••••• ••••• .NET [19]. The researchers classified all occurrences of in- 7 7 5 4 4 4 8 8 5 2 4 2 ••• surmountable barriers, defined as problems that could only 9 5 7 2 5 6 •••• be overcome by turning to external resources. They identi- 10 6 5 3 4 2 ••••• fied six classes of barriers—design, selection, coordination, 11 13 4 5 5 5 ••••• use, understanding, and information—and suggested ways 12 2 6 3 5 2 ••••• 13 6 7 4 5 2 ••••• that tools could lower these barriers. This work is largely 14 1 5 3 3 2 ••••• complementary to ours—while they provide insight into the 15 8 5 2 3 2 ••••• problems that programmers face, there is little discussion of 16 8 7 7 6 7 ••••• how programmers currently overcome these barriers. 17 15 7 2 7 2 ••••• 18 7 5 4 5 4 ••••• Prior research in software engineering has studied code 19 13 5 5 4 5 ••••• cloning within software projects through both automated [3, 20 5 6 3 6 2 •••• 10] and ethnographic [18] approaches. Many of Kim et al.’s Table 1. Demographic information on the 20 participants in our lab insights—most notably that it would be valuable for tools study. Experience is given in number of years; self-rated proficiency to record and visualize dependencies created when copy- uses a Likert scale from 1 to 7, with 1 representing “not at all profi- ing and pasting code—could prove valuable when design- cient” and 7 representing “extremely proficient”. ing tools for opportunistic programming. However, because this software engineering research has been focused on min- imizing intra-project duplicated code to reduce maintenance STUDY 1: OPPORTUNISTIC PROGRAMMING IN THE LAB costs [17], it has generally ignored the potential value of We conducted an exploratory study in our lab to understand copying code for learning and for between-project usage. how programmers leverage online resources, especially for rapid prototyping. There has been recent interest in building improved Web search and data mining tools for programmers [32, 29, 15, Method 2]. Stylos and Myers describe how programmers may learn 20 Stanford University students (3 female), all proficient pro- APIs, based on observations of three “small programming grammers, participated in a 2.5-hour session. The partici- projects” [32]. They suggest that programmers begin with pants (5 Ph.D., 4 Masters, 11 undergraduate) had an average initial design ideas, gain a high-level understanding of po- of 8.3 years of programming experience; all except three had tential APIs to use, and then finalize the details by finding at least 4 years of experience. However, the participants had and integrating examples, which may cause them to return little professional experience: only one spent more than 1 to earlier steps. The authors suggest that programmers use year as a professional developer. the Web at all three stages, but in very different ways at each stage. As part of designing a Web search tool for program- When recruiting, we specified that participants should have mers, Hoffmann et al. classified Web search sessions about basic knowledge of PHP, JavaScript, and the AJAX paradigm. Java programming into 11 search goals (e.g. beginner tuto- However, 13 participants rated themselves as novices in at rials, APIs, and language syntax) [15]. We extend this liter- least one of the technologies involved. (Further demographic ature by providing richer data, a clearer picture of how pro- information is presented in Table 1.) Participants were com- grammers go about performing these searches, and how they pensated with their choice of class research credit (where leverage foraged Web content. applicable) or a $99 Amazon.com gift certificate.

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    10 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us