Refactoring Fat Interfaces Using a Genetic Algorithm

Recent studies have shown that the violation of the Interface Segregation Principle (ISP) is critical for maintaining and evolving software systems. Fat interfaces (i.e., interfaces violating the ISP) change more frequently and degrade the quality of the components coupled to them. According to the ISP the interfaces' design should force no client to depend on methods it does not invoke. Fat interfaces should be split into smaller interfaces exposing only the methods invoked by groups of clients. However, applying the ISP is a challenging task when fat interfaces are invoked differently by many clients. In this paper, we formulate the problem of applying the ISP as a multi-objective clustering problem and we propose a genetic algorithm to solve it. We evaluate the capability of the proposed genetic algorithm with 42,318 public Java APIs whose clients' usage has been mined from the Maven repository. The results of this study show that the genetic algorithm outperforms other search based approaches (i.e., random and simulated annealing approaches) in splitting the APIs according to the ISP.

[1]  Xin Yao,et al.  Software Module Clustering as a Multi-Objective Search Problem , 2011, IEEE Transactions on Software Engineering.

[2]  Houari A. Sahraoui,et al.  How We Design Interfaces, and How to Assess It , 2013, 2013 IEEE International Conference on Software Maintenance.

[3]  Jun Cheng,et al.  A Fine-Grained Parallel Multi-objective Test Case Prioritization on GPU , 2013, SSBSE.

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

[5]  Emden R. Gansner,et al.  Using automatic clustering to produce high-level system organizations of source code , 1998, Proceedings. 6th International Workshop on Program Comprehension. IWPC'98 (Cat. No.98TB100242).

[6]  Günter Rudolph,et al.  Evolutionary Search for Minimal Elements in Partially Ordered Finite Sets , 1998, Evolutionary Programming.

[7]  Benoit Baudry,et al.  Empirical evidence of large-scale diversity in API usage of object-oriented software , 2013, 2013 IEEE 13th International Working Conference on Source Code Analysis and Manipulation (SCAM).

[8]  Zahir Tari,et al.  The Impact of Service Cohesion on the Analyzability of Service-Oriented Software , 2010, IEEE Transactions on Services Computing.

[9]  R. Grissom,et al.  Effect sizes for research: A broad practical approach. , 2005 .

[10]  Daniele Romano,et al.  Using source code metrics to predict change-prone Java interfaces , 2011, 2011 27th IEEE International Conference on Software Maintenance (ICSM).

[11]  Arie van Deursen,et al.  The Maven repository dataset of metrics, changes, and dependencies , 2013, 2013 10th Working Conference on Mining Software Repositories (MSR).

[12]  Dorothea Heiss-Czedik,et al.  An Introduction to Genetic Algorithms. , 1997, Artificial Life.

[13]  Marouane Kessentini,et al.  Regression Testing for Model Transformations: A Multi-objective Approach , 2013, SSBSE.

[14]  A. Yamashita,et al.  Exploring the impact of inter-smell relations on software maintainability: An empirical study , 2013, 2013 35th International Conference on Software Engineering (ICSE).

[15]  Kalyanmoy Deb,et al.  A Fast Elitist Non-dominated Sorting Genetic Algorithm for Multi-objective Optimisation: NSGA-II , 2000, PPSN.

[16]  Daniele Romano,et al.  Analyzing the Evolution of Web Services Using Fine-Grained Changes , 2012, 2012 IEEE 19th International Conference on Web Services.

[17]  D Nam,et al.  Multiobjective simulated annealing: a comparative study to evolutionary algorithms , 2000 .

[18]  Lakshmi Rajamani,et al.  IMPROVED SELECTION OPERATOR GA , 2008 .

[19]  Emanuel Falkenauer,et al.  Genetic Algorithms and Grouping Problems , 1998 .

[20]  Emden R. Gansner,et al.  Bunch: a clustering tool for the recovery and maintenance of software system structures , 1999, Proceedings IEEE International Conference on Software Maintenance - 1999 (ICSM'99). 'Software Maintenance for Business Change' (Cat. No.99CB36360).

[21]  Mark Harman,et al.  Pareto efficient multi-objective test case selection , 2007, ISSTA '07.

[22]  Alex Alves Freitas,et al.  A Survey of Evolutionary Algorithms for Clustering , 2009, IEEE Transactions on Systems, Man, and Cybernetics, Part C (Applications and Reviews).

[23]  Lothar Thiele,et al.  Multiobjective evolutionary algorithms: a comparative case study and the strength Pareto approach , 1999, IEEE Trans. Evol. Comput..

[24]  Yuanyuan Zhang,et al.  Empirical evaluation of search based requirements interaction management , 2013, Inf. Softw. Technol..

[25]  Mark Harman,et al.  A multiple hill climbing approach to software module clustering , 2003, International Conference on Software Maintenance, 2003. ICSM 2003. Proceedings..

[26]  Spiros Mancoridis,et al.  On the automatic modularization of software systems using the Bunch tool , 2006, IEEE Transactions on Software Engineering.

[27]  Spiros Mancoridis,et al.  Using Heuristic Search Techniques To Extract Design Abstractions From Source Code , 2002, GECCO.

[28]  Kalyanmoy Deb,et al.  A fast and elitist multiobjective genetic algorithm: NSGA-II , 2002, IEEE Trans. Evol. Comput..

[29]  Keith Frampton,et al.  Cohesion Metrics for Predicting Maintainability of Service-Oriented Software , 2007, Seventh International Conference on Quality Software (QSIC 2007).

[30]  Mark Harman,et al.  An empirical study of the robustness of two module clustering fitness functions , 2005, GECCO '05.

[31]  Will G. Hopkins,et al.  A new view of statistics , 2002 .

[32]  Melanie Mitchell,et al.  An introduction to genetic algorithms , 1996 .

[33]  Robert C. Martin Agile Software Development, Principles, Patterns, and Practices , 2002 .

[34]  H. B. Mann,et al.  On a Test of Whether one of Two Random Variables is Stochastically Larger than the Other , 1947 .