Why Developers Refactor Source Code

Author:

Pantiuchina Jevgenija1,Zampetti Fiorella2,Scalabrino Simone3ORCID,Piantadosi Valentina4,Oliveto Rocco4,Bavota Gabriele1,Penta Massimiliano Di2

Affiliation:

1. Università della Svizzera italiana, Lugano, Switzerland

2. University of Sannio, Benevento, Italy

3. University of Molise, Italy

4. University of Molise

Abstract

Refactoring aims at improving code non-functional attributes without modifying its external behavior. Previous studies investigated the motivations behind refactoring by surveying developers. With the aim of generalizing and complementing their findings, we present a large-scale study quantitatively and qualitatively investigating why developers perform refactoring in open source projects. First, we mine 287,813 refactoring operations performed in the history of 150 systems. Using this dataset, we investigate the interplay between refactoring operations and process (e.g., previous changes/fixes) and product (e.g., quality metrics) metrics. Then, we manually analyze 551 merged pull requests implementing refactoring operations and classify the motivations behind the implemented refactorings (e.g., removal of code duplication). Our results led to (i) quantitative evidence of the relationship existing between certain process/product metrics and refactoring operations and (ii) a detailed taxonomy, generalizing and complementing the ones existing in the literature, of motivations pushing developers to refactor source code.

Funder

SNF Project JITRA

Publisher

Association for Computing Machinery (ACM)

Subject

Software

Reference106 articles.

1. [n.d.]. 52North/WPS Pull Request #73. Retrieved from https://github.com/52North/WPS/pull/73. [n.d.]. 52North/WPS Pull Request #73. Retrieved from https://github.com/52North/WPS/pull/73.

2. [n.d.]. apache/fineract Pull Request #366. Retrieved from https://github.com/apache/fineract/pull/366. [n.d.]. apache/fineract Pull Request #366. Retrieved from https://github.com/apache/fineract/pull/366.

3. [n.d.]. cbeust/testng Pull Request #1481. Retrieved from https://github.com/cbeust/testng/pull/1481. [n.d.]. cbeust/testng Pull Request #1481. Retrieved from https://github.com/cbeust/testng/pull/1481.

4. [n.d.]. Code metrics for Java code by means of static analysis. Retrieved from https://github.com/mauricioaniche/ck. [n.d.]. Code metrics for Java code by means of static analysis. Retrieved from https://github.com/mauricioaniche/ck.

5. [n.d.]. confluentinc/kafka-connect-elasticsearch Pull Request #251. Retrieved from https://github.com/confluentinc/kafka-connect-elasticsearch/pull/251. [n.d.]. confluentinc/kafka-connect-elasticsearch Pull Request #251. Retrieved from https://github.com/confluentinc/kafka-connect-elasticsearch/pull/251.

Cited by 27 articles. 订阅此论文施引文献 订阅此论文施引文献,注册后可以免费订阅5篇论文的施引文献,订阅后可以查看论文全部施引文献

1. Deep learning with class-level abstract syntax tree and code histories for detecting code modification requirements;Journal of Systems and Software;2023-12

2. How do Developers Improve Code Readability? An Empirical Study of Pull Requests;2023 IEEE International Conference on Software Maintenance and Evolution (ICSME);2023-10-01

3. An Accurate Identifier Renaming Prediction and Suggestion Approach;ACM Transactions on Software Engineering and Methodology;2023-09-29

4. Machine Learning-Based Exploration of the Impact of Move Method Refactoring on Object-Oriented Software Quality Attributes;Arabian Journal for Science and Engineering;2023-08-21

5. Effective Recommendation of Cross-Project Correlated Issues based on Issue Metrics;Proceedings of the 14th Asia-Pacific Symposium on Internetware;2023-08-04

同舟云学术

1.学者识别学者识别

2.学术分析学术分析

3.人才评估人才评估

"同舟云学术"是以全球学者为主线,采集、加工和组织学术论文而形成的新型学术文献查询和分析系统,可以对全球学者进行文献检索和人才价值评估。用户可以通过关注某些学科领域的顶尖人物而持续追踪该领域的学科进展和研究前沿。经过近期的数据扩容,当前同舟云学术共收录了国内外主流学术期刊6万余种,收集的期刊论文及会议论文总量共计约1.5亿篇,并以每天添加12000余篇中外论文的速度递增。我们也可以为用户提供个性化、定制化的学者数据。欢迎来电咨询!咨询电话:010-8811{复制后删除}0370

www.globalauthorid.com

TOP

Copyright © 2019-2024 北京同舟云网络信息技术有限公司
京公网安备11010802033243号  京ICP备18003416号-3