Nothing Special   »   [go: up one dir, main page]

skip to main content
review-article

On preserving the behavior in software refactoring: : A systematic mapping study

Published: 01 December 2021 Publication History

Abstract

Context:

Refactoring is the art of modifying the design of a system without altering its behavior. The idea is to reorganize variables, classes and methods to facilitate their future adaptations and comprehension. As the concept of behavior preservation is fundamental for refactoring, several studies, using formal verification, language transformation and dynamic analysis, have been proposed to monitor the execution of refactoring operations and their impact on the program semantics. However, there is no existing study that examines the available behavior preservation strategies for each refactoring operation.

Objective:

This paper identifies behavior preservation approaches in the research literature.

Method:

We conduct, in this paper, a systematic mapping study, to capture all existing behavior preservation approaches that we classify based on several criteria including their methodology, applicability, and their degree of automation.

Results:

The results indicate that several behavior preservation approaches have been proposed in the literature. The approaches vary between using formalisms and techniques, developing automatic refactoring safety tools, and performing a manual analysis of the source code.

Conclusion:

Our taxonomy reveals that there exist some types of refactoring operations whose behavior preservation is under-researched. Our classification also indicates that several possible strategies can be combined to better detect any violation of the program semantics.

References

[1]
Kim M., Zimmermann T., Nagappan N., An empirical study of refactoring challenges and benefits at microsoft, IEEE Trans. Softw. Eng. 40 (7) (2014) 633–649.
[2]
Silva D., Tsantalis N., Valente M.T., Why we refactor? Confessions of github contributors, in: Proceedings of the 2016 24th ACM SIGSOFT International Symposium on Foundations of Software Engineering, in: FSE 2016, ACM, New York, NY, USA, 2016, pp. 858–870,.
[3]
Murphy-Hill E., Parnin C., Black A.P., How we refactor, and how we know it, IEEE Trans. Softw. Eng. 38 (1) (2012) 5–18,.
[4]
Kitchenham B., Charters S., Guidelines for performing systematic literature reviews in software engineering, 2007.
[5]
C. Wohlin, Guidelines for snowballing in systematic literature studies and a replication in software engineering, in: Proceedings of the 18th International Conference on Evaluation and Assessment in Software Engineering, 2014, pp. 1–10.
[6]
K. Petersen, R. Feldt, S. Mujtaba, M. Mattsson, Systematic mapping studies in software engineering, in: 12th International Conference on Evaluation and Assessment in Software Engineering (EASE) 12, 2008, pp. 1–10.
[7]
Fowler M., Beck K., Brant J., Opdyke W., Roberts d., Refactoring: Improving the Design of Existing Code, Addison-Wesley Longman Publishing Co., Inc., Boston, MA, USA, 1999, http://dl.acm.org/citation.cfm?id=311424.
[8]
Opdyke W.F., Refactoring object-oriented frameworks, (Ph.D. thesis) University of Illinois at Urbana-Champaign, Champaign, IL, USA, 1992, UMI Order No. GAX93-05645.
[9]
Mens T., Tourwe T., A survey of software refactoring, IEEE Trans. Softw. Eng. 30 (2) (2004) 126–139,.
[10]
Zhang M., Hall T., Baddoo N., Code bad smells: A review of current knowledge, J. Softw. Maint. Evol. 23 (3) (2011) 179–202,.
[11]
Abebe M., Yoo C.-J., Trends, opportunities and challenges of software refactoring: A systematic literature review, Int. J. Softw. Eng. Appl. 8 (2014) 299–318.
[12]
Misbhauddin M., Alshayeb M., UML model refactoring: a systematic literature review, Empir. Softw. Eng. 20 (1) (2015) 206–251,.
[13]
Dallal J.A., Identifying refactoring opportunities in object-oriented code: A systematic literature review, Inf. Softw. Technol. 58 (2015) 231–249,. http://www.sciencedirect.com/science/article/pii/S0950584914001918.
[14]
Singh S., Kaur S., A systematic literature review: Refactoring for disclosing code smells in object oriented software, Ain Shams Eng. J. (2017),. http://www.sciencedirect.com/science/article/pii/S2090447917300412.
[15]
Dallal J.A., Abdin A., Empirical evaluation of the impact of object-oriented code refactoring on quality attributes: A systematic literature review, IEEE Trans. Softw. Eng. PP (99) (2017) 1,.
[16]
Mariani T., Vergilio S.R., A systematic review on search-based refactoring, Inf. Softw. Technol. 83 (2017) 14–34,. http://www.sciencedirect.com/science/article/pii/S0950584916303779.
[17]
Baqais A.A.B., Alshayeb M., Automatic software refactoring: a systematic literature review, Softw. Qual. J. 28 (2) (2020) 459–502.
[18]
Cinnéide M.O., Automated Application of Design Patterns: A Refactoring Approach, Trinity College Dublin, 2001.
[19]
Garousi V., Mäntylä M.V., A systematic literature review of literature reviews in software testing, Inf. Softw. Technol. 80 (2016) 195–216,. http://www.sciencedirect.com/science/article/pii/S0950584916301446.
[20]
. Hosseini, . Soodeh, . Azgomi, M. Abdollahi Azgomi, UML model refactoring with emphasis on behavior preservation, in: 2008 2nd IFIP/IEEE International Symposium on Theoretical Aspects of Software Engineering, 2008, p. 125.
[21]
Kitchenham B., Brereton P., A systematic review of systematic review process research in software engineering, Inf. Softw. Technol. 55 (12) (2013) 2049–2075,. http://www.sciencedirect.com/science/article/pii/S0950584913001560.
[22]
Roberts D., Brant J., Johnson R., A refactoring tool for smalltalk, Theory Pract. Object Syst. 3 (4) (1997) 253–263.
[23]
Mens T., Van Eetvelde N., Janssens D., Demeyer S., Formalising refactorings with graph transformations, 2003, p. 69.
[24]
Tip F., Kiezun A., Bäumer D., Refactoring for generalization using type constraints, in: Proceedings of the 18th Annual ACM SIGPLAN Conference on Object-Oriented Programing, Systems, Languages, and Applications, in: OOPSLA ’03, ACM, New York, NY, USA, 2003, pp. 13–26,.
[25]
Garrido A., Meseguer J., Formal specification and verification of java refactorings, in: 2006 Sixth IEEE International Workshop on Source Code Analysis and Manipulation, 2006, pp. 165–174,.
[26]
Van Der Straeten R., Jonckers V., Mens T., A formal approach to model refactoring and model refinement, Softw. Syst. Model. 6 (2) (2007) 139–162,.
[27]
Massoni T., Gheyi R., Borba P., Formal model-driven program refactoring, in: Proceedings of the Theory and Practice of Software, 11th International Conference on Fundamental Approaches To Software Engineering, in: FASE’08/ETAPS’08, Springer-Verlag, Berlin, Heidelberg, 2008, pp. 362–376. http://dl.acm.org/citation.cfm?id=1792838.1792873.
[28]
Soares G., Cavalcanti D., Gheyi R., Massoni T., Serey D., Cornélio M., Saferefactor-tool for checking refactoring safety, in: Tools Session At SBES, 2009.
[29]
Ubayashi N., Piao J., Shinotsuka S., Tamai T., Contract-based verification for aspect-oriented refactoring, in: 2008 1st International Conference on Software Testing, Verification, and Validation, IEEE, 2008, pp. 180–189.
[30]
M. Schäfer, T. Ekman, O. De Moor, Sound and extensible renaming for Java, in: Proceedings of the 23rd ACM SIGPLAN Conference on Object-Oriented Programming Systems Languages and Applications, 2008, pp. 277–294.
[31]
G. Soares, R. Gheyi, T. Massoni, M. Cornélio, D. Cavalcanti, Generating unit tests for checking refactoring safety, in: Brazilian Symposium on Programming Languages, 2009, pp. 159–172.
[32]
Tsantalis N., Chatzigeorgiou A., Identification of move method refactoring opportunities, IEEE Trans. Softw. Eng. 35 (3) (2009) 347–367,.
[33]
M. Schäfer, O. De Moor, Specifying and implementing refactorings, in: Proceedings of the ACM International Conference on Object Oriented Programming Systems Languages and Applications, 2010, pp. 286–301.
[34]
Soares G., Gheyi R., Serey D., Massoni T., Making program refactoring safer, IEEE Softw. 27 (4) (2010) 52–57,.
[35]
Tsantalis N., Chatzigeorgiou A., Identification of refactoring opportunities introducing polymorphism, J. Syst. Softw. 83 (3) (2010) 391–404.
[36]
Tip F., Fuhrer R.M., Kieżun A., Ernst M.D., Balaban I., De Sutter B., Refactoring using type constraints, ACM Trans. Program. Lang. Syst. 33 (3) (2011) 1–47.
[37]
G. Soares, D. Cavalcanti, R. Gheyi, Making aspect-oriented refactoring safer, in: Proceedings of the 15th Brazilian Symposium on Programming Languages, SBLP, Vol. 11, 2011, pp. 91–105.
[38]
Overbey J.L., Johnson R.E., Differential precondition checking: A lightweight, reusable analysis for refactoring tools, in: 2011 26th IEEE/ACM International Conference on Automated Software Engineering (ASE 2011), 2011, pp. 303–312,.
[39]
Soares G., Mongiovi M., Gheyi R., Identifying overly strong conditions in refactoring implementations, in: 2011 27th IEEE International Conference on Software Maintenance (ICSM), 2011, pp. 173–182,.
[40]
Soares G., Gheyi R., Murphy-Hill E., Johnson B., Comparing approaches to analyze refactoring activity on software repositories, J. Syst. Softw. 86 (4) (2013) 1006–1022,. http://www.sciencedirect.com/science/article/pii/S016412121200297X, SI : Software Engineering in Brazil: Retrospective and Prospective Views.
[41]
M. De Jonge, E. Visser, A language generic solution for name binding preservation in refactorings, in: Proceedings of the Twelfth Workshop on Language Descriptions, Tools, and Applications, 2012, pp. 1–8.
[42]
Noguera C., Kellens A., De Roover C., Jonckers V., Refactoring in the presence of annotations, in: 2012 28th IEEE International Conference on Software Maintenance (ICSM), IEEE, 2012, pp. 337–346.
[43]
A. Thies, E. Bodden, RefaFlex: Safer refactorings for reflective Java programs, in: Proceedings of the 2012 International Symposium on Software Testing and Analysis, 2012, pp. 1–11.
[44]
Mongiovi M., Gheyi R., Soares G., Teixeira L., Borba P., Making refactoring safer through impact analysis, Sci. Comput. Program. 93 (2014) 39–64,.
[45]
Najafi M., Haghighi H., Nasab T.Z., A set of refactoring rules for UML-B specifications, Comput. Inform. 35 (2) (2016) 411–440.
[46]
Horpácsi D., Köszegi J., Horváth Z., Trustworthy refactoring via decomposition and schemes: A complex case study, in: VPT@ETAPS, 2017.
[47]
Mongiovi M., Gheyi R., Soares G., Ribeiro M., Borba P., Teixeira L., Detecting overly strong preconditions in refactoring engines, IEEE Trans. Softw. Eng. 44 (5) (2018) 429–452,.
[48]
Chen Z., Guo H.-F., Song M., Improving regression test efficiency with an awareness of refactoring changes, Inf. Softw. Technol. 103 (2018) 174–187.
[49]
Insa D., Pérez S., Silva J., Tamarit S., Behaviour preservation across code versions in erlang, Sci. Program. 2018 (2018).
[50]
Tsantalis N., Mansouri M., Eshkevari L.M., Mazinanian D., Dig D., Accurate and efficient refactoring detection in commit history, in: Proceedings of the 40th International Conference on Software Engineering, ACM, 2018, pp. 483–494.
[51]
Peruma A., Mkaouer M.W., Decker M.J., Newman C.D., Contextualizing rename decisions using refactorings, commit messages, and data types, J. Syst. Softw. 169 (2020).
[52]
AlOmar E.A., Peruma A., Mkaouer M.W., Newman C., Ouni A., Kessentini M., How we refactor and how we document it? On the use of supervised machine learning algorithms to classify refactoring documentation, Expert Syst. Appl. 167 (2021).
[53]
Tsantalis N., Ketkar A., Dig D., Refactoringminer 2.0, IEEE Trans. Softw. Eng. (2020).
[54]
Baader F., The Description Logic Handbook: Theory, Implementation and Applications, Cambridge university press, 2003.
[55]
M. McKeeman W., Differential testing for software, Digit. Tech. J. 10 (1998) 100–107.
[56]
Dao T.-H., Le H.A., Truong N.T., An approach to analyzing execution preservation in java program refactoring, in: International Conference on Context-Aware Systems and Applications, Springer, 2016, pp. 101–110.
[57]
M. Mongiovi, Safira: A tool for evaluating behavior preservation, in: Proceedings of the ACM International Conference Companion on Object Oriented Programming Systems Languages and Applications Companion, 2011, pp. 213–214.
[58]
Ratzinger J., sPACE: Software project assessment in the course of evolution, (Ph.D. thesis) Vienna University of Technology, Austria, 2007, http://www.infosys.tuwien.ac.at/Staff/ratzinger/publications/ratzinger_phd-thesis_space.pdf.
[59]
Ratzinger J., Sigmund T., Gall H.C., On the relation of refactorings and software defect prediction, in: Proceedings of the 2008 International Working Conference on Mining Software Repositories, in: MSR ’08, ACM, New York, NY, USA, 2008, pp. 35–38,.
[60]
AlOmar E.A., Mkaouer M.W., Ouni A., Kessentini M., On the impact of refactoring on the relationship between quality attributes and design metrics, in: 2019 ACM/IEEE International Symposium on Empirical Software Engineering and Measurement (ESEM), IEEE, 2019, pp. 1–11.
[61]
Zhang D., Li B., Li Z., Liang P., A Preliminary Investigation of Self-Admitted Refactorings in Open Source Software, 2018,.
[62]
AlOmar E.A., Mkaouer M.W., Ouni A., Can refactoring be self-affirmed? an exploratory study on how developers document their refactoring activities in commit messages, in: Proceedings of the 3nd International Workshop on Refactoring-Accepted, IEEE, 2019.
[63]
Silva D., Valente M.T., Refdiff: Detecting refactorings in version histories, in: 2017 IEEE/ACM 14th International Conference on Mining Software Repositories (MSR), 2017, pp. 269–279,.
[64]
M. Vakilian, R.E. Johnson, Alternate refactoring paths reveal usability problems, in: Proceedings of the 36th International Conference on Software Engineering, 2014, pp. 1106–1116.
[65]
A. Bogart, E.A. AlOmar, M.W. Mkaouer, A. Ouni, Increasing the trust in refactoring through visualization, in: Proceedings of the IEEE/ACM 42nd International Conference on Software Engineering Workshops, 2020, pp. 334–341.

Cited By

View all
  • (2024)AntiCopyPaster 2.0: Whitebox just-in-time code duplicates extractionProceedings of the 2024 IEEE/ACM 46th International Conference on Software Engineering: Companion Proceedings10.1145/3639478.3640035(84-88)Online publication date: 14-Apr-2024
  • (2024)A Survey on Secure RefactoringSN Computer Science10.1007/s42979-024-03325-y5:7Online publication date: 12-Oct-2024
  • (2024)Automatic pattern-based consistency checking in model refactoring: introducing a formal behavioral preserving methodInnovations in Systems and Software Engineering10.1007/s11334-022-00525-820:1(65-84)Online publication date: 1-Mar-2024
  • Show More Cited By

Index Terms

  1. On preserving the behavior in software refactoring: A systematic mapping study
      Index terms have been assigned to the content through auto-classification.

      Recommendations

      Comments

      Please enable JavaScript to view thecomments powered by Disqus.

      Information & Contributors

      Information

      Published In

      cover image Information and Software Technology
      Information and Software Technology  Volume 140, Issue C
      Dec 2021
      256 pages

      Publisher

      Butterworth-Heinemann

      United States

      Publication History

      Published: 01 December 2021

      Author Tags

      1. Refactoring
      2. Behavior preservation
      3. Systematic mapping study

      Qualifiers

      • Review-article

      Contributors

      Other Metrics

      Bibliometrics & Citations

      Bibliometrics

      Article Metrics

      • Downloads (Last 12 months)0
      • Downloads (Last 6 weeks)0
      Reflects downloads up to 26 Nov 2024

      Other Metrics

      Citations

      Cited By

      View all
      • (2024)AntiCopyPaster 2.0: Whitebox just-in-time code duplicates extractionProceedings of the 2024 IEEE/ACM 46th International Conference on Software Engineering: Companion Proceedings10.1145/3639478.3640035(84-88)Online publication date: 14-Apr-2024
      • (2024)A Survey on Secure RefactoringSN Computer Science10.1007/s42979-024-03325-y5:7Online publication date: 12-Oct-2024
      • (2024)Automatic pattern-based consistency checking in model refactoring: introducing a formal behavioral preserving methodInnovations in Systems and Software Engineering10.1007/s11334-022-00525-820:1(65-84)Online publication date: 1-Mar-2024
      • (2023)A systematic literature review of fuzzy-weighted zero-inconsistency and fuzzy-decision-by-opinion-score-methodsJournal of Intelligent & Fuzzy Systems: Applications in Engineering and Technology10.3233/JIFS-23080345:3(4617-4638)Online publication date: 1-Jan-2023
      • (2023)Verifying Well-Typedness Preservation of Refactorings using Scope GraphsProceedings of the 25th ACM International Workshop on Formal Techniques for Java-like Programs10.1145/3605156.3606455(44-50)Online publication date: 18-Jul-2023
      • (2022)Cross-Project Software Refactoring Prediction Using Optimized Deep Learning Neural Network With the Aid of Attribute SelectionInternational Journal of Open Source Software and Processes10.4018/IJOSSP.30075613:1(1-31)Online publication date: 20-May-2022

      View Options

      View options

      Login options

      Media

      Figures

      Other

      Tables

      Share

      Share

      Share this Publication link

      Share on social media