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

skip to main content
10.1145/2973839.2973848acmotherconferencesArticle/Chapter ViewAbstractPublication PagessbesConference Proceedingsconference-collections
research-article

Does refactoring improve software structural quality? A longitudinal study of 25 projects

Published: 19 September 2016 Publication History

Abstract

Code smells in a program represent indications of structural quality problems, which can be addressed by software refactoring. Refactoring is widely practiced by developers, and considerable development effort has been invested in refactoring tooling support. There is an explicit assumption that software refactoring improves the structural quality of a program by reducing its density of code smells. However, little has been reported about whether and to what extent developers successfully remove code smells through refactoring. This paper reports a first longitudinal study intended to address this gap. We analyze how often the commonly-used refactoring types affect the density of 5 types of code smells along the version histories of 25 projects. Our findings are based on the analysis of 2,635 refactorings distributed in 11 different types. Surprisingly, 2,506 refactorings (95.1%) did not reduce or introduce code smells. Thus, these findings suggest that refactorings lead to smell reduction less often than what has been reported. According to our data, only 2.24% of refactoring changes removed code smells and 2.66% introduced new ones. Moreover, several smells induced by refactoring tended to live long, i.e., 146 days on average. These smells were only eventually removed when smelly elements started to exhibit poor structural quality and, as a consequence, started to be more costly to get rid of.

References

[1]
G. Antoniol, Y. Gueheneuc, E. Merlo, and P. Tonella. Mining the lexicon used by programmers during sofware evolution. Proc. of ICSM, pages 14--23, 2007.
[2]
R. Arcoverde, E. Guimarães, I. Macia, A. Garcia, and Y. Cai. Prioritization of code anomalies based on architecture sensitiveness. In Proc. of SBES, pages 69--78, 2013.
[3]
R. Arcoverde, I. Macia, A. Garcia, and A. von Staa. Automatically detecting architecturally-relevant code anomalies. Proc. of RSSE, pages 90--91, 2012.
[4]
G. Bavota, A. D. Lucia, M. D. Penta, R. Oliveto, and F. Palomba. An experimental investigation on the innate relationship between quality and refactoring. JSS, 107:1--14, 2015.
[5]
D. Cedrim. Experiment data of the research. http://diegocedrim.github.io/sbes-2016-data/, 2016. {Online} accessed 12-april-2016}.
[6]
M. Fowler, K. Beck, J. Brant, W. Opdyke, and D. Roberts. Refactoring: Improving the Design of Existing Code. Addison-Wesley, 1 edition, 1999.
[7]
K. Fujiwara, K. Fushida, N. Yoshida, and H. Iida. Assessing refactoring instances and the maintainability benefits of them from version archives, pages 313--323. Springer, 2013.
[8]
X. Ge, Q. L. DuBose, and E. Murphy-Hill. Reconciling manual and automatic refactoring. In Proc. of ICSE, pages 211--221, 2012.
[9]
Google. Google bigquery cloud platform. https://cloud.google.com/bigquery/, 2016. {Online; accessed 18-april-2016}.
[10]
E. Guimarães, A. Garcia, and Y. Cai. Architecture-sensitive heuristics for prioritizing critical code anomalies. In Proc. of MODULARITY, pages 68--80, 2015.
[11]
M. Kim, M. Gee, A. Loh, and N. Rachatasumrit. Ref-finder: a refactoring reconstruction tool based on logic query templates. In Proc. of FSE, page 371, 2010.
[12]
R. Kolb, D. Muthig, T. Patzke, and K. Yamauchi. A case study in refactoring a legacy component for reuse in a product line. In Proc. of ICSM, pages 369--378, 2005.
[13]
M. Lanza, R. Marinescu, and S. Ducasse. Object-oriented metrics in practice. Springer, 2005.
[14]
I. Macia. On the detection of architecturally relevant code anomalies in software systems. PhD thesis, Pontifical Catholic University of Rio de Janeiro, 2013.
[15]
I. Macia, R. Arcoverde, A. Garcia, C. Chavez, and A. von Staa. On the relevance of code anomalies for identifying architecture degradation symptoms. Proc. of CSMR, pages 277--286, 2012.
[16]
I. Macia, A. Garcia, C. Chavez, and A. von Staa. Enhancing the detection of code anomalies with architecture-sensitive strategies. In Proc. of CSMR, pages 177--186, 2013.
[17]
L. Mara, G. Honorato, F. D. Medeiros, A. Garcia, and C. Lucena. Hist-inspect: a tool for history-sensitive detection of code smells. In Proc. of AOSD, pages 65--66, 2011.
[18]
P. Meananeatra. Identifying refactoring sequences for improving software maintainability. In Proc. of ASE, page 406, 2012.
[19]
E. Murphy-Hill and A. Black. An interactive ambient visualization for code smells. In Proc. of SOFTVIS, pages 5--14, 2010.
[20]
E. Murphy-Hill, C. Parnin, and A. Black. How we refactor, and how we know it. Proc. of ICSE, pages 287--297, 2009.
[21]
W. Oizumi, A. Garcia, T. Colanzi, and M. Ferreira. On the relationship of code-anomaly agglomerations and architectural problems. JSERD, 3(11), 2015.
[22]
W. Oizumi, A. Garcia, L. Sousa, B. Cafeo, and Y. Zhao. Code anomalies flock together: exploring code anomaly agglomerations for locating design problems. In Proc. of ICSE, pages 440--451, 2016.
[23]
J. Ratzinger, T. Sigmund, and H. C. Gall. On the relation of refactorings and software defect prediction. In Proc. of MSR, page 35, 2008.
[24]
Scitools. Understand software. https://scitools.com, 2016. {Online; accessed 18-april-2015}.
[25]
D. Sjoberg, A. Yamashita, B. Anda, A. Mockus, and T. Dyba. Quantifying the effect of code smells on maintenance effort. IEEE Transactions on Software Engineering, 39(8):1144--1156, 2013.
[26]
G. Soares, R. Gheyi, E. Murphy-Hill, and B. Johnson. Comparing approaches to analyze refactoring activity on software repositories. JSS, 86(4):1006--1022, 2013.
[27]
K. Stroggylos and D. Spinellis. Refactoring--does it improve software quality? In Proc. of WoSQ, 2007.
[28]
N. Tsantalis, V. Guana, E. Stroulia, and A. Hindle. A multidimensional empirical study on refactoring activity. In Proc. of CASCON, pages 132--146, 2013.
[29]
M. Tufano, F. Palomba, G. Bavota, R. Oliveto, M. D. Penta, A. D. Lucia, and D. Poshyvanyk. When and why your code starts to smell bad. In Proc. of ICSE, 2015.
[30]
Z. Xing and E. Stroulia. Umldiff: an algorithm for object-oriented design differencing. In Proc. of ASE, pages 54--65, 2005.
[31]
A. Yamashita. Assessing the capability of code smells to explain maintenance problems: an empirical study combining quantitative and qualitative data. Empirical Software Engineering, 19(4):1111--1143, 2013.
[32]
A. Yamashita and L. Moonen. To what extent can maintenance oroblems be predicted by code smell detection? - an empirical study. Information and Software Technology, 55(12):2223--2242, 2013.

Cited By

View all
  • (2023)State of Refactoring Adoption: Better Understanding Developer Perception of Refactoring2023 IEEE/ACM 20th International Conference on Mining Software Repositories (MSR)10.1109/MSR59073.2023.00090(635-639)Online publication date: May-2023
  • (2023)The Untold Story of Code Refactoring Customizations in PracticeProceedings of the 45th International Conference on Software Engineering10.1109/ICSE48619.2023.00021(108-120)Online publication date: 14-May-2023
  • (2023)On the impact of single and co-occurrent refactorings on quality attributes in android applicationsJournal of Systems and Software10.1016/j.jss.2023.111817205(111817)Online publication date: Nov-2023
  • Show More Cited By

Index Terms

  1. Does refactoring improve software structural quality? A longitudinal study of 25 projects

      Recommendations

      Comments

      Please enable JavaScript to view thecomments powered by Disqus.

      Information & Contributors

      Information

      Published In

      cover image ACM Other conferences
      SBES '16: Proceedings of the XXX Brazilian Symposium on Software Engineering
      September 2016
      167 pages
      ISBN:9781450342018
      DOI:10.1145/2973839
      Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

      In-Cooperation

      • SBC: Brazilian Computer Society

      Publisher

      Association for Computing Machinery

      New York, NY, United States

      Publication History

      Published: 19 September 2016

      Permissions

      Request permissions for this article.

      Check for updates

      Author Tags

      1. Code Smells
      2. Refactoring
      3. Structural Quality

      Qualifiers

      • Research-article
      • Research
      • Refereed limited

      Conference

      SBES '16
      SBES '16: 30th Brazilian Symposium on Software Engineering
      September 19 - 23, 2016
      Maringá, Brazil

      Acceptance Rates

      Overall Acceptance Rate 147 of 427 submissions, 34%

      Contributors

      Other Metrics

      Bibliometrics & Citations

      Bibliometrics

      Article Metrics

      • Downloads (Last 12 months)25
      • Downloads (Last 6 weeks)2
      Reflects downloads up to 21 Nov 2024

      Other Metrics

      Citations

      Cited By

      View all
      • (2023)State of Refactoring Adoption: Better Understanding Developer Perception of Refactoring2023 IEEE/ACM 20th International Conference on Mining Software Repositories (MSR)10.1109/MSR59073.2023.00090(635-639)Online publication date: May-2023
      • (2023)The Untold Story of Code Refactoring Customizations in PracticeProceedings of the 45th International Conference on Software Engineering10.1109/ICSE48619.2023.00021(108-120)Online publication date: 14-May-2023
      • (2023)On the impact of single and co-occurrent refactorings on quality attributes in android applicationsJournal of Systems and Software10.1016/j.jss.2023.111817205(111817)Online publication date: Nov-2023
      • (2023)Code quality improvement using Aquila OptimizerJournal of Software: Evolution and Process10.1002/smr.2559Online publication date: 16-Mar-2023
      • (2022)An exploratory study on refactoring documentation in issues handlingProceedings of the 19th International Conference on Mining Software Repositories10.1145/3524842.3528525(107-111)Online publication date: 23-May-2022
      • (2022)A longitudinal study of the impact of refactoring in android applicationsInformation and Software Technology10.1016/j.infsof.2021.106699140:COnline publication date: 22-Apr-2022
      • (2022)Refactoring for reuse: an empirical studyInnovations in Systems and Software Engineering10.1007/s11334-021-00422-618:1(105-135)Online publication date: 15-Jan-2022
      • (2022)How do i refactor this? An empirical study on refactoring trends and topics in Stack OverflowEmpirical Software Engineering10.1007/s10664-021-10045-x27:1Online publication date: 1-Jan-2022
      • (2021)An Empirical Study on the Impact of Refactoring on Quality Metrics in Android Applications2021 IEEE/ACM 8th International Conference on Mobile Software Engineering and Systems (MobileSoft)10.1109/MobileSoft52590.2021.00010(28-39)Online publication date: May-2021
      • (2021)The human in model‐driven engineering loop: A case study on integrating handwritten code in model‐driven engineering repositoriesSoftware: Practice and Experience10.1002/spe.295751:6(1308-1321)Online publication date: 18-Feb-2021
      • Show More Cited By

      View Options

      Login options

      View options

      PDF

      View or Download as a PDF file.

      PDF

      eReader

      View online with eReader.

      eReader

      Media

      Figures

      Other

      Tables

      Share

      Share

      Share this Publication link

      Share on social media