Software Development with Real-Time Collaborative Editing
Total Page:16
File Type:pdf, Size:1020Kb
Software Development with Real-Time Collaborative Editing by Max Goldman S.B., Massachusetts Institute of Technology (2004) M.S., Technion - Israel Institute of Technology (2006) Submitted to the Department of Electrical Engineering and Computer Science in partial fulfillment of the requirements for the degree of Doctor of Philosophy at the MASSACHUSETTS INSTITUTE OF TECHNOLOGY September 2012 © Massachusetts Institute of Technology 2012. All rights reserved. Author................................................................ Department of Electrical Engineering and Computer Science August 30, 2012 Certified by. Robert C. Miller Associate Professor Thesis Supervisor Accepted by . Leslie A. Kolodziejski Professor Chair, Department Committee on Graduate Students 2 Software Development with Real-Time Collaborative Editing by Max Goldman Submitted to the Department of Electrical Engineering and Computer Science on August 30, 2012, in partial fulfillment of the requirements for the degree of Doctor of Philosophy Abstract This thesis presents Collabode, a web-based integrated development environment for Java. With real-time collaborative editing, multiple programmers can use Collabode to edit the same source code at the same time. Collabode introduces error-mediated integration, where multiple editors see the text of one another’s changes while being isolated from errors and in-progress work, and error-free changes are integrated auto- matically. Three models of collaborative programming are presented and evaluated using Collabode. Classroom programming brings zero-setup web-based programming to computer science students working in a classroom or lab. Test-driven pair program- ming combines two existing software development strategies to create a model with clear roles and explicit tool support. And micro-outsourcing enables one programmer to easily request and integrate very small contributions from many distributed assis- tants, demonstrating how a system for highly-collaborative programming enables a development model infeasible with current tools. To show that highly-collaborative programming, using real-time collaborative edit- ing of source code, is practical, useful, and enables new models of software develop- ment, this thesis presents a series of user studies. A study with pairs of both student and professional programmers shows that error-mediated integration allows them to work productively in parallel. In a semester-long deployment of Collabode, students in an MIT software engineering course used the system for classroom programming. In a lab study of a Collabode prototype, professional programmers used test-driven pair programming. Finally, a study involving both in-lab participants and contractors hired online demonstrated how micro-outsourcing allowed participants to approach programming in a new way, one enabled by collaborative editing, automatic error- mediated integration, and a web-based environment requiring no local setup. Thesis Supervisor: Robert C. Miller Title: Associate Professor 3 4 Acknowledgments Stephen Benton, Holographic Imaging My advisor, Rob Miller. The other members of my thesis committee, Daniel Jackson and Li-Te Cheng. Greg Little. Angela Chang, Patrick Yamane, and Robin Cheng, who contributed to this project. All the members of the User Interface Design Group: Michael Bernstein, Adam Marcus, Katrina Panovich, Igor Kopylov, Vikki Fritz, Matthew Webber, Juho Kim, Lydia Chilton, Chen-Hsiang Yu, Tom Lieber, Mason Tang, David Huynh, Eirik Bakke, Max Van Kleek, Tsung-Hsiang Chang, Sangmok Han, Michael Bolin, and all those I have failed to mention. Many other researchers at CSAIL and elsewhere: Eunsuk Kang, Eugene Wu, Hubert Pham, Andrew Begel, Jeff Bigham, Joel Brandt, Elena Agapie—and all those I have still failed to mention. My academic advisor, Silvio Micali. And my master’s degree advisor at the Technion, Shmuel Katz. Other professors, lecturers, recitation instructors, teaching assistants, lab assis- tants, and teachers far too numerous to mention. Maria Rebelo and Sally Lee, administrative assistants. Jack Costanza, Anthony Zolnik, and the other members of The Infrastructure Group at CSAIL. Tayeb Karim, Jay Goldman, Adam Marcus, and Matti Klock, all instrumental in organizing user studies. The many people who participated in those studies. Yaron Binur, Anat Binur, Theodore Golfinopoulos, and other MEET staff and students too numerous to mention. Michael Ouellette. David Signoff, Michael Zhivich, Alex Hill, Lisa Messeri, and others. My parents Marianne and Jay, my sister Julie, and my family; Alice Reyzin. 5 This work was supported in part by the National Science Foundation under award numbers IIS-0447800 and SOCS-1111124, and by Quanta Computer as part of the T-Party Project. oDesk Research provided funding to hire contractors. Any opinions, findings, conclusions, or recommendations in this thesis are the author’s, and they do not necessarily reflect the views of the sponsors. 6 Contents 1 Introduction 17 1.1 Collabode: A Web IDE . 17 1.2 Error-Mediated Integration . 18 1.3 Models of Collaborative Programming . 19 1.4 Contributions . 20 1.4.1 A Web-Based Collaborative IDE . 20 1.4.2 Novel Applications . 21 1.5 Outline . 21 2 Related Work 23 2.1 Programming Methodologies . 23 2.1.1 Pair Programming . 23 2.1.2 Side-by-Side Programming . 25 2.1.3 Chief Programmer Teams . 25 2.2 Collaborative Editing . 26 2.3 Development Tools . 26 3 Collabode 29 3.1 Architecture . 30 3.2 IDE User Interface . 32 3.3 Error-Mediated Integration . 33 3.3.1 From One to Many . 34 3.3.2 Algorithm . 37 7 3.3.3 Merging and Transforming Edits . 39 3.3.4 Editing Edits . 40 3.3.5 Initial Conditions . 41 3.3.6 Limitations and Assumptions . 42 3.3.7 Implementation with Coordinate Maps . 43 3.3.8 User Interface . 45 3.4 Evaluation: Comparison to Manual Integration . 47 3.5 Evaluation: Side-by-Side Programming . 48 3.5.1 Procedure . 48 3.5.2 Does the Set of Un-Integrated Regions Remain Small? . 50 3.5.3 Is the Algorithm an Improvement Over Integrating Only Error- Free Code? . 51 3.5.4 Can Developers Work Concurrently? . 52 3.5.5 Feedback: Collaborative Coding . 53 3.5.6 Feedback: Automatic Integration . 54 3.5.7 Feedback: Missing Pieces . 55 3.6 Conclusion . 56 4 Classroom Programming 59 4.1 Inspiration . 60 4.2 6.005 Recitations . 61 4.2.1 Cloning . 62 4.2.2 Deployment . 62 4.2.3 To Each His Clone . 63 4.2.4 Show and Tell . 63 4.2.5 Collaboration . 64 4.3 Mobile Instructor . 65 4.4 Conclusion . 66 5 Test-Driven Pair Programming 67 5.1 Prototyping the Model . 68 8 5.1.1 Procedure . 68 5.1.2 Visualizing Programming Sessions . 70 5.1.3 Examining Cooperation . 71 5.1.4 Examining Modes . 75 5.1.5 Developer Feedback . 76 5.1.6 Design Implications . 78 5.2 Test Lifecycle . 78 5.3 User Interface . 79 5.4 Jacto: JUnit AspectJ Coverage Tool . 82 5.5 Formative Evaluation . 83 5.5.1 Procedure . 83 5.5.2 Programming . 84 5.5.3 Developer Feedback . 85 5.6 Conclusion . 87 6 µoutsourcing 89 6.1 Prototyping the Model . 89 6.1.1 Laziness, Impatience, and Hubris . 90 6.1.2 Breadth and Depth . 91 6.1.3 Integrating Work . 92 6.2 User Interface . 92 6.3 Instawork . 94 6.4 User Study . 96 6.4.1 Crowd Programmers . 96 6.4.2 Original Programmers . 98 6.4.3 Procedure . 98 6.4.4 Outsourced Work . 100 6.4.5 Specifying Tasks . 104 6.4.6 Work in Progress . 107 6.4.7 Management and Communication . 109 9 6.4.8 Task Results . 112 6.4.9 Prospects for µoutsourcing . 114 6.4.10 Design Implications . 118 6.5 Conclusion . 119 7 Future Work 121 7.1 Collaborative Real-Time Software Development . 121 7.2 Error-Mediated Integration . 122 7.3 Models of Collaborative Programming . 123 7.4 Changing the Game . 124 8 Conclusion 127 10 List of Figures 1-1 The Collabode web-based IDE for Java allows multiple programmers to work together on the same code. The top window shows three programmers editing HelloWorld.java on the right, with feedback from unit tests on the left. In the bottom window is console output from running the program. 18 3-1 The Collabode web-based IDE allows multiple programmers to work together using a familiar interface and tooling. 30 3-2 High-level overview of the Collabode server-side system architecture. Highlighted components are original development. EtherPad was heav- ily modified. Other components are frameworks. 31 3-3 Alice and Bob are working concurrently to define methods a and b. (a) The view copy contains all of their changes, shown here from Bob’s perspective: his un-integrated change is in yellow, with an outgoing arrow; Alice’s is in gray, with an incoming arrow. (b) Alice’s working copy and (c) Bob’s working copy contain only their own changes. (d) The master copy does not reflect their work-in-progress, since both of their changes still contain errors. 36 3-4 After Alice and Bob finish defining methods a and b, the view copy, both working copies, and the master copy will all contain the same, error-free code. 37 11 3-5 Alice is working on method a while Bob has completed b. (a) The view copy contains all of their changes, shown here from Bob’s per- spective: Alice’s un-integrated change is in gray. (b) Alice’s working copy contains Bob’s completed code in addition to her own, but (c) Bob’s working copy does not contain Alice’s work-in-progress. (d) The master copy contains Bob’s completed error-free code. 39 3-6 Bob has made an edit to Alice’s in-progress work on method a. The edit is merged with Alice’s, so (a) the view copy from Bob’s perspective shows the entire in-progress method in gray.