Covscode: a Novel Real-Time Collaborative Programming Environment for Lightweight IDE
Total Page:16
File Type:pdf, Size:1020Kb
applied sciences Article CoVSCode: A Novel Real-Time Collaborative Programming Environment for Lightweight IDE Hongfei Fan 1 , Kun Li 1, Xiangzhen Li 1, Tianyou Song 1, Wenzhe Zhang 1, Yang Shi 1,* and Bowen Du 2,* 1 School of Software Engineering, Tongji University, Shanghai 201804, China; [email protected] (H.F.); [email protected] (K.L.); [email protected] (X.L.); [email protected] (T.S.); [email protected] (W.Z.) 2 Department of Computer Science, University of Warwick, Coventry CV4 7AL, UK * Correspondence: [email protected] (Y.S.); [email protected] (B.D.) Received: 27 August 2019; Accepted: 24 October 2019; Published: 31 October 2019 Abstract: Real-time collaborative programming is an emerging approach that supports a team of programmers to view and edit shared source code at the same time. Each programmer can edit any part of the source code, and changes become instantly visible at other collaborating sites. With a broad range of application scenarios and benefits, real-time collaborative programming has attracted increasing interest from academia and industry. Lightweight integrated development environments (lightweight IDEs) have rapidly grown in popularity in the recent years, but there are serious problems and limitations with existing real-time collaboration support for lightweight IDEs. In this study, we contribute a novel real-time collaborative programming environment named CoVSCode that supports unconstrained and flexible real-time collaboration based on Visual Studio Code, one of the most popular and widely used lightweight IDEs. We present design objectives and rationales, the workflow and functional design from collaborating programmers’ perspectives, major technical issues and solutions, and prototype implementation, as well as a set of experimental evaluations that have demonstrated the technical feasibility and good performance of the prototype system. All approaches, techniques and solutions derived in this work are generic, which can also be applied in building real-time collaborative programming environments for other lightweight IDEs. Keywords: computer-supported cooperative work (CSCW); collaborative computing; collaborative software development; real-time collaborative programming; software development environment 1. Introduction Software development requires effective collaboration among programmers with diverse skills and experiences. For supporting collaboration in the programming process, there are two general categories of approaches and techniques, namely non-real-time collaborative programming and real-time collaborative programming [1]. Non-real-time collaborative programming is a traditional approach that has been widely adopted and practiced in the communities for a long time, which is commonly supported by version control systems such as Git [2]. It is considered to be a kind of non-real-time collaboration because each programmer’s modification on the source code copy will be kept private until the updated source code is uploaded to the repository and merged into other programmers’ local source code copies. In contrast, real-time collaborative programming is an emerging approach that supports a team of programmers to view and edit a set of shared source code documents at the same time [3]. During a real-time collaboration session, each programmer can edit any part of the source code, and changes become instantly visible at other collaborating sites. Unlike non-real-time Appl. Sci. 2019, 9, 4642; doi:10.3390/app9214642 www.mdpi.com/journal/applsci Appl. Sci. 2019, 9, 4642 2 of 25 collaborative programming, concurrent changes made by several programmers can be automatically integrated in real-time collaboration processes without manual conflict resolution. Real-time collaborative programming is an important supplement to non-real-time collaborative programming, which provides benefits in a broad range of scenarios. Firstly, several programmers may need to edit one source code file that cannot be further decomposed due to certain reasons. It is a well-known challenge for programmers to resolve conflicts in non-real-time collaboration while they concurrently edit and commit the same file. Secondly, in agile software development processes, programmers commonly work with frequent iterations to meet the changing requirements, and source code modules may not be well defined and isolated. Under such circumstances, programmers’ tasks are strongly related and interdependent, which forces them to collaborate in a closely-coupled fashion. Thirdly, real-time collaborative programming is useful for supporting and enhancing pair programming, where two (or more) programmers, even geographically dispersed, can conduct pair programming work over the Internet. In addition, this emerging technique is also beneficial in supporting collaborative learning among students in a programming course, achieving collaborative diagnoses and troubleshooting between a support engineer at a customer’s site and a senior engineer at the headquarter, and many other cases. Because of its wide application scenarios and benefits, real-time collaborative programming has attracted increasing interests from both academia and industry over the past decade [1,3–15]. Lightweight integrated development environments (lightweight IDEs), such as Sublime Text [16], Atom [17] and Visual Studio Code [18], have rapidly grown in popularity in recent years. For example, it is notable that Visual Studio Code was ranked as the most popular development environment in the Stack Overflow’s 2019 Developer Survey [19] only four years after its initial release in 2015. Lightweight IDEs are highly customizable, and can be significantly extended with a large number of available plugins to support various development tasks and programming languages. However, there is very limited support for real-time collaboration with lightweight IDEs. For example, even with the official real-time collaboration plugins for Visual Studio Code and Atom, programmers can only collaborate in a specific pattern that does not support truly unconstrained real-time collaboration and has serious limitations. In Section 2.3, we analyze these problems and limitations in details. Given the increasing popularity of lightweight IDEs as well as our observation of the limitations of real-time collaboration support for them, we proposed, designed and implemented a novel real-time collaborative programming environment for Visual Studio Code, one of the most popular and widely used lightweight IDEs. The proposed environment met three design objectives: (i) preserving full compatibility with the existing lightweight IDE; (ii) supporting real-time collaborative programming with intuitive awareness; and (iii) achieving unconstrained and flexible real-time collaboration for programmers with equal roles. In this paper, we present the system architecture, workflow and functional design, major technical issues and solutions, prototype implementation, and a set of experimental evaluations. The approaches, techniques and solutions are generic, which can also be applied to building real-time collaborative programming environments for other lightweight IDEs. The rest of this paper is organized as follows. In Section2, we review related studies and present problems and limitations of existing real-time collaboration support for lightweight IDEs. In Section3, we present and explain three design objectives for the proposed environment. In Section4, we propose the system architecture with design rationales, and present the design of workflow and functionalities from collaborating programmers’ perspectives. In Section5, we discuss major technical issues and solutions for system building. In Section6, we demonstrate the implemented prototype system, and present experimental evaluations in detail. In Section7, we discuss the generality of the proposed approaches and techniques, and compare this study with related work. Finally, in Section8, we summarize this study and identify potential research issues for the future work. Appl. Sci. 2019, 9, 4642 3 of 25 2. Related Work 2.1. Real-Time Collaborative Editing Similar to many real-time collaborative applications in other domains, one of the fundamental techniques for supporting real-time collaborative programming is the generic real-time collaborative editing technique, which allows a group of collaborators to concurrently edit a shared document at the same time [20,21]. To achieve high local responsiveness (i.e., for a user’s local editing operation to take effect immediately in the local document without delay), real-time collaborative editing systems have commonly been designed with a replicated architecture, where the shared document is replicated at all collaborating sites [22]. Consequently, there is an essential consistency maintenance requirement that after all editing operations have been propagated and replayed at remote sites, the shared document at each site must be identical. To illustrate the consistency maintenance problem, a simple example is presented in Figure1 (left side). Suppose that there are two collaborators, namely A and B, who are editing the shared document at the same time. The document’s initial content was “abcdef ”. At one moment, A issues an operation ins[0, “xy”] (to insert the text “xy” at the position 0 of the document), while at the same time, B issues an operation del [2,3] (to delete the text “cde” from the position 2 of the document). After the two operations have arrived at remote sites and been replayed,