Refactoring trends across N versions of N Java open source systems : an empirical study

In the past few years, refactoring has emerged as an important consideration in the maintenance and evolution of software. Yet very little empirical evidence exists to support the claim about whether developers actively undertake refactoring, or whether as Fowler suggests that the benefits of doing refactoring are not short-term but too ‘long-term’ [8]. In this paper, we describe an empirical study of multiple versions of a range of open source Java systems in an attempt to understand whether refactoring does occur and, if so, which types of refactoring were most (and least) common. Fifteen refactorings were chosen as a basis (on seven Java systems) and the code analysed using an automated tool. Results confirmed that refactoring did take place, but the majority were of the simpler, less complex type. Interestingly, the most common refactorings empirically identified were those which, according to Fowler (and from a dependency graph of the ‘seventy two’ original refactorings), were central to larger more involved refactorings. One conclusion from the study is thus that developer time and effort for relatively large restructuring and testing of refactored code is prohibitive; making small, simple changes is preferred. A further conclusion from our study is that refactoring didn’t occur in the earliest or latest versions of the systems we investigated.

[1]  Tibor Gyimóthy,et al.  Extracting facts from open source software , 2004, 20th IEEE International Conference on Software Maintenance, 2004. Proceedings..

[2]  Elaine J. Weyuker,et al.  Where the bugs are , 2004, ISSTA '04.

[3]  Emilia Mendes,et al.  Trends in Java code changes: the key to identification of refactorings? , 2003, PPPJ.

[4]  Don S. Batory,et al.  Evolving Object-Oriented Designs with Refactorings , 2004, Automated Software Engineering.

[5]  Rachel Harrison,et al.  Experimental assessment of the effect of inheritance on the maintainability of object-oriented systems , 2000, J. Syst. Softw..

[6]  Patrick Nixon,et al.  Composite Refactorings for Java Programs , 2000 .

[7]  George Loizou,et al.  The role of constructors in the context of refactoring object-oriented systems , 2003, Seventh European Conference onSoftware Maintenance and Reengineering, 2003. Proceedings..

[8]  Dewayne E. Perry Laws and principles of evolution , 2002, International Conference on Software Maintenance, 2002. Proceedings..

[9]  Youssef Hassoun,et al.  Heurac: A heuristic-based tool for extracting refactoring data from open-source software versions , 2005 .

[10]  William F. Opdyke,et al.  Refactoring object-oriented frameworks , 1992 .

[11]  Lionel C. Briand,et al.  A Controlled Experiment for Evaluating Quality Guidelines on the Maintainability of Object-Oriented Designs , 2001, IEEE Trans. Software Eng..

[12]  Oscar Nierstrasz,et al.  Finding refactorings via change metrics , 2000, OOPSLA '00.

[13]  William F. Opdyke,et al.  Lifecycle and refactoring patterns that support evolution and reuse , 1995 .

[14]  Brian Foote,et al.  Designing Reusable Classes , 2001 .