Towards Automated Identification of Violation Symptoms of Architecture Erosion (2306.08616v4)
Abstract: Architecture erosion has a detrimental effect on maintenance and evolution, as the implementation drifts away from the intended architecture. To prevent this, development teams need to understand early enough the symptoms of erosion, and particularly violations of the intended architecture. One way to achieve this, is through the automated identification of architecture violations from textual artifacts, and particularly code reviews. In this paper, we developed 15 machine learning-based and 4 deep learning-based classifiers with three pre-trained word embeddings to identify violation symptoms of architecture erosion from developer discussions in code reviews. Specifically, we looked at code review comments from four large open-source projects from the OpenStack (Nova and Neutron) and Qt (Qt Base and Qt Creator) communities. We then conducted a survey and semi-structured interviews to acquire feedback from the involved participants who discussed architecture violations in code reviews, to validate the usefulness of our trained classifiers. The results show that the SVM classifier based on word2vec pre-trained word embedding performs the best with an F1-score of 0.779. In most cases, classifiers with the fastText pre-trained word embedding model can achieve relatively good performance. Furthermore, 200-dimensional pre-trained word embedding models outperform classifiers that use 100 and 300-dimensional models. In addition, an ensemble classifier based on the majority voting strategy can further enhance the classifier and outperforms the individual classifiers. Finally, the findings derived from the online survey and interviews conducted with the involved developers reveal that the violation symptoms identified by our approaches have practical value and can provide early warnings for impending architecture erosion.
- R. Li, P. Liang, M. Soliman, and P. Avgeriou, “Understanding software architecture erosion: A systematic mapping study,” Journal of Software: Evolution and Process, vol. 34, no. 3, p. e2423, 2022.
- D. M. Le, C. Carrillo, R. Capilla, and N. Medvidovic, “Relating architectural decay and sustainability of software systems,” in Proceedings of the 13th Working IEEE/IFIP Conference on Software Architecture (WICSA). Venice, Italy: IEEE, 2016, pp. 178–181.
- C. C. Venters, R. Capilla, S. Betz, B. Penzenstadler, T. Crick, S. Crouch, E. Y. Nakagawa, C. Becker, and C. Carrillo, “Software sustainability: Research and practice from a software architecture viewpoint,” Journal of Systems and Software, vol. 138, pp. 174–188, 2018.
- D. E. Perry and A. L. Wolf, “Foundations for the study of software architecture,” ACM SIGSOFT Software Engineering Notes, vol. 17, no. 4, pp. 40–52, 1992.
- R. Li, P. Liang, M. Soliman, and P. Avgeriou, “Understanding architecture erosion: The practitioners’ perceptive,” in Proceedings of the 29th IEEE/ACM International Conference on Program Comprehension (ICPC). Madrid, Spain: IEEE, 2021, pp. 311–322.
- S. Herold, M. English, J. Buckley, S. Counsell, and M. Ó. Cinnéide, “Detection of violation causes in reflexion models,” in Proceedings of the 22nd IEEE International Conference on Software Analysis, Evolution, and Reengineering (SANER). Montreal, QC, Canada: IEEE, 2015, pp. 565–569.
- F. A. Fontana, R. Roveda, M. Zanoni, C. Raibulet, and R. Capilla, “An experience report on detecting and repairing software architecture erosion,” in Proceedings of the 13th Working IEEE/IFIP Conference on Software Architecture (WICSA). Venice, Italy: IEEE, 2016, pp. 21–30.
- I. Macia, R. Arcoverde, A. Garcia, C. Chavez, and A. von Staa, “On the relevance of code anomalies for identifying architecture degradation symptoms,” in Proceedings of the 16th European Conference on Software Maintenance and Reengineering (CSMR). Szeged, Hungary: IEEE, 2012, pp. 277–286.
- R. Li, M. Soliman, P. Liang, and P. Avgeriou, “Symptoms of architecture erosion in code reviews: A study of two OpenStack projects,” in Proceedings of the 19th IEEE International Conference on Software Architecture (ICSA). Honolulu, Hawaii, USA: IEEE, 2022, pp. 24–35.
- R. Li, P. Liang, and P. Avgeriou, “Warnings: Violation symptoms indicating architecture erosion,” Information and Software Technology, vol. 164, p. 107319, 2023.
- L. De Silva and D. Balasubramaniam, “Controlling software architecture erosion: A survey,” Journal of Systems and Software, vol. 85, no. 1, pp. 132–151, 2012.
- C. Mendoza, J. Bocanegra, K. Garcés, and R. Casallas, “Architecture violations detection and visualization in the continuous integration pipeline,” Software: Practice and Experience, vol. 51, no. 8, pp. 1822–1845, 2021.
- T. Sharma and D. Spinellis, “A survey on software smells,” Journal of Systems and Software, vol. 138, pp. 158–173, 2018.
- D. Badampudi, M. Unterkalmsteiner, and R. Britto, “Modern code reviews—survey of literature and practice,” ACM Transactions on Software Engineering and Methodology, vol. 32, no. 4, pp. 1–61, 2023.
- S. Hassaine, Y.-G. Guéhéneuc, S. Hamel, and G. Antoniol, “Advise: Architectural decay in software evolution,” in Proceedings of the 16th European Conference on Software Maintenance and Reengineering (CSMR). Szeged, Hungary: IEEE, 2012, pp. 267–276.
- D. M. Le, D. Link, A. Shahbazian, and N. Medvidovic, “An empirical study of architectural decay in open-source software,” in Proceedings of the 15th IEEE International Conference on Software Architecture (ICSA). Seattle, WA, USA: IEEE, 2018, pp. 176–185.
- J. Lenhard, M. Blom, and S. Herold, “Exploring the suitability of source code metrics for indicating architectural inconsistencies,” Software Quality Journal, vol. 27, no. 1, pp. 241–274, 2019.
- S. Herold, “An initial study on the association between architectural smells and degradation,” in Proceedings of the 14th European Conference on Software Architecture (ECSA). L’Aquila, Italy: Springer, 2020, pp. 193–201.
- L. Hochstein and M. Lindvall, “Combating architectural degeneration: A survey,” Information and Software Technology, vol. 47, no. 10, pp. 643–656, 2005.
- M. Mair and S. Herold, “Towards extensive software architecture erosion repairs,” in Proceedings of the 7th European Conference on Software Architecture (ECSA). Montpellier, France: Springer, 2013, pp. 299–306.
- R. C. Martin, “Design principles and design patterns,” Object Mentor, vol. 1, no. 34, p. 597, 2000.
- S. Miranda, E. Rodrigues Jr, M. T. Valente, and R. Terra, “Architecture conformance checking in dynamically typed languages,” Journal of Object Technology, vol. 15, no. 3, pp. 1–34, 2016.
- S. Schröder and M. Riebisch, “Architecture conformance checking with description logics,” in Proceedings of the 11th European Conference on Software Architecture (ECSA) Companion. Canterbury, United Kingdom: ACM, 2017, pp. 166–172.
- R. Terra and M. T. Valente, “A dependency constraint language to manage object‐oriented software architectures,” Software: Practice and Experience, vol. 39, no. 12, pp. 1073–1094, 2009.
- H. Rocha, R. S. Durelli, R. Terra, S. Bessa, and M. T. Valente, “Dcl 2.0: modular and reusable specification of architectural constraints,” Journal of the Brazilian Computer Society, vol. 23, no. 1, pp. 1–25, 2017.
- A. Caracciolo, M. F. Lungu, and O. Nierstrasz, “A unified approach to architecture conformance checking,” in Proceedings of the 12th Working IEEE/IFIP Conference on Software Architecture (WICSA). Montreal, QC, Canada: IEEE, 2015, pp. 41–50.
- L. Juarez Filho, L. Rocha, R. Andrade, and R. Britto, “Preventing erosion in exception handling design using static-architecture conformance checking,” in Proceedings of the 11th European Conference on Software Architecture (ECSA). Canterbury, UK: Springer, 2017, pp. 67–83.
- A. Bacchelli and C. Bird, “Expectations, outcomes, and challenges of modern code review,” in Proceedings of the 35th International Conference on Software Engineering (ICSE). San Francisco, CA, USA: IEEE, 2013, pp. 712–721.
- N. Davila and I. Nunes, “A systematic literature review and taxonomy of modern code review,” Journal of Systems and Software, vol. 177, p. 110951, 2021.
- Z. Li, X. Qi, Q. Yu, P. Liang, R. Mo, and C. Yang, “Multi-programming-language commits in oss: An empirical study on apache projects,” in Proceedings of the 29th IEEE/ACM International Conference on Program Comprehension (ICPC). Madrid, Spain: IEEE, 2021, pp. 219–229.
- M. Paixao, J. Krinke, D. Han, C. Ragkhitwetsagul, and M. Harman, “The impact of code review on architectural changes,” IEEE Transactions on Software Engineering, vol. 47, no. 5, pp. 1041–1059, 2021.
- V. R. Basili, G. Caldiera, and H. D. Rombach, “The goal question metric approach,” Encyclopedia of Software Engineering, pp. 528–532, 1994.
- J. Cohen, “A coefficient of agreement for nominal scales,” Educational and Psychological Measurement, vol. 20, no. 1, pp. 37–46, 1960.
- R. Li, P. Liang, and P. Avgeriou, “Replication Package for the Paper: Towards Automated Identification of Violation Symptoms of Architecture Erosion.” https://zenodo.org/doi/10.5281/zenodo.10038355, 2024.
- S. Bird, E. Klein, and E. Loper, “Natural language processing with python: Analyzing text with the natural language toolkit,” Language Resources and Evaluation, vol. 44, pp. 421–424, 2010.
- “GeeksforGeeks, Snowball Stemmer – NLP.” https://www.geeksforgeeks.org/snowball-stemmer-nlp/.
- T. Mikolov, I. Sutskever, K. Chen, G. S. Corrado, and J. Dean, “Distributed representations of words and phrases and their compositionality,” in Proceedings of the 27th Annual Conference on Neural Information Processing Systems (NeurIPS). Lake Tahoe, Nevada, United States: Curran Associates, Inc., 2013, pp. 3111–3119.
- V. Efstathiou, C. Chatzilenas, and D. Spinellis, “Word embeddings for the software engineering domain,” in Proceedings of the 15th International Conference on Mining Software Repositories (MSR). Gothenburg, Sweden: ACM, 2018, pp. 38–41.
- P. Bojanowski, E. Grave, A. Joulin, and T. Mikolov, “Enriching word vectors with subword information,” Transactions of the Association for Computational Linguistics, vol. 5, pp. 135–146, 2017.
- J. Pennington, R. Socher, and C. D. Manning, “Glove: Global vectors for word representation,” in Proceedings of the 2014 Conference on Empirical Methods in Natural Language Processing (EMNLP). Doha, Qatar: ACL, 2014, pp. 1532–1543.
- Y. Yang, X. Xia, D. Lo, T. Bi, J. Grundy, and X. Yang, “Predictive models in software engineering: Challenges and opportunities,” ACM Transactions on Software Engineering and Methodology, vol. 31, no. 3, pp. 1–72, 2022.
- S. Minaee, N. Kalchbrenner, E. Cambria, N. Nikzad, M. Chenaghlu, and J. Gao, “Deep learning-based text classification: A comprehensive review,” ACM Computing Surveys, vol. 54, no. 3, pp. 1–40, 2021.
- Y. Kim, “Convolutional neural network for sentence classification,” in Proceedings of the 2014 Conference on Empirical Methods in Natural Language Processing (EMNLP). Doha, Qatar: ACL, 2014, pp. 1746–1751.
- C. Watson, N. Cooper, D. N. Palacio, K. Moran, and D. Poshyvanyk, “A systematic literature review on the use of deep learning in software engineering research,” ACM Transactions on Software Engineering and Methodology, vol. 31, no. 2, pp. 1–58, 2022.
- H. He and E. A. Garcia, “Learning from imbalanced data,” IEEE Transactions on Knowledge and Data Engineering, vol. 21, no. 9, pp. 1263–1284, 2009.
- T. G. Dietterich, “Ensemble methods in machine learning,” in Proceedings of the 1st International Workshop of Multiple Classifier Systems (MCS). Cagliari, Italy: Springer, 2000, pp. 1–15.
- B. A. Kitchenham and S. L. Pfleeger, “Personal opinion surveys,” in Guide to Advanced Empirical Software Engineering. Springer, 2008, ch. 3, pp. 63–92.
- T. C. Lethbridge, S. E. Sim, and J. Singer, “Studying software engineers: Data collection techniques for software field studies,” Empirical Software Engineering, vol. 10, no. 3, pp. 311–341, 2005.
- A. R. Nasab, M. Shahin, P. Liang, M. Basiri, S. H. Raviz, H. Khalajzadeh, M. Waseem, and A. Naseri, “Automated identification of security discussions in microservices systems: Industrial surveys and experiments,” Journal of Systems and Software, p. 111046, 2021.
- H. Khalajzadeh, M. Shahin, H. O. Obie, P. Agrawal, and J. Grundy, “Supporting developers in addressing human-centric issues in mobile apps,” IEEE Transactions on Software Engineering, vol. 49, no. 4, pp. 2149–2168, 2022.
- S. Adolph, W. Hall, and P. Kruchten, “Using grounded theory to study the experience of software development,” Empirical Software Engineering, vol. 16, no. 4, pp. 487–513, 2011.
- Y. Qi, D. Sachan, M. Felix, S. Padmanabhan, and G. Neubig, “When and why are pre-trained word embeddings useful for neural machine translation?” in Proceedings of the 2018 Conference of the North American Chapter of the Association for Computational Linguistics (NAACL). New Orleans, Louisiana, USA: ACL, 2018, pp. 529–535.
- A. Radford, K. Narasimhan, T. Salimans, I. Sutskever et al., “Improving language understanding by generative pre-training,” In: Preprint, pp. 1–12, 2018.
- J. Singer, S. E. Sim, and T. C. Lethbridge, “Software engineering data collection for field studies,” in Guide to Advanced Empirical Software Engineering. Springer, 2008, ch. 1, pp. 9–34.
- Z. Liu, X. Xia, A. E. Hassan, D. Lo, Z. Xing, and X. Wang, “Neural-machine-translation-based commit message generation: How far are we?” in Proceedings of the 33rd ACM/IEEE International Conference on Automated Software Engineering (ASE). Montpellier, France: ACM, 2018, pp. 373–384.
- W. Fu and T. Menzies, “Easy over hard: A case study on deep learning,” in Proceedings of the 11th joint meeting on Foundations of Software Engineering (FSE). Paderborn, Germany: ACM, 2017, pp. 49–60.
- E. Sesari, M. Hort, and F. Sarro, “An empirical study on the fairness of pre-trained word embeddings,” in Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (ACL). Dublin, Ireland: ACL, 2022, pp. 129–144.
- X. Ren, Z. Xing, X. Xia, D. Lo, X. Wang, and J. Grundy, “Neural network-based detection of self-admitted technical debt: From performance to explainability,” ACM Transactions on Software Engineering and Methodology, vol. 28, no. 3, pp. 1–45, 2019.
- Y. Li, M. Soliman, and P. Avgeriou, “Identifying self-admitted technical debt in issue tracking systems using machine learning,” Empirical Software Engineering, vol. 27, no. 6, p. 131, 2022.
- L. K. Hansen and P. Salamon, “Neural network ensembles,” IEEE transactions on pattern analysis and machine intelligence, vol. 12, no. 10, pp. 993–1001, 1990.
- F. Peters, T. T. Tun, Y. Yu, and B. Nuseibeh, “Text filtering and ranking for security bug report prediction,” IEEE Transactions on Software Engineering, vol. 45, no. 6, pp. 615–631, 2017.
- X. Han, A. Tahir, P. Liang, S. Counsell, K. Blincoe, B. Li, and Y. Luo, “Code smells detection via modern code review: A study of the openstack and qt communities,” Empirical Software Engineering, vol. 27, no. 6, p. 127, 2022.
- I. El Asri, N. Kerzazi, G. Uddin, F. Khomh, and M. J. Idrissi, “An empirical study of sentiments in code reviews,” Information and Software Technology, vol. 114, pp. 37–54, 2019.
- Y. Kashiwa, R. Nishikawa, Y. Kamei, M. Kondo, E. Shihab, R. Sato, and N. Ubayashi, “An empirical study on self-admitted technical debt in modern code review,” Information and Software Technology, vol. 146, p. 106855, 2022.
- A. Uchôa, C. Barbosa, W. Oizumi, P. Blenilio, R. Lima, A. Garcia, and C. Bezerra, “How does modern code review impact software design degradation? an in-depth empirical study,” in Proceedings of the 36th IEEE International Conference on Software Maintenance and Evolution (ICSME). Adelaide, Australia: IEEE, 2020, pp. 511–522.
- M. Paixão, A. Uchôa, A. C. Bibiano, D. Oliveira, A. Garcia, J. Krinke, and E. Arvonio, “Behind the intents: An in-depth empirical study on software refactoring in modern code review,” in Proceedings of the 17th International Conference on Mining Software Repositories (MSR). Seoul, South Korea: ACM, 2020, pp. 125–136.
- J. Brunet, R. A. Bittencourt, D. Serey, and J. Figueiredo, “On the evolutionary nature of architectural violations,” in Proceedings of the 19th Working Conference on Reverse Engineering (WCRE). Kingston, ON, Canada: IEEE, 2012, pp. 257–266.
- R. Terra, M. T. Valente, K. Czarnecki, and R. S. Bigonha, “A recommendation system for repairing violations detected by static architecture conformance checking,” Software: Practice and Experience, vol. 45, no. 3, pp. 315–342, 2015.
- C. Maffort, M. T. Valente, R. Terra, M. Bigonha, N. Anquetil, and A. Hora, “Mining architectural violations from version history,” Empirical Software Engineering, vol. 21, no. 3, pp. 854–895, 2016.
- E. A. AlOmar, M. W. Mkaouer, and A. Ouni, “Toward the automatic classification of self-affirmed refactoring,” Journal of Systems and Software, vol. 171, p. 110821, 2021.
- T. Hey, J. Keim, A. Koziolek, and W. F. Tichy, “Norbert: Transfer learning for requirements classification,” in Proceedings of the 28th IEEE International Requirements Engineering Conference (RE). Zurich, Switzerland: IEEE, 2020, pp. 169–179.