Semantic conflict detection via dynamic analysis

  • Amanda Moraes UFPE
  • Paulo Borba UFPE
  • Léuson Da Silva Polytechnique Montreal

Resumo


During collaborative software development, a semantic conflict may occur when the individual behavior expected by different developers is no longer preserved after merging their branches. While potential semantic conflicts are not captured via textual merge tools, different approaches have already been proposed based on static analysis or automated test generation to verify behavioral changes given a merge scenario. However, these approaches share some limitations regarding scalability and reporting false positives and negatives. Trying to address these limitations, in this work, we assess the detection of conflicts by focusing on overriding assignments in JavaScript code through dynamic analysis. Dynamic analysis allows us to detect changes involving writing operations to the same state element at runtime and does not need assertions about the under-analysis code, such as in test-based approaches, requiring only the final version of the merged code (post-merge) to be executed. To evaluate our approach, besides translating test cases from related works, we empirically analyze merge scenarios from 50 JavaScript opensource projects hosted on GitHub, from which we correctly detected one scenario of overriding assignment representing a potential semantic conflict with no false positives.

Palavras-chave: Semantic Conflict Detection, Dynamic Analysis, Overriding Assignment, JavaScript

Referências

Paola Accioly, Paulo Borba, and Guilherme Cavalcanti. 2018. Understanding semi-structured merge conflict characteristics in open-source java projects. Empirical Software Engineering 23 (2018), 2051–2085.

Matheus Barbosa, Paulo Borba, Rodrigo Bonifácio, and Galileu Santos. 2022. Semantic conflict detection with overriding assignment analysis. SBES 2022: XXXVI Brazilian Symposium on Software Engineering (2022).

Yuriy Brun, Reid Holmes, Michael D Ernst, and David Notkin. 2013. Early detection of collaboration conflicts and risks. IEEE Transactions on Software Engineering 39, 10 (2013), 1358–1375.

Reidar Conradi and Bernhard Westfechtel. 1998. Version models for software configuration management. ACM Computing Surveys (CSUR) 30, 2 (1998), 232–282.

Léuson Da Silva, Paulo Borba, Toni Maciel, Wardah Mahmood, Thorsten Berger, João Moisakis, Aldiberg Gomes, and Vinícius Leite. 2024. Detecting semantic conflicts with unit tests. Journal of Systems and Software (2024), 112070.

Léuson Da Silva, Paulo Borba,Wardah Mahmood, and Thorsten Berger. 2020. Detecting Semantic Conflicts via Automated Behavior Change Detection. IEEE International Conference on Software Maintenance and Evolution (ICSME) (2020). DOI: 10.1109/ICSME46990.2020.00026

Léuson Da Silva, Paulo Borba, and Arthur Pires. 2022. Build conflicts in the wild. Journal of Software: Evolution and Process 34, 4 (2022), e2441.

GitHub Docs. 2024. Resolver um conflito de merge usando a linha de comando. [link]

OpenJS Foundation. [n. d.]. Node.js — Run JavaScript Everywhere. [link]

Git. 2024. Branches no Git - O básico de Ramificação (Branch) e Mesclagem (Merge). [link]

Git. 2024. Resolver um conflito de merge usando a linha de comando. GitHub. [link]

Innovation Graph. 2024. Programming Languages Global Metrics. [link]

Software Productivity Group. [n. d.]. MiningFramework. GitHub. [link]

Software Productivity Group. [n. d.]. Static Analyses Algorithms for Detecting Semantic Conflicts. GitHub. [link]

Susan Horwitz, Jan Prins, and Thomas Reps. 1989. Integrating Noninterfering Versions of Programs. ACM Transactions on Programming Languages and Systems 11, 3 (1989), 345–387.

Free Software Foundation Inc. 2022. Merging From a Common Ancestor. [link]

JSweet. [n. d.]. JSweet Live Sandbox: write Java, run JavaScript. [link]

Jayadev Misra. 2001. A Discipline of Multiprogramming: Programming Theory for Distributed Applications. Springer. 14 pages.

Amanda Moraes. [n. d.]. Dynamic Analysis for detecting overriding assignments in JavaScript code. GitHub. [link]

Hung Viet Nguyen, Christian Kastner, and Tien Nhut Nguyen. 2014. Exploring Variability-Aware Execution for Testing Plugin-Based Web Applications. In Proceedings of the 36th International Conference on Software Engineering. ICSE 2014, 907–918.

Hung Viet Nguyen, My Huu Nguyen, Soncuu Dang, Christian Kastner, and Tien Nhut Nguyen. 2015. Detecting semantic merge conflicts with variability-aware execution. In Proceedings of the 2015 10th Joint Meeting on Foundations of Software Engineering. ESEC/FSE 2015, 926–929.

Delano Oliveira, Reydne Bruno, Fernanda Madeiral, and Fernando Castor. 2020. Evaluating code readability and legibility: An examination of human-centric studies. In 2020 IEEE International Conference on Software Maintenance and Evolution (ICSME). IEEE, 348–359.

Thomas W Reps and Susan Horwitz. 1992. The use of program dependence graphs in software engineering. ICSE ’92: Proceedings of the 14th international conference on Software engineering (1992), 392–411.

Thomas W Reps, Susan Horwitz, and Dave Binkley. 1988. Interprocedural slicing using dependence graphs. In ACM SIGPLAN Notices, Vol. 23. ACM, 35–46.

Samsung. [n. d.]. Jalangi2. GitHub. [link]

Galileu Santos, Paulo Borba, Rodrigo Bonifácio, and Matheus Barbosa de Oliveira. 2023. Detecting Semantic Conflicts using Static Analysis. arXiv:2310.04269 [cs.SE] (2023).

Koushik Sen, Swaroop Kalasapur, Tasneem Brutch, and Simon Gibbs. 2013. Jalangi: A Selective Record-Replay and Dynamic Analysis Framework for JavaScript. In ESEC/FSE 2013: Proceedings of the 2013 9th Joint Meeting on Foundations of Software Engineering. ACM, 488–498. DOI: 10.1145/2491411.2491447

Daniela Steidl, Benjamin Hummel, and Elmar Juergens. 2013. Quality analysis of source code comments. In 2013 21st international conference on program comprehension (icpc). Ieee, 83–92.

Alberto Tavares, Paulo Borba, Guilherme Cavalcanti, and Sérgio Soares. 2019. Semistructured Merge in JavaScript Systems. In 34th IEEE/ACM International Conference on Automated Software Engineering (ASE 2019). 1014–1025.

Junji Zhi, Vahid Garousi-Yusifoğlu, Bo Sun, Golara Garousi, Shawn Shahnewaz, and Guenther Ruhe. 2015. Cost, benefits and quality of software development documentation: A systematic mapping. Journal of Systems and Software 99 (2015), 175–198.
Publicado
30/09/2024
MORAES, Amanda; BORBA, Paulo; SILVA, Léuson Da. Semantic conflict detection via dynamic analysis. In: SIMPÓSIO BRASILEIRO DE LINGUAGENS DE PROGRAMAÇÃO (SBLP), 28. , 2024, Curitiba/PR. Anais [...]. Porto Alegre: Sociedade Brasileira de Computação, 2024 . p. 53-61. DOI: https://doi.org/10.5753/sblp.2024.3471.