Refactoring and its Relationship with Fan-in and Fan-out: An Empirical Study

Many of the seventy-two refactorings originally proposed by Fowler have the aim of reducing coupling in classes and thereby aiding programmer maintainability. While we might assume that classes with high levels of coupling would be the targets for refactoring more often than any other type of class, no empirical evidence exists to support this assumption. In this paper, we explore that open question through the extraction of fifty-two of Fowler's catalog of refactorings drawn from versions of four open-source systems. We compare the coupling characteristics of each set of refactored classes with the corresponding set of non-refactored classes (those for which no refactorings were applied across versions), we seek to inform one overriding research question: is there a significant difference between these two sets of classes in terms of their level of coupling? Results showed that highly-coupled classes were more prone to refactoring, particularly through a set of 'core' refactorings. However, wide variations were found across systems for our measures of coupling namely, fan-in and fan-out. Specific individual refactorings were also explored to gain an understanding of why these differences may have occurred.

[1]  George Loizou,et al.  Common refactorings, a dependency graph and some code smells: an empirical study of Java OSS , 2006, ISESE '06.

[2]  R BasiliVictor,et al.  A Validation of Object-Oriented Design Metrics as Quality Indicators , 1996 .

[3]  Harald C. Gall,et al.  Mining Software Evolution to Predict Refactoring , 2007, ESEM 2007.

[4]  Premkumar T. Devanbu,et al.  An Investigation into Coupling Measures for C++ , 1997, Proceedings of the (19th) International Conference on Software Engineering.

[5]  Miryung Kim,et al.  Template-based reconstruction of complex refactorings , 2010, 2010 IEEE International Conference on Software Maintenance.

[6]  Liming Zhao,et al.  Predicting Classes in Need of Refactoring : An Application of Static Metrics , 2006 .

[7]  Steve Counsell,et al.  Extracting refactoring trends from open-source software and a possible solution to the 'related refactoring' conundrum , 2006, SAC '06.

[8]  Giuliano Antoniol,et al.  Predicting Refactoring Activities via Time Series , 2003 .

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

[10]  Barry Boehm,et al.  A Replicate Empirical Comparison between Pair Development and Software Development with Inspection , 2007, ESEM 2007.

[11]  Lionel C. Briand,et al.  A Unified Framework for Coupling Measurement in Object-Oriented Systems , 1999, IEEE Trans. Software Eng..

[12]  Stephan Diehl,et al.  Comparison of similarity metrics for refactoring detection , 2011, MSR '11.

[13]  Ralph E. Johnson,et al.  Effective Software Merging in the Presence of Object-Oriented Refactorings , 2008, IEEE Transactions on Software Engineering.

[14]  Tom Mens,et al.  A survey of software refactoring , 2004, IEEE Transactions on Software Engineering.

[15]  Ralph E. Johnson,et al.  Refactoring and Aggregation , 1993, ISOTAS.

[16]  Tom Mens,et al.  Refactoring: Current Research and Future Trends , 2003, LDTA@ETAPS.

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

[18]  Mark Harman,et al.  Automated refactoring of object oriented code into aspects , 2005, 21st IEEE International Conference on Software Maintenance (ICSM'05).

[19]  Friedrich Steimann,et al.  Systematically refactoring inheritance to delegation in java , 2008, 2008 ACM/IEEE 30th International Conference on Software Engineering.

[20]  Diomidis Spinellis,et al.  Refactoring--Does It Improve Software Quality? , 2007, Fifth International Workshop on Software Quality (WoSQ'07: ICSE Workshops 2007).

[21]  P ? ? ? ? ? ? ? % ? ? ? ? , 1991 .

[22]  Thierry Bodhuin,et al.  SORMASA: A tool for Suggesting Model Refactoring Actions by Metrics-led Genetic Algorithm , 2007, WRT.

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

[24]  Harald C. Gall,et al.  Mining Software Evolution to Predict Refactoring , 2007, First International Symposium on Empirical Software Engineering and Measurement (ESEM 2007).

[25]  Michele Marchesi,et al.  An Empirical Study of Refactoring in the Context of FanIn and FanOut Coupling , 2011, 2011 18th Working Conference on Reverse Engineering.

[26]  Tracy Hall,et al.  Empirical Support for Two Refactoring Studies Using Commercial C# Software , 2009, EASE.

[27]  Chris F. Kemerer,et al.  A Metrics Suite for Object Oriented Design , 2015, IEEE Trans. Software Eng..

[28]  Sallie M. Henry,et al.  Software Structure Metrics Based on Information Flow , 1981, IEEE Transactions on Software Engineering.

[29]  Robert M. Hierons,et al.  The Effectiveness of Refactoring, Based on a Compatibility Testing Taxonomy and a Dependency Graph , 2006, Testing: Academic & Industrial Conference - Practice And Research Techniques (TAIC PART'06).