Semistructured merge in JavaScript systems - TAVARES, Alberto Trindade (2019)
In a collaborative development environment, programmers often work on simultaneous tasks which involve common software artifacts. As a consequence, when developers merge independent code contributions from different tasks, one might have to deal with conflicting changes, hampering the productivity of such collaborative development. The industry widely uses unstructured merge tools, that rely on textual analysis, to detect and resolve conflicts between developers’ code contributions. On the other hand, semistructured merge tools go further by partially analyzing the syntactic structure and semantics of the code artifacts involved in a conflict. Previous studies compared these merge approaches, showing that semistructured merge is superior to unstructured one with respect to the number of reported conflicts, reducing the integration effort spent by developers, but, also, possibly negatively impacting the correctness of the merging process. However, these studies are based on semistructured merge tools, built on top of the FSTMerge architecture, that support different languages such as Java and C#, but not JavaScript, the most popular programming language for the Web. JavaScript has distinctive features when compared to those languages, which potentially lead to different results of effectiveness in solving conflicts by using the semistructured merge approach. In this work, we implement different versions of semistructured tools— based on FSTMerge— that work with JavaScript, and we conduct a study to compare them to an unstructured tool in order to better understand how semistructured merge works across different languages. During the implementation of tools for JavaScript, we found that the FSTMerge approach is not fully generalizable for programming languages that share similar characteristics with JavaScript; in particular, languages that allow statements at the same syntactic level as commutative and associative declarations. For those languages, further adaptations to the FSTMerge architecture are necessary. Nevertheless, we found evidences that semistructured merge approach for JavaScript reports fewer spurious conflicts than unstructured merge, without significantly impacting the integration correctness. Even though the reduction of reported conflicts is lower than that reported in previous studies for Java and C#, semistructured merge still seems to be a promising alternative to traditional unstructured merge when working with JavaScript.