Skip to main content
Erschienen in: Automated Software Engineering 1/2024

01.06.2024

MIRROR: multi-objective refactoring recommendation via correlation analysis

verfasst von: Yang Zhang, Ke Guan, Lining Fang

Erschienen in: Automated Software Engineering | Ausgabe 1/2024

Einloggen

Aktivieren Sie unsere intelligente Suche, um passende Fachinhalte oder Patente zu finden.

search-config
loading …

Abstract

Refactoring is a critical but complex process to improve code quality by altering software structure without changing the observable behavior. Search-based approaches have been proposed to recommend refactoring solutions. However, existing works tend to leverage all the sub-attributes in an objective and ignore the relationship between the sub-attributes. Furthermore, the types of refactoring operations in the existing works can be further augmented. To this end, this paper proposes a novel approach, called MIRROR, to recommend refactoring by employing a multi-objective optimization across three objectives: (i) improving quality, (ii) removing code smell, and (iii) maximizing the similarity to refactoring history. Unlike previous works, MIRROR provides a way to further optimize attributes in each objective. To be more specific, given an objective, MIRROR investigates the possible correlations among attributes and selects those attributes with low correlations as the representation of this objective. MIRROR is evaluated on 6 real-world projects by answering 6 research questions. The experimental results demonstrate that MIRROR recommends an average of 43 solutions for each project. Furthermore, we compare MIRROR against existing tools JMove and QMove, and show that the F1 of MIRROR is 5.63% and 3.75% higher than that of JMove and QMove, demonstrating the effectiveness of MIRROR.

Sie haben noch keine Lizenz? Dann Informieren Sie sich jetzt über unsere Produkte:

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!

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"

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!

Literatur
Zurück zum Zitat Aniche, M.F., Maziero, E., Durelli, R.S., Durelli, V.H.S.: The effectiveness of supervised machine learning algorithms in predicting software refactoring, CoRR abs/2001.03338 (2020). arXiv:2001.03338 Aniche, M.F., Maziero, E., Durelli, R.S., Durelli, V.H.S.: The effectiveness of supervised machine learning algorithms in predicting software refactoring, CoRR abs/2001.03338 (2020). arXiv:​2001.​03338
Zurück zum Zitat Antezana, A.S.: TOAD: a tool for recommending auto-refactoring alternatives, in: J. M. Atlee, T. Bultan, J. Whittle (Eds.), Proceedings of the 41st International Conference on Software Engineering: Companion Proceedings, ICSE 2019, Montreal, QC, Canada, May 25-31, 2019, IEEE ACM, pp. 174–176 (2019). https://doi.org/10.1109/ICSE-Companion.2019.00071 Antezana, A.S.: TOAD: a tool for recommending auto-refactoring alternatives, in: J. M. Atlee, T. Bultan, J. Whittle (Eds.), Proceedings of the 41st International Conference on Software Engineering: Companion Proceedings, ICSE 2019, Montreal, QC, Canada, May 25-31, 2019, IEEE ACM, pp. 174–176 (2019). https://​doi.​org/​10.​1109/​ICSE-Companion.​2019.​00071
Zurück zum Zitat Bell, D.: Software engineering: A programming approach, software engineering: a programming approach (2000) Bell, D.: Software engineering: A programming approach, software engineering: a programming approach (2000)
Zurück zum Zitat Brown, W.J., Malveau, R.C., Mccormick, H.W., Mowbray, T.J.: Anti patterns: Refactoring software, architectures, and projects in crisis (1998) Brown, W.J., Malveau, R.C., Mccormick, H.W., Mowbray, T.J.: Anti patterns: Refactoring software, architectures, and projects in crisis (1998)
Zurück zum Zitat Cinnéide, M. Ó., Tratt, L., Harman, M., Counsell, S., Moghadam, I.H.: Experimental assessment of software metrics using automated refactoring, in: P. Runeson, M. Höst, E. Mendes, A. A. Andrews, R. Harrison (Eds.), 2012 ACM-IEEE International Symposium on Empirical Software Engineering and Measurement, ESEM ’12, Lund, Sweden - September 19 - 20, 2012, ACM, pp. 49–58 (2012). https://doi.org/10.1145/2372251.2372260 Cinnéide, M. Ó., Tratt, L., Harman, M., Counsell, S., Moghadam, I.H.: Experimental assessment of software metrics using automated refactoring, in: P. Runeson, M. Höst, E. Mendes, A. A. Andrews, R. Harrison (Eds.), 2012 ACM-IEEE International Symposium on Empirical Software Engineering and Measurement, ESEM ’12, Lund, Sweden - September 19 - 20, 2012, ACM, pp. 49–58 (2012). https://​doi.​org/​10.​1145/​2372251.​2372260
Zurück zum Zitat Couto, C.M.S., Rocha, H., Terra, R.: A quality-oriented approach to recommend move method refactorings, in: A. Malucelli, S. S. Reinehr (Eds.), Proceedings of the 17th Brazilian Symposium on Software Quality, SBQS 2018, Curitiba, Brazil, October 17-19, 2018, ACM, pp. 11–20 (2018). https://doi.org/10.1145/3275245.3275247 Couto, C.M.S., Rocha, H., Terra, R.: A quality-oriented approach to recommend move method refactorings, in: A. Malucelli, S. S. Reinehr (Eds.), Proceedings of the 17th Brazilian Symposium on Software Quality, SBQS 2018, Curitiba, Brazil, October 17-19, 2018, ACM, pp. 11–20 (2018). https://​doi.​org/​10.​1145/​3275245.​3275247
Zurück zum Zitat Deb, K., Saxena, D.: Searching for pareto-optimal solutions through dimensionality reduction for certain large-dimensional multi-objective optimization problems. Comput. Intell. 56, 3352–3360 (2006) Deb, K., Saxena, D.: Searching for pareto-optimal solutions through dimensionality reduction for certain large-dimensional multi-objective optimization problems. Comput. Intell. 56, 3352–3360 (2006)
Zurück zum Zitat Deb, K., Jain, H.: An evolutionary many-objective optimization algorithm using reference-point-based nondominated sorting approach, part i: Solving problems with box constraints. IEEE Trans. Evol. Comput. 18(4), 577–601 (2014)CrossRef Deb, K., Jain, H.: An evolutionary many-objective optimization algorithm using reference-point-based nondominated sorting approach, part i: Solving problems with box constraints. IEEE Trans. Evol. Comput. 18(4), 577–601 (2014)CrossRef
Zurück zum Zitat Fokaefs, M., Tsantalis, N., Chatzigeorgiou, A.: Jdeodorant: Identification and removal of feature envy bad smells, in: 23rd IEEE International Conference on Software Maintenance (ICSM 2007), October 2-5, 2007, Paris, France, IEEE Computer Society, pp. 519–520 (2007). https://doi.org/10.1109/ICSM.2007.4362679 Fokaefs, M., Tsantalis, N., Chatzigeorgiou, A.: Jdeodorant: Identification and removal of feature envy bad smells, in: 23rd IEEE International Conference on Software Maintenance (ICSM 2007), October 2-5, 2007, Paris, France, IEEE Computer Society, pp. 519–520 (2007). https://​doi.​org/​10.​1109/​ICSM.​2007.​4362679
Zurück zum Zitat Foster, S.R., Griswold, W.G., Lerner, S.: Witchdoctor: IDE support for real-time auto-completion of refactorings, in: M. Glinz, G. C. Murphy, M. Pezzè (Eds.), 34th International Conference on Software Engineering, ICSE 2012, June 2-9, 2012, Zurich, Switzerland, IEEE Computer Society, pp. 222–232 (2012). https://doi.org/10.1109/ICSE.2012.6227191 Foster, S.R., Griswold, W.G., Lerner, S.: Witchdoctor: IDE support for real-time auto-completion of refactorings, in: M. Glinz, G. C. Murphy, M. Pezzè (Eds.), 34th International Conference on Software Engineering, ICSE 2012, June 2-9, 2012, Zurich, Switzerland, IEEE Computer Society, pp. 222–232 (2012). https://​doi.​org/​10.​1109/​ICSE.​2012.​6227191
Zurück zum Zitat Griffith, I., Wahl, S., Izurieta, C.: Truerefactor: An automated refactoring tool to improve legacy system and application comprehensibility, in: 24th Intenational Conference on Computer Applications in Industry and Engineering 2011, Couer Science Deren, Monn Se Universiy, Honolulu, Hawaii, USA, pp. 316–321 (2011) Griffith, I., Wahl, S., Izurieta, C.: Truerefactor: An automated refactoring tool to improve legacy system and application comprehensibility, in: 24th Intenational Conference on Computer Applications in Industry and Engineering 2011, Couer Science Deren, Monn Se Universiy, Honolulu, Hawaii, USA, pp. 316–321 (2011)
Zurück zum Zitat Koza, J.R.: Genetic programming on the programming of computers by means of natural selection. MIT Press, Complex adaptive systems (1993) Koza, J.R.: Genetic programming on the programming of computers by means of natural selection. MIT Press, Complex adaptive systems (1993)
Zurück zum Zitat Lin, Y., Peng, X., Cai, Y., Dig, D., Zheng, D., Zhao, W.: Interactive and guided architectural refactoring with search-based recommendation, in: T. Zimmermann, J. Cleland-Huang, Z. Su (Eds.), Proceedings of the 24th ACM SIGSOFT International Symposium on Foundations of Software Engineering, FSE 2016, Seattle, WA, USA, November 13-18, 2016, ACM, pp. 535–546 (2016). https://doi.org/10.1145/2950290.2950317 Lin, Y., Peng, X., Cai, Y., Dig, D., Zheng, D., Zhao, W.: Interactive and guided architectural refactoring with search-based recommendation, in: T. Zimmermann, J. Cleland-Huang, Z. Su (Eds.), Proceedings of the 24th ACM SIGSOFT International Symposium on Foundations of Software Engineering, FSE 2016, Seattle, WA, USA, November 13-18, 2016, ACM, pp. 535–546 (2016). https://​doi.​org/​10.​1145/​2950290.​2950317
Zurück zum Zitat Marinescu, C., Marinescu, R., Mihancea, P.F., Ratiu, D., Wettel, R.: iplasma: An integrated platform for quality assessment of object-oriented design, in: Proceedings of the 21st IEEE International Conference on Software Maintenance - Industrial and Tool volume, ICSM 2005, 25-30 September 2005, Budapest, Hungary, pp. 77–80 (2005) Marinescu, C., Marinescu, R., Mihancea, P.F., Ratiu, D., Wettel, R.: iplasma: An integrated platform for quality assessment of object-oriented design, in: Proceedings of the 21st IEEE International Conference on Software Maintenance - Industrial and Tool volume, ICSM 2005, 25-30 September 2005, Budapest, Hungary, pp. 77–80 (2005)
Zurück zum Zitat Mkaouer, M.W., Kessentini, M., Bechikh, S., Deb, K., Cinnéide, M. Ó.: Recommendation system for software refactoring using innovization and interactive dynamic optimization, in: I. Crnkovic, M. Chechik, P. Grünbacher (Eds.), ACM/IEEE International Conference on Automated Software Engineering, ASE ’14, Vasteras, Sweden - September 15 - 19, ACM, 2014, pp. 331–336 (2014). https://doi.org/10.1145/2642937.2642965 Mkaouer, M.W., Kessentini, M., Bechikh, S., Deb, K., Cinnéide, M. Ó.: Recommendation system for software refactoring using innovization and interactive dynamic optimization, in: I. Crnkovic, M. Chechik, P. Grünbacher (Eds.), ACM/IEEE International Conference on Automated Software Engineering, ASE ’14, Vasteras, Sweden - September 15 - 19, ACM, 2014, pp. 331–336 (2014). https://​doi.​org/​10.​1145/​2642937.​2642965
Zurück zum Zitat Moha, N., Hacene, A.R., Valtchev, P., Guéhéneuc, Y.: Refactorings of design defects using relational concept analysis, in: R. Medina, S. A. Obiedkov (Eds.), Formal Concept Analysis, 6th International Conference, ICFCA 2008, Montreal, Canada, February 25-28, Proceedings, Vol. 4933 of Lecture Notes in Computer Science, Springer, 2008, pp. 289–304 (2008). https://doi.org/10.1007/978-3-540-78137-0_21 Moha, N., Hacene, A.R., Valtchev, P., Guéhéneuc, Y.: Refactorings of design defects using relational concept analysis, in: R. Medina, S. A. Obiedkov (Eds.), Formal Concept Analysis, 6th International Conference, ICFCA 2008, Montreal, Canada, February 25-28, Proceedings, Vol. 4933 of Lecture Notes in Computer Science, Springer, 2008, pp. 289–304 (2008). https://​doi.​org/​10.​1007/​978-3-540-78137-0_​21
Zurück zum Zitat Mohan, M., Greer, D.: Multirefactor: Automated refactoring to improve software quality, in: M. Felderer, D. M. Fernández, B. Turhan, M. Kalinowski, F. Sarro, D. Winkler (Eds.), Product-Focused Software Process Improvement - 18th International Conference, PROFES 2017, Innsbruck, Austria, November 29 - December 1, 2017, Proceedings, Vol. 10611 of Lecture Notes in Computer Science, Springer International Publishing, pp. 556–572 (2017). https://doi.org/10.1007/978-3-319-69926-4_46 Mohan, M., Greer, D.: Multirefactor: Automated refactoring to improve software quality, in: M. Felderer, D. M. Fernández, B. Turhan, M. Kalinowski, F. Sarro, D. Winkler (Eds.), Product-Focused Software Process Improvement - 18th International Conference, PROFES 2017, Innsbruck, Austria, November 29 - December 1, 2017, Proceedings, Vol. 10611 of Lecture Notes in Computer Science, Springer International Publishing, pp. 556–572 (2017). https://​doi.​org/​10.​1007/​978-3-319-69926-4_​46
Zurück zum Zitat Nan, W., Song, F., Li, X.: Quantum search-based software engineering: an exploratory study. Sci. Sin. Inf. 45(5), 623 (2015) Nan, W., Song, F., Li, X.: Quantum search-based software engineering: an exploratory study. Sci. Sin. Inf. 45(5), 623 (2015)
Zurück zum Zitat Ouni, A., Kessentini, M., Sahraoui, H.A., Hamdi, M.S.: The use of development history in software refactoring using a multi-objective evolutionary algorithm, in: C. Blum, E. Alba (Eds.), Genetic and Evolutionary Computation Conference, GECCO ’13, Amsterdam, The Netherlands, July 6-10, ACM, 2013, pp. 1461–1468 (2013). https://doi.org/10.1145/2463372.2463554 Ouni, A., Kessentini, M., Sahraoui, H.A., Hamdi, M.S.: The use of development history in software refactoring using a multi-objective evolutionary algorithm, in: C. Blum, E. Alba (Eds.), Genetic and Evolutionary Computation Conference, GECCO ’13, Amsterdam, The Netherlands, July 6-10, ACM, 2013, pp. 1461–1468 (2013). https://​doi.​org/​10.​1145/​2463372.​2463554
Zurück zum Zitat Ouni, A., Kessentini, M., Cinnéide, M.Ó., Sahraoui, H.A., Deb, K., Inoue, K.: MORE: a multi-objective refactoring recommendation approach to introducing design patterns and fixing code smells. J. Softw. Evol. Process 29(5), e1843 (2017). https://doi.org/10.1002/smr.1843CrossRef Ouni, A., Kessentini, M., Cinnéide, M.Ó., Sahraoui, H.A., Deb, K., Inoue, K.: MORE: a multi-objective refactoring recommendation approach to introducing design patterns and fixing code smells. J. Softw. Evol. Process 29(5), e1843 (2017). https://​doi.​org/​10.​1002/​smr.​1843CrossRef
Zurück zum Zitat Ouni, A.: A multi-objective refactoring approach to introduce design patterns and fix anti-patterns (2015) Ouni, A.: A multi-objective refactoring approach to introduce design patterns and fix anti-patterns (2015)
Zurück zum Zitat Tsantalis, N., Mansouri, M., Eshkevari, L.M., Mazinanian, D., Dig, D.: Accurate and efficient refactoring detection in commit history, in: M. Chaudron, I. Crnkovic, M. Chechik, M. Harman (Eds.), Proceedings of the 40th International Conference on Software Engineering, ICSE 2018, Gothenburg, Sweden, May 27 - June 03, 2018, ACM, pp. 483–494 (2018). https://doi.org/10.1145/3180155.3180206 Tsantalis, N., Mansouri, M., Eshkevari, L.M., Mazinanian, D., Dig, D.: Accurate and efficient refactoring detection in commit history, in: M. Chaudron, I. Crnkovic, M. Chechik, M. Harman (Eds.), Proceedings of the 40th International Conference on Software Engineering, ICSE 2018, Gothenburg, Sweden, May 27 - June 03, 2018, ACM, pp. 483–494 (2018). https://​doi.​org/​10.​1145/​3180155.​3180206
Zurück zum Zitat Ujihara, N., Ouni, A., Ishio, T., Inoue, K.: c-jrefrec: Change-based identification of move method refactoring opportunities, in: M. Pinzger, G. Bavota, A. Marcus (Eds.), IEEE 24th International Conference on Software Analysis, Evolution and Reengineering, SANER 2017, Klagenfurt, Austria, February 20-24, 2017, IEEE Computer Society, pp. 482–486 (2017). https://doi.org/10.1109/SANER.2017.7884658 Ujihara, N., Ouni, A., Ishio, T., Inoue, K.: c-jrefrec: Change-based identification of move method refactoring opportunities, in: M. Pinzger, G. Bavota, A. Marcus (Eds.), IEEE 24th International Conference on Software Analysis, Evolution and Reengineering, SANER 2017, Klagenfurt, Austria, February 20-24, 2017, IEEE Computer Society, pp. 482–486 (2017). https://​doi.​org/​10.​1109/​SANER.​2017.​7884658
Zurück zum Zitat Zanetti, M.S., Tessone, C.J., Scholtes, I., Schweitzer, F.: Automated software remodularization based on move refactoring: a complex systems approach, in: W. Binder, E. Ernst, A. Peternier, R. Hirschfeld (Eds.), 13th International Conference on Modularity, MODULARITY ’14, Lugano, Switzerland, April 22-26, ACM, 2014, pp. 73–84 (2014). https://doi.org/10.1145/2577080.2577097 Zanetti, M.S., Tessone, C.J., Scholtes, I., Schweitzer, F.: Automated software remodularization based on move refactoring: a complex systems approach, in: W. Binder, E. Ernst, A. Peternier, R. Hirschfeld (Eds.), 13th International Conference on Modularity, MODULARITY ’14, Lugano, Switzerland, April 22-26, ACM, 2014, pp. 73–84 (2014). https://​doi.​org/​10.​1145/​2577080.​2577097
Zurück zum Zitat Zhang, Y., Dong, C., Liu, H., Ge, C.: Code smell detection approach based on pre-training model and multi-level information. J. Softw. 005, 033 (2022a) Zhang, Y., Dong, C., Liu, H., Ge, C.: Code smell detection approach based on pre-training model and multi-level information. J. Softw. 005, 033 (2022a)
Metadaten
Titel
MIRROR: multi-objective refactoring recommendation via correlation analysis
verfasst von
Yang Zhang
Ke Guan
Lining Fang
Publikationsdatum
01.06.2024
Verlag
Springer US
Erschienen in
Automated Software Engineering / Ausgabe 1/2024
Print ISSN: 0928-8910
Elektronische ISSN: 1573-7535
DOI
https://doi.org/10.1007/s10515-023-00400-1

Weitere Artikel der Ausgabe 1/2024

Automated Software Engineering 1/2024 Zur Ausgabe

Premium Partner