An Empirical Study on Refactoring Activity

An Empirical Study on Refactoring Activity

An Empirical Study on Refactoring Activity Mohammad Iftekharul Hoque, Vijay Nag Ranga, Anurag Reddy Pedditi, Rachitha Srinath, Md Ali Ahsan Rana, Md Eftakhairul Islam, Afshin Somani Department of Computer Science and Software Engineering Concordia University, Montreal, Quebec, Canada Abstract— This paper reports an empirical study on We inspected the refactoring history of refactoring activity in three Java software systems. We three well known projects namely JFreeChart, investigated some questions on refactoring activity, to JEdit and JMeter and investigated 7 research confirm or disagree on conclusions that have been questions related to refactoring practice. These drawn from previous empirical studies. Unlike questions are: previous empirical studies, our study found that it is not always true that there are more refactoring RQ1: Is refactoring interleaved with other activities before major project release date than after. types of maintenance activity (floss In contrast, we were able to confirm that software refactoring) or is it performed in a developers perform different types of refactoring periodic fashion (root-canal operations on test code and production code, specific refactoring)? developers are responsible for refactorings in the RQ2: Are there adequate tests for refactoring project, refactoring edits are not very well tested. edits in practice? Further, floss refactoring is more popular among the RQ3: Do software developers perform developers, refactoring activity is frequent in the different types of refactoring operations projects, majority of bad smells once occurred they on test code and production code? persist up to the latest version of the system. By RQ4: Which developers are responsible for confirming assumptions by other researchers we can refactorings in the project? have greater confidence that those research RQ5: Is there more refactoring activity before conclusions are generalizable. major project releases than after? RQ6: Is refactoring activity frequent in the project? I. INTRODUCTION RQ7: Does the number of code smells increase Refactoring improves the structure of the over time and are the problems being software in a way that it does not alter the external solved during the evolution of the behavior of the code [1]. It is believed that software? refactoring improves software quality, developer’s The answers to these research questions productivity, maintainability and will help to better understand the actual refactoring understandability of the software systems [2]. practice. Many believe that lack of refactoring causes technical debt, which might result in increased The remainder of this paper is organized maintenance costs [3]. The empirical studies as follows. Section II summarizes related work. conducted previously have analyzed important Section III describes our study approach; Section aspects of refactoring practice. In this paper, we IV presents our results; Section V discusses the investigated seven questions on refactoring threats to the validity of the study; Section VI activity, to confirm or disagree on conclusions that concludes with the direction of future work. have been drawn from previous empirical studies. II. RELATED WORK Kim et al. [7] investigated refactoring Nikolaos Tsantalis and Victor Guana [4] benefits and challenges at Microsoft through conducted a multidimensional empirical study on survey, interviews with professional software refactoring activity. The results from this study engineers and version history data analysis. The showed that refactorings applied on production results of the study showed that the refactoring code mainly focuses on design improvements definition in practice differs from academic whereas refactorings applied on test code focuses definition of behavior preserving program on internal organization of classes corresponding transformation. The study also found that to each project. The study also found that single refactoring involves lot of costs and risks and developer acted as a refactoring manager. Further, various support is necessary to implement they found the amount of refactorings applied on refactoring beyond automated refactoring within a project before release was predominantly higher IDEs. when compared with the refactorings applied on Rachatasumrit and Kim [8] investigated the project after release. Additionally, intense the impact of refactoring edits on regression testing refactoring activity was observed during the using the version history of three open source testing periods of the project and also found software systems namely: JMeter, XMLSecurity, interesting facts behind the purpose of applied and ANT. The results of this study showed that refactorings. only 22% of refactorings are properly tested. The Murphy-Hill et al. [5] used the version study also suggested that half of failed affected history of Eclipse code base from CVS repository tests include refactoring edits. to investigate the refactoring practices followed by Gabriele Bavota and Bernardino De the developers. They concluded that refactoring is Carluccio [9] found that there is no significant used frequently to add a new feature or to fix a bug difference in the proportion of classes involved in (floss refactoring), comments do not provide with bug-fix inducing changes. Some refactorings like useful information and the percentage of low-level the Pull up method or Inline Temp were identified and medium-level refactorings (sub method level) which can induce more bug fixes. Considering the is higher compared with the high-level source and the target classes, it was identified that refactorings (changing the signature of class, the Move Field and the Move method are prone to methods). Moreover, the experiment found that induce errors in target classes, while the Replace nearly 90% of the refactorings were applied Method with Method Object and Pull Up method manually without using any refactoring tool. induce bugs in the source classes. The results Kim et al. [6] used fine grained evolution helped to conclude that the fault induced by history of the projects namely Eclipse JDT Core, refactoring is about 15%. JEdit and Columba and investigated the role of A. Chatzigeorgiou and A. Manakos [10] API level refactorings. They concluded that API investigated the evolution of bad smells in object- level refactorings increase the bug fixes, time oriented code. F. Khomh, M. Di Penta and Y.-G. taken to fix a bug after applying API level Guéhéneuc [11] have done an exploratory study of refactorings is shorter than before and refactorings the impact of code smells on software change- at API level occur more before the major software proneness. S. Olbrich, D. S. Cruzes, V. Basili and releases. N. Zazworka [12] studied two open source software systems to find out the evolution and impact of code smells. III. STUDY APPROACH our three software systems JFreechart, JEdit and We selected JFreeChart, JEdit and JMeter JMeter and have documented the results. as our study subjects because they have high Step 3: Identifying the authors and specific date quality change logs. We have investigated 10 of the refactorings versions of JFreeChart, JEdit and 9 versions of JMeter. JFreeChart is a free chart library for the From the Ref-Finder tool results we have Java platform. It supports bar charts, pie charts, learned in which classes those refactorings have line charts, time series charts, scatter plots, been applied. Than we have checked the commit histograms, simple Gantt charts, Pareto charts, history of those classes. For JFreeChart and JEdit bubble plots, dials, thermometers and more [13]. projects we have used TortoiseSVN subversion JEdit is a programmer's text editor written in Java. client, which is also integrated into Eclipse IDE. It uses the Swing toolkit for the GUI and can be Then with the help of commit logs we have found configured as a rather powerful IDE through the the author of particular refactoring and the specific use of its plugin architecture [14]. JMeter is a Java date when that refactoring was actually applied. application designed to load test functional But to analyze the commit history of JMeter we behavior and measure performance. It was have used Git repository and performed similar originally designed for testing Web Applications analysis as done by the other two projects. but has since expanded to other test functions Step 4: Identifying Bug fixes and New Features [15]. Implementation Step 1: Identifying Refactorings To identify bug fixes and new features In order to identify the refactoring edits in implementation of JEdit and JFreechart projects the selected three software systems we have used we have used the website sourceforge.net. This Ref-Finder [16] refactoring reconstruction tool, website keeps track of current bugs and also when which is available as an Eclipse plugin. Ref- bugs have been fixed. For our study we have only Finder is able to detect 63 different kinds of considered those bugs, which have closed and refactorings. With the help of this tool we first fixed status. When new features have been compared the base version with the corresponding implemented this website also keeps track of that. changed version and continued this process until But for JMeter we have checked Bugzilla for issue all the versions are inspected and tabulated the type of refactorings along with the affected tracking. classes in the source code. In a case study it is Step 5: Identifying Code Smells found that Ref-Finder was able to detect refactoring operations

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    11 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us