Skip to main content
Top
Published in: Empirical Software Engineering 2/2024

01-03-2024

An empirical study of untangling patterns of two-class dependency cycles

Authors: Qiong Feng, Shuwen Liu, Huan Ji, Xiaotian Ma, Peng Liang

Published in: Empirical Software Engineering | Issue 2/2024

Log in

Activate our intelligent search to find suitable subject content or patents.

search-config
loading …

Abstract

Dependency cycles pose a significant challenge to software quality and maintainability. However, there is limited understanding of how practitioners resolve dependency cycles in real-world scenarios. This paper presents an empirical study investigating the recurring patterns employed by software developers to resolve dependency cycles between two classes in practice. We analyzed the data from 38 open-source projects across different domains and manually inspected hundreds of cycle untangling cases. Our findings reveal that developers tend to employ five recurring patterns to address dependency cycles. The chosen patterns are not only determined by dependency relations between cyclic classes, but also highly related to their design context, i.e., how cyclic classes depend on or are depended by their neighbor classes. Through this empirical study, we also discovered three common counterintuitive solutions developers usually adopted during cycles’ handling. These recurring patterns and common counterintuitive solutions observed in dependency cycles’ practice can serve as a taxonomy to improve developers’ awareness and also be used as learning materials for students in software engineering and inexperienced developers. Our results also suggest that, in addition to considering the internal structure of dependency cycles, automatic tools need to consider the design context of cycles to provide better support for refactoring dependency cycles.

Dont have a licence yet? Then find out more about our products and how to get one now:

Springer Professional "Wirtschaft"

Online-Abonnement

Mit Springer Professional "Wirtschaft" erhalten Sie Zugriff auf:

  • über 67.000 Bücher
  • über 340 Zeitschriften

aus folgenden Fachgebieten:

  • Bauwesen + Immobilien
  • Business IT + Informatik
  • Finance + Banking
  • Management + Führung
  • Marketing + Vertrieb
  • Versicherung + Risiko




Jetzt Wissensvorsprung sichern!

Springer Professional "Technik"

Online-Abonnement

Mit Springer Professional "Technik" erhalten Sie Zugriff auf:

  • über 67.000 Bücher
  • über 390 Zeitschriften

aus folgenden Fachgebieten:

  • Automobil + Motoren
  • Bauwesen + Immobilien
  • Business IT + Informatik
  • Elektrotechnik + Elektronik
  • Energie + Nachhaltigkeit
  • Maschinenbau + Werkstoffe




 

Jetzt Wissensvorsprung sichern!

Springer Professional "Wirtschaft+Technik"

Online-Abonnement

Mit Springer Professional "Wirtschaft+Technik" erhalten Sie Zugriff auf:

  • über 102.000 Bücher
  • über 537 Zeitschriften

aus folgenden Fachgebieten:

  • Automobil + Motoren
  • Bauwesen + Immobilien
  • Business IT + Informatik
  • Elektrotechnik + Elektronik
  • Energie + Nachhaltigkeit
  • Finance + Banking
  • Management + Führung
  • Marketing + Vertrieb
  • Maschinenbau + Werkstoffe
  • Versicherung + Risiko

Jetzt Wissensvorsprung sichern!

Literature
go back to reference Bavota G, Dit B, Oliveto R, Di Penta M, Poshyvanyk D, De Lucia A (2013) An empirical study on the developers’ perception of software coupling. In: Proceedings of the 35th international conference on software engineering (ICSE), IEEE, pp 692–701 Bavota G, Dit B, Oliveto R, Di Penta M, Poshyvanyk D, De Lucia A (2013) An empirical study on the developers’ perception of software coupling. In: Proceedings of the 35th international conference on software engineering (ICSE), IEEE, pp 692–701
go back to reference Cai H, Zheng VW, Chang KCC (2018) A comprehensive survey of graph embedding: problems, techniques, and applications. IEEE Trans Knowl Data Eng 30(9):1616–1637CrossRef Cai H, Zheng VW, Chang KCC (2018) A comprehensive survey of graph embedding: problems, techniques, and applications. IEEE Trans Knowl Data Eng 30(9):1616–1637CrossRef
go back to reference Campbell JL, Quincy C, Osserman J, Pedersen OK (2013) Coding in-depth semistructured interviews: problems of unitization and intercoder reliability and agreement. Sociol Methods Res 42(3):294–320MathSciNetCrossRef Campbell JL, Quincy C, Osserman J, Pedersen OK (2013) Coding in-depth semistructured interviews: problems of unitization and intercoder reliability and agreement. Sociol Methods Res 42(3):294–320MathSciNetCrossRef
go back to reference Caracciolo A, Aga B, Lungu M, Nierstrasz O (2016) Marea: a semi-automatic decision support system for breaking dependency cycles. In: Proceedings of the 23rd IEEE international conference on software analysis, evolution, and reengineering (SANER), IEEE, pp 482–492 Caracciolo A, Aga B, Lungu M, Nierstrasz O (2016) Marea: a semi-automatic decision support system for breaking dependency cycles. In: Proceedings of the 23rd IEEE international conference on software analysis, evolution, and reengineering (SANER), IEEE, pp 482–492
go back to reference Chawla NV, Bowyer KW, Hall LO, Kegelmeyer WP (2002) Smote: synthetic minority over-sampling technique. J Artif Intell Res 16:321–357CrossRef Chawla NV, Bowyer KW, Hall LO, Kegelmeyer WP (2002) Smote: synthetic minority over-sampling technique. J Artif Intell Res 16:321–357CrossRef
go back to reference Cui D, Wang S, Luo Y, Li X, Dai J, Wang L, Li Q (2022) Rmove: recommending move method refactoring opportunities using structural and semantic representations of code. In: Proceedings of the 38th IEEE international conference on software maintenance and evolution (ICSME), IEEE, pp 281–292 Cui D, Wang S, Luo Y, Li X, Dai J, Wang L, Li Q (2022) Rmove: recommending move method refactoring opportunities using structural and semantic representations of code. In: Proceedings of the 38th IEEE international conference on software maintenance and evolution (ICSME), IEEE, pp 281–292
go back to reference Dietrich J, McCartin C, Tempero E, Shah SMA (2010) Barriers to modularity-an empirical study to assess the potential for modularisation of java programs. In: Proceedings of the 6th international conference on the quality of software architectures (QoSA), Springer, pp 135–150 Dietrich J, McCartin C, Tempero E, Shah SMA (2010) Barriers to modularity-an empirical study to assess the potential for modularisation of java programs. In: Proceedings of the 6th international conference on the quality of software architectures (QoSA), Springer, pp 135–150
go back to reference Feng Q, Mo R (2023) Fine-grained analysis of dependency cycles among classes. J Softw: Evol Proc 35(1):e2496 Feng Q, Mo R (2023) Fine-grained analysis of dependency cycles among classes. J Softw: Evol Proc 35(1):e2496
go back to reference Feng Q, Cai Y, Kazman R, Cui D, Liu T, Fang H (2019) Active hotspot: an issue-oriented model to monitor software evolution and degradation. In: Proceedings of the 34th IEEE/ACM international conference on automated software engineering (ASE), IEEE, pp 986–997 Feng Q, Cai Y, Kazman R, Cui D, Liu T, Fang H (2019) Active hotspot: an issue-oriented model to monitor software evolution and degradation. In: Proceedings of the 34th IEEE/ACM international conference on automated software engineering (ASE), IEEE, pp 986–997
go back to reference Ferreira T, Ivers J, Yackley JJ, Kessentini M, Ozkaya I, Gaaloul K (2023) Dependent or not: detecting and understanding collections of refactorings. IEEE Trans Softw Eng 49(6):3344–3358 Ferreira T, Ivers J, Yackley JJ, Kessentini M, Ozkaya I, Gaaloul K (2023) Dependent or not: detecting and understanding collections of refactorings. IEEE Trans Softw Eng 49(6):3344–3358
go back to reference Fowler M, Beck K (1999) Refactoring: Improving the Design of Existing Code. Addison-Wesley Professional, Boston, Massachusetts Fowler M, Beck K (1999) Refactoring: Improving the Design of Existing Code. Addison-Wesley Professional, Boston, Massachusetts
go back to reference Goldstein M, Moshkovich D (2014) Improving software through automatic untangling of cyclic dependencies. In: Proceedings of the 36th international conference on software engineering (ICSE) companion, ACM, pp 155–164 Goldstein M, Moshkovich D (2014) Improving software through automatic untangling of cyclic dependencies. In: Proceedings of the 36th international conference on software engineering (ICSE) companion, ACM, pp 155–164
go back to reference Grover A, Leskovec J (2016) node2vec: scalable feature learning for networks. In: Proceedings of the 22nd ACM SIGKDD international conference on knowledge discovery and data mining (KDD), ACM, pp 855–864 Grover A, Leskovec J (2016) node2vec: scalable feature learning for networks. In: Proceedings of the 22nd ACM SIGKDD international conference on knowledge discovery and data mining (KDD), ACM, pp 855–864
go back to reference Jiang N, Lutellier T, Tan L (2021) Cure: code-aware neural machine translation for automatic program repair. In: Proceedings of the 43rd IEEE/ACM international conference on software engineering (ICSE), IEEE, pp 1161–1173 Jiang N, Lutellier T, Tan L (2021) Cure: code-aware neural machine translation for automatic program repair. In: Proceedings of the 43rd IEEE/ACM international conference on software engineering (ICSE), IEEE, pp 1161–1173
go back to reference Kim D, Nam J, Song J, Kim S (2013) Automatic patch generation learned from human-written patches. In: 2013 35th International conference on software engineering (ICSE), IEEE, pp 802–811 Kim D, Nam J, Song J, Kim S (2013) Automatic patch generation learned from human-written patches. In: 2013 35th International conference on software engineering (ICSE), IEEE, pp 802–811
go back to reference Kim M, Zimmermann T, Nagappan N (2014) An empirical study of refactoring challenges and benefits at microsoft. IEEE Trans Softw Eng 40(7):633–649CrossRef Kim M, Zimmermann T, Nagappan N (2014) An empirical study of refactoring challenges and benefits at microsoft. IEEE Trans Softw Eng 40(7):633–649CrossRef
go back to reference Koyuncu A, Liu K, Bissyandé TF, Kim D, Klein J, Monperrus M, Le Traon Y (2020) Fixminer: mining relevant fix patterns for automated program repair. Empir Softw Eng 25:1980–2024CrossRef Koyuncu A, Liu K, Bissyandé TF, Kim D, Klein J, Monperrus M, Le Traon Y (2020) Fixminer: mining relevant fix patterns for automated program repair. Empir Softw Eng 25:1980–2024CrossRef
go back to reference Lacerda G, Petrillo F, Pimenta M, Guéhéneuc YG (2020) Code smells and refactoring: a tertiary systematic review of challenges and observations. J Syst Softw 167:110610CrossRef Lacerda G, Petrillo F, Pimenta M, Guéhéneuc YG (2020) Code smells and refactoring: a tertiary systematic review of challenges and observations. J Syst Softw 167:110610CrossRef
go back to reference Lakos J (1996) Large-Scale C++ Software Design. Addison-Wesley, Reading, MA Lakos J (1996) Large-Scale C++ Software Design. Addison-Wesley, Reading, MA
go back to reference Li R, Liang P, Soliman M, Avgeriou P (2022) Understanding software architecture erosion: a systematic mapping study. J Softw: Evol Proc 34(3):e2423 Li R, Liang P, Soliman M, Avgeriou P (2022) Understanding software architecture erosion: a systematic mapping study. J Softw: Evol Proc 34(3):e2423
go back to reference Li Y, Wang S, Nguyen TN (2020) Dlfix: context-based code transformation learning for automated program repair. In: Proceedings of the 42nd ACM/IEEE international conference on software engineering (ICSE), ACM, pp 602–614 Li Y, Wang S, Nguyen TN (2020) Dlfix: context-based code transformation learning for automated program repair. In: Proceedings of the 42nd ACM/IEEE international conference on software engineering (ICSE), ACM, pp 602–614
go back to reference Lin Y, Peng X, Cai Y, Dig D, Zheng D, Zhao W (2016) Interactive and guided architectural refactoring with search-based recommendation. In: Proceedings of the 24th ACM SIGSOFT international symposium on foundations of software engineering (FSE), ACM, pp 535–546 Lin Y, Peng X, Cai Y, Dig D, Zheng D, Zhao W (2016) Interactive and guided architectural refactoring with search-based recommendation. In: Proceedings of the 24th ACM SIGSOFT international symposium on foundations of software engineering (FSE), ACM, pp 535–546
go back to reference Liu H, Liu Q, Liu Y, Wang Z (2015) Identifying renaming opportunities by expanding conducted rename refactorings. IEEE Trans Softw Eng 41(9):887–900CrossRef Liu H, Liu Q, Liu Y, Wang Z (2015) Identifying renaming opportunities by expanding conducted rename refactorings. IEEE Trans Softw Eng 41(9):887–900CrossRef
go back to reference Liu W, Chen B, Peng X, Sun Q, Zhao W (2021) Identifying change patterns of api misuses from code changes. Science China Information Sciences 64:1–19CrossRef Liu W, Chen B, Peng X, Sun Q, Zhao W (2021) Identifying change patterns of api misuses from code changes. Science China Information Sciences 64:1–19CrossRef
go back to reference Lu Y, Lou Y, Cheng S, Zhang L, Hao D, Zhou Y, Zhang L (2016) How does regression test prioritization perform in real-world software evolution? In: Proceedings of the 38th IEEE/ACM international conference on software engineering (ICSE), IEEE, pp 535–546 Lu Y, Lou Y, Cheng S, Zhang L, Hao D, Zhou Y, Zhang L (2016) How does regression test prioritization perform in real-world software evolution? In: Proceedings of the 38th IEEE/ACM international conference on software engineering (ICSE), IEEE, pp 535–546
go back to reference MacCormack A, Rusnak J, Baldwin CY (2006) Exploring the structure of complex software designs: an empirical study of open source and proprietary code. Manag Sci 52(7):1015–1030CrossRef MacCormack A, Rusnak J, Baldwin CY (2006) Exploring the structure of complex software designs: an empirical study of open source and proprietary code. Manag Sci 52(7):1015–1030CrossRef
go back to reference Melton H, Tempero E (2007) An empirical study of cycles among classes in java. Empir Softw Eng 12(4):389–415CrossRef Melton H, Tempero E (2007) An empirical study of cycles among classes in java. Empir Softw Eng 12(4):389–415CrossRef
go back to reference Meng N, Kim M, McKinley KS (2013) Lase: locating and applying systematic edits by learning from examples. In: 2013 35th international conference on software engineering (ICSE), IEEE, pp 502–511 Meng N, Kim M, McKinley KS (2013) Lase: locating and applying systematic edits by learning from examples. In: 2013 35th international conference on software engineering (ICSE), IEEE, pp 502–511
go back to reference Mo R, Cai Y, Kazman R, Xiao L, Feng Q (2019) Architecture anti-patterns: automatically detectable violations of design principles. IEEE Trans Softw Eng 47(5):1008–1028CrossRef Mo R, Cai Y, Kazman R, Xiao L, Feng Q (2019) Architecture anti-patterns: automatically detectable violations of design principles. IEEE Trans Softw Eng 47(5):1008–1028CrossRef
go back to reference Oyetoyan TD, Cruzes DS, Conradi R (2013) A study of cyclic dependencies on defect profile of software components. J Syst Softw 86(12):3162–3182CrossRef Oyetoyan TD, Cruzes DS, Conradi R (2013) A study of cyclic dependencies on defect profile of software components. J Syst Softw 86(12):3162–3182CrossRef
go back to reference Oyetoyan TD, Cruzes DS, Conradi R (2014) Transition and defect patterns of components in dependency cycles during software evolution. In: Proceedings of the software evolution week - IEEE conference on software maintenance, reengineering, and reverse engineering (CSMR-WCRE), IEEE, pp 283–292 Oyetoyan TD, Cruzes DS, Conradi R (2014) Transition and defect patterns of components in dependency cycles during software evolution. In: Proceedings of the software evolution week - IEEE conference on software maintenance, reengineering, and reverse engineering (CSMR-WCRE), IEEE, pp 283–292
go back to reference Oyetoyan TD, Cruzes DS, Thurmann-Nielsen C (2015) A decision support system to refactor class cycles. In: Proceedings of the 31st IEEE international conference on software maintenance and evolution (ICSME), IEEE, pp 231–240 Oyetoyan TD, Cruzes DS, Thurmann-Nielsen C (2015) A decision support system to refactor class cycles. In: Proceedings of the 31st IEEE international conference on software maintenance and evolution (ICSME), IEEE, pp 231–240
go back to reference Perozzi B, Al-Rfou R, Skiena S (2014) Deepwalk: online learning of social representations. In: Proceedings of the 20th ACM SIGKDD international conference on knowledge discovery and data mining (KDD), ACM, pp 701–710 Perozzi B, Al-Rfou R, Skiena S (2014) Deepwalk: online learning of social representations. In: Proceedings of the 20th ACM SIGKDD international conference on knowledge discovery and data mining (KDD), ACM, pp 701–710
go back to reference Peruma A, Simmons S, AlOmar EA, Newman CD, Mkaouer MW, Ouni A (2022) How do i refactor this? an empirical study on refactoring trends and topics in stack overflow. Empir Softw Eng 27(1):Article number: 11 Peruma A, Simmons S, AlOmar EA, Newman CD, Mkaouer MW, Ouni A (2022) How do i refactor this? an empirical study on refactoring trends and topics in stack overflow. Empir Softw Eng 27(1):Article number: 11
go back to reference Shah SMA, Dietrich J, McCartin C (2012) Making smart moves to untangle programs. In: Proceedings of the 16th european conference on software maintenance and reengineering (CSMR), IEEE, pp 359–364 Shah SMA, Dietrich J, McCartin C (2012) Making smart moves to untangle programs. In: Proceedings of the 16th european conference on software maintenance and reengineering (CSMR), IEEE, pp 359–364
go back to reference Shah SMA, Dietrich J, McCartin C (2013) On the automation of dependency-breaking refactorings in java. In: Proceedings of the 29th IEEE international conference on software maintenance (ICSM), IEEE, pp 160–169 Shah SMA, Dietrich J, McCartin C (2013) On the automation of dependency-breaking refactorings in java. In: Proceedings of the 29th IEEE international conference on software maintenance (ICSM), IEEE, pp 160–169
go back to reference Sharir M (1981) A strong-connectivity algorithm and its applications in data flow analysis. Computers & Mathematics with Applications 7(1):67–72MathSciNetCrossRef Sharir M (1981) A strong-connectivity algorithm and its applications in data flow analysis. Computers & Mathematics with Applications 7(1):67–72MathSciNetCrossRef
go back to reference Sharma T, Suryanarayana G, Samarthyam G (2015) Challenges to and solutions for refactoring adoption: an industrial perspective. IEEE Softw 32(6):44–51CrossRef Sharma T, Suryanarayana G, Samarthyam G (2015) Challenges to and solutions for refactoring adoption: an industrial perspective. IEEE Softw 32(6):44–51CrossRef
go back to reference Snipes W, Karlekar S, Mo R (2018) A case study of the effects of architecture debt on software evolution effort. In: Proceedings of the 44th euromicro conference on software engineering and advanced applications (SEAA), IEEE, pp 400–403 Snipes W, Karlekar S, Mo R (2018) A case study of the effects of architecture debt on software evolution effort. In: Proceedings of the 44th euromicro conference on software engineering and advanced applications (SEAA), IEEE, pp 400–403
go back to reference Tan SH, Roychoudhury A (2015) relifix: automated repair of software regressions. In: Proceedings of the 37th IEEE/ACM IEEE international conference on software engineering (ICSE), IEEE, vol 1, pp 471–482 Tan SH, Roychoudhury A (2015) relifix: automated repair of software regressions. In: Proceedings of the 37th IEEE/ACM IEEE international conference on software engineering (ICSE), IEEE, vol 1, pp 471–482
go back to reference Terra R, Valente MT, Miranda S, Sales V (2018) Jmove: a novel heuristic and tool to detect move method refactoring opportunities. J Syst Softw 138:19–36CrossRef Terra R, Valente MT, Miranda S, Sales V (2018) Jmove: a novel heuristic and tool to detect move method refactoring opportunities. J Syst Softw 138:19–36CrossRef
go back to reference Tsantalis N, Chatzigeorgiou A (2009) Identification of move method refactoring opportunities. IEEE Trans Softw Eng 35(3):347–367CrossRef Tsantalis N, Chatzigeorgiou A (2009) Identification of move method refactoring opportunities. IEEE Trans Softw Eng 35(3):347–367CrossRef
go back to reference Tsantalis N, Chaikalis T, Chatzigeorgiou A (2018) Ten years of jdeodorant: lessons learned from the hunt for smells. In: Proceedings of the 25th IEEE international conference on software analysis, evolution and reengineering (SANER), IEEE, pp 4–14 Tsantalis N, Chaikalis T, Chatzigeorgiou A (2018) Ten years of jdeodorant: lessons learned from the hunt for smells. In: Proceedings of the 25th IEEE international conference on software analysis, evolution and reengineering (SANER), IEEE, pp 4–14
go back to reference Tsantalis N, Ketkar A, Dig D (2022) Refactoringminer 2.0. IEEE Trans Softw Eng 48(3):930–950 Tsantalis N, Ketkar A, Dig D (2022) Refactoringminer 2.0. IEEE Trans Softw Eng 48(3):930–950
go back to reference Xiao L, Cai Y, Kazman R, Mo R, Feng Q (2022) Detecting the locations and predicting the costs of compound architectural debts. IEEE Trans Softw Eng 48(9):3686–3715CrossRef Xiao L, Cai Y, Kazman R, Mo R, Feng Q (2022) Detecting the locations and predicting the costs of compound architectural debts. IEEE Trans Softw Eng 48(9):3686–3715CrossRef
go back to reference Zazworka N, Vetro A, Izurieta C, Wong S, Cai Y, Seaman C, Shull F (2013) Comparing four approaches for technical debt identification. Softw Qual J 22:403–426 Zazworka N, Vetro A, Izurieta C, Wong S, Cai Y, Seaman C, Shull F (2013) Comparing four approaches for technical debt identification. Softw Qual J 22:403–426
Metadata
Title
An empirical study of untangling patterns of two-class dependency cycles
Authors
Qiong Feng
Shuwen Liu
Huan Ji
Xiaotian Ma
Peng Liang
Publication date
01-03-2024
Publisher
Springer US
Published in
Empirical Software Engineering / Issue 2/2024
Print ISSN: 1382-3256
Electronic ISSN: 1573-7616
DOI
https://doi.org/10.1007/s10664-023-10438-0

Other articles of this Issue 2/2024

Empirical Software Engineering 2/2024 Go to the issue

Premium Partner