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

How does refactoring affect internal quality attributes?: A multi-project study

Published: 20 September 2017 Publication History

Abstract

Refactoring is a technique commonly applied by developers along the software maintenance and evolution. Software refactoring is expected to improve the internal quality attributes of a software project, such as coupling and cohesion. However, there is limited understanding on to what extent developers achieve this expectation when refactoring their source code This study investigates how refactoring operations affect five well-known internal quality attributes: cohesion, coupling, complexity, inheritance, and size. For this purpose, we analyze the version history of 23 open source projects with 29,303 refactoring operations. Our analysis revealed interesting observations. First, we noticed that developers apply more than 94% of the refactoring operations to code elements with at least one critical internal quality attribute, as opposed to previous work. Second, 65% of the refactoring operations improve their related internal quality attributes and the remaining 35% operations keep the quality attributes unaffected. Third, whenever pure refactoring operations are applied (the so-called root-canal refactoring), we confirm that internal quality attributes are either frequently improved or at least not worsened. Finally, while refactoring operations often reach other specific aims, such as adding a new feature or fixing a bug, 55% of these operations surprisingly improve internal quality attributes against only 10% of quality decline.

References

[1]
Nicolas Anquetil and Jannik Laval. 2011. Legacy software restructuring. In 15th European Conference on Software Maintenance and Reengineering (CSMR). 279--286.
[2]
Atsushi Aoki, Kaoru Hayashi, Kouichi Kishida, Kumiyo Nakakoji, Yoshiyuki Nishinaka, Brent Reeves, Akio Takashima, and Yasuhiro Yamamoto. 2001. A case study of the evolution of Jun. In 23rd International Conference on Software Engineering (ICSE). 524--533.
[3]
Jagdish Bansiya and Carl Davis. 2002. A hierarchical model for object-oriented design quality assessment. IEEE Trans. Softw. Eng. (TSE) 28, 1 (2002), 4--17.
[4]
Gabriele Bavota, Andrea De Lucia, Massimiliano Di Penta, Rocco Oliveto, and Fabio Palomba. 2015. An experimental investigation on the innate relationship between quality and refactoring. J. Syst Softw. (JSS) 107 (2015), 1--14.
[5]
James Bieman and Byung-Kyoo Kang. 1995. Cohesion and reuse in an object-oriented system. In ACM SIGSOFT Softw. Eng. Notes (SEN), Vol. 20. 259--262.
[6]
James Bieman and Linda Oft. 1994. Measuring functional cohesion. IEEE Trans. Softw. Eng. (TSE) 20, 8 (1994), 644--657.
[7]
Bart Du Bois, Serge Demeyer, and Jan Verelst. 2004. Refactoring-improving coupling and cohesion of existing code. In 11th Working Conference on Reverse Engineering (WCRE). 144--151.
[8]
Bart Du Bois and Tom Mens. 2003. Describing the impact of refactoring on internal program quality. In International Workshop on Evolution of Large-scale Industrial Software Applications (ELISA). 37--48.
[9]
Diego Cedrim, Leonardo Sousa, Alessandro Garcia, and Rohit Gheyi. 2016. Does refactoring improve software structural quality?. In 30th Brazilian Symposium on Software Engineering (SBES). 73--82.
[10]
Shyam Chidamber and Chris Kemerer. 1994. A metrics suite for object oriented design. IEEE Trans. Softw. Eng. (TSE) 20, 6 (1994), 476--493.
[11]
Alexander Chávez, Isabella Ferreira, Eduardo Fernandes, Diego Cedrim, and Alessandro Garcia. 2017. Research website. (2017). https://alexchavezlop.gir.hub.io/refactoring-and-internal-attributes/
[12]
Giuseppe Destefanis, Steve Counsell, Giulio Concas, and Roberto Tonelli. 2014. Software metrics in agile software. In 15th International Conference on Agile Software Development (XP). 157--170.
[13]
Martin Fowler. 1999. Refactoring. Addison-Wesley.
[14]
Martin Fowler. 2013. Catalog of refactorings. (2013). http://refactoring.com/catalog/
[15]
Frank Grubbs. 1969. Procedures for detecting outlying observations in samples. Technometrics 11, 1 (1969), 1--21.
[16]
Brian Henderson-Sellers. 1995. Object-Oriented Metrics. Prentice-Hall.
[17]
Sallie Henry and Dennis Kafura. 1981. Software structure metrics based on information flow. IEEE Trans. Softw. Eng. (TSE) 7, 5 (1981), 510--518.
[18]
Martin Hitz and Behzad Montazeri. 1996. Chidamber and Kemerer's metrics suite. IEEE Trans. Softw. Eng. (TSE) 22, 4 (1996), 267--271.
[19]
Kerievsky Joshua. 2005. Refactoring to Patterns. Addis on-Wesley.
[20]
Yoshio Kataoka, Takeo Imai, Hiroki Andou, and Tetsuji Fukaya. 2002. A quantitative evaluation of maintainability enhancement by refactoring. In 18th International Conference on Software Maintenance (ICSM). 576--585.
[21]
Miryung Kim, Thomas Zimmermann, and Nachiappan Nagappan. 2014. An empirical study of refactoring challenges and benefits at Microsoft. IEEE Trans. Softw. Eng. (TSE) 40, 7 (2014), 633--649.
[22]
Michele Lanza and Radu Marinescu. 2007. Object-Oriented Metrics in Practice. Springer Science & Business Media.
[23]
Wei Li and Sallie Henry. 1993. Object-oriented metrics that predict maintainability. J. Syst. Softw. (JSS) 23, 2 (1993), 111--122.
[24]
Yixun Liu, Denys Poshyvanyk, Rudolf Ferenc, Tibor Gyimóthy, and Nikos Chrisochoides. 2009. Modeling class cohesion as mixtures of latent topics. In 25th International Conference on Software Maintenance (ICSM). 233--242.
[25]
Mark Lorenz and Jeff Kidd. 1994. Object-Oriented Software Metrics. Prentice Hall.
[26]
Ruchika Malhotra. 2016. Empirical Research in Software Engineering. CRC Press.
[27]
Thomas McCabe. 1976. A complexity measure. IEEE Trans. Softw. Eng. 2, 4 (1976), 308--320.
[28]
Tom Mens and Tom Tourwé. 2004. A survey of software refactoring. IEEE Trans. Softw. Eng. (TSE) 30, 2 (2004), 126--139.
[29]
Mohamed Mkaouer, Marouane Kessentini, Slim Bechikh, Mel Ó Cinnéide, and Kalyanmoy Deb. 2016. On the use of many quality attributes for software refactoring. Empir. Softw. Eng. (ESE) 21, 6 (2016), 2503--2545.
[30]
David Moore, William Notz, and Michael Fligner. 2015. The Basic Practice of Statistics. W. H. Freeman.
[31]
Emerson Murphy-Hill, Chris Parnin, and Andrew Black. 2012. How we refactor, and how we know it. IEEE Trans. Softw. Eng. (TSE) 38, 1 (2012), 5--18.
[32]
Brian Nejmeh. 1988. NPATH. Comm. ACM 31, 2 (1988), 188--200.
[33]
Danilo Silva, Nikolaos Tsantalis, and Marco Tulio Valente. 2016. Why we refactor?. In 24th International Symposium on Foundations of Software Engineering (FSE). 858--870.
[34]
Nikolaos Tsantalis, Victor Guana, Eleni Stroulia, and Abram Hindle. 2013. A multidimensional empirical study on refactoring activity. In 23rd Conference of the Center for Advanced Studies on Collaborative Research (CASCON). 132--146.
[35]
Claes Wohlin, Per Runeson, Martin Höst, Magnus Ohlsson, Björn Regnell, and Anders Wesslén. 2012. Experimentation in Software Engineering. Springer Science & Business Media.

Cited By

View all
  • (2025)Multi-Classification Refactoring Framework Using Hopfield Neural Network for Sustainable Software DevelopmentIEEE Access10.1109/ACCESS.2025.354208713(31785-31808)Online publication date: 2025
  • (2024)Enhancing Recommendations of Composite Refactorings based on the Practice2024 IEEE International Conference on Source Code Analysis and Manipulation (SCAM)10.1109/SCAM63643.2024.00018(83-93)Online publication date: 7-Oct-2024
  • (2024)Revealing MOVE METHOD: Machine Learning-driven Real-time Refactoring Identification for Enhanced Software Quality2024 International Conference on Emerging Systems and Intelligent Computing (ESIC)10.1109/ESIC60604.2024.10481609(572-578)Online publication date: 9-Feb-2024
  • Show More Cited By

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM Other conferences
SBES '17: Proceedings of the XXXI Brazilian Symposium on Software Engineering
September 2017
409 pages
ISBN:9781450353267
DOI:10.1145/3131151
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
  • CNPq: Conselho Nacional de Desenvolvimento Cientifico e Tecn
  • CAPES: Brazilian Higher Education Funding Council

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 20 September 2017

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. Refactoring
  2. code structural quality
  3. software metrics

Qualifiers

  • Research-article
  • Research
  • Refereed limited

Funding Sources

  • CAPES/Procad
  • FAPERJ
  • CNPq

Conference

SBES'17
SBES'17: 31st Brazilian Symposium on Software Engineering
September 20 - 22, 2017
CE, Fortaleza, Brazil

Acceptance Rates

SBES '17 Paper Acceptance Rate 42 of 134 submissions, 31%;
Overall Acceptance Rate 147 of 427 submissions, 34%

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)24
  • Downloads (Last 6 weeks)5
Reflects downloads up to 02 Mar 2025

Other Metrics

Citations

Cited By

View all
  • (2025)Multi-Classification Refactoring Framework Using Hopfield Neural Network for Sustainable Software DevelopmentIEEE Access10.1109/ACCESS.2025.354208713(31785-31808)Online publication date: 2025
  • (2024)Enhancing Recommendations of Composite Refactorings based on the Practice2024 IEEE International Conference on Source Code Analysis and Manipulation (SCAM)10.1109/SCAM63643.2024.00018(83-93)Online publication date: 7-Oct-2024
  • (2024)Revealing MOVE METHOD: Machine Learning-driven Real-time Refactoring Identification for Enhanced Software Quality2024 International Conference on Emerging Systems and Intelligent Computing (ESIC)10.1109/ESIC60604.2024.10481609(572-578)Online publication date: 9-Feb-2024
  • (2024)Determination of optimum refactoring sequence for maximizing the maintainability of object-oriented systems using machine learning algorithmsInternational Journal of System Assurance Engineering and Management10.1007/s13198-024-02639-716:2(651-666)Online publication date: 7-Dec-2024
  • (2024)Understanding the effect of batch refactoring on software qualityInternational Journal of System Assurance Engineering and Management10.1007/s13198-023-02247-x15:6(2328-2336)Online publication date: 7-Feb-2024
  • (2024)Test code refactoring unveiled: where and how does it affect test code quality and effectiveness?Empirical Software Engineering10.1007/s10664-024-10577-y30:1Online publication date: 16-Nov-2024
  • (2024)A systematic review of refactoring opportunities by software antipattern detectionAutomated Software Engineering10.1007/s10515-024-00443-y31:2Online publication date: 15-May-2024
  • (2024)Severity Factor (SF)Journal of Software: Evolution and Process10.1002/smr.259036:5Online publication date: 25-Apr-2024
  • (2023)Empirical Investigation of the Diverse Refactoring Effects on Software Quality: The Role of Refactoring Tools and Software Size2023 3rd International Conference on Emerging Smart Technologies and Applications (eSmarTA)10.1109/eSmarTA59349.2023.10293407(1-6)Online publication date: 10-Oct-2023
  • (2023)Dependent or Not: Detecting and Understanding Collections of RefactoringsIEEE Transactions on Software Engineering10.1109/TSE.2023.3244123(1-15)Online publication date: 2023
  • 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

Figures

Tables

Media

Share

Share

Share this Publication link

Share on social media