Model Refactoring Using Interactive Genetic Algorithm

  • Adnane Ghannem
  • Ghizlane El Boussaidi
  • Marouane Kessentini
Part of the Lecture Notes in Computer Science book series (LNCS, volume 8084)


Refactoring aims at improving the quality of design while preserving its semantic. Providing an automatic support for refactoring is a challenging problem. This problem can be considered as an optimization problem where the goal is to find appropriate refactoring suggestions using a set of refactoring examples. However, some of the refactorings proposed using this approach do not necessarily make sense depending on the context and the semantic of the system under analysis. This paper proposes an approach that tackles this problem by adapting the Interactive Genetic Algorithm (IGA) which enables to interact with users and integrate their feedbacks into a classic GA. The proposed algorithm uses a fitness function that combines the structural similarity between the analyzed design model and models from a base of examples, and the designers’ ratings of the refactorings proposed during execution of the classic GA. Experimentation with the approach yielded interesting and promising results.


Software maintenance Interactive Genetic Algorithm Model refactoring Refactoring by example 


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    Lientz, B.P., Swanson, E.B., Tompkins, G.E.: Characteristics of application software maintenance. Commun. ACM 21(6), 466–471 (1978)CrossRefGoogle Scholar
  2. 2.
    Fowler, M.: Refactoring: Improving the Design of Existing Code. Addison-Wesley (1999)Google Scholar
  3. 3.
    Mens, T., Tourwé, T.: A Survey of Software Refactoring. IEEE Trans. Softw. Eng. 30(2), 126–139 (2004)CrossRefGoogle Scholar
  4. 4.
    Opdyke, W.F.: Refactoring: A Program Restructuring Aid in Designing Object-Oriented Application Frameworks, U. Illinois at Urbana-Champaign (1992)Google Scholar
  5. 5.
    Moha, N.: DECOR: Détection et correction des défauts dans les systèmes orientés objet, p. 157. UdeM & USTdeLille, Montréal (2008)Google Scholar
  6. 6.
    Harman, M., Tratt, L.: Pareto optimal search based refactoring at the design level. In: Proceedings of the 9th Annual GECCO 2007, pp. 1106–1113. ACM, London (2007)Google Scholar
  7. 7.
    O’Keeffe, M.: Search-based refactoring: an empirical study. J. Softw. Maint. Evol. 20(5), 345–364 (2008)Google Scholar
  8. 8.
    O’Keeffe, M., Cinneide, M.O.: Search-based software maintenance. In: CSMR (2006)Google Scholar
  9. 9.
    Kessentini, M., Sahraoui, H.A., Boukadoum, M.: Model Transformation as an Optimization Problem. In: Czarnecki, K., Ober, I., Bruel, J.-M., Uhl, A., Völter, M. (eds.) MODELS 2008. LNCS, vol. 5301, pp. 159–173. Springer, Heidelberg (2008)CrossRefGoogle Scholar
  10. 10.
    El-Boussaidi, G., Mili, H.: Detecting Patterns of Poor Design Solutions Using Constraint Propagation. In: Czarnecki, K., Ober, I., Bruel, J.-M., Uhl, A., Völter, M. (eds.) MODELS 2008. LNCS, vol. 5301, pp. 189–203. Springer, Heidelberg (2008)CrossRefGoogle Scholar
  11. 11.
    Takagi, H.: Interactive evolutionary computation: fusion of the capabilities of EC optimization and human evaluation. Proceedings of the IEEE 89(9), 1275–1296 (2001)CrossRefGoogle Scholar
  12. 12.
    Fenton, N.E., Pfleeger, A.S.L.: Software Metrics: A Rigorous and Practical Approach, 2nd edn., p. 656. PWS Pub., Boston (1998)Google Scholar
  13. 13.
    Genero, M., Piattini, M., Calero, C.: Empirical validation of class diagram metrics. In: Proceedings of the International Symposium on ESE (2002)Google Scholar
  14. 14.
    Pearl, J.: Heuristics: intelligent search strategies for computer problem solving, p. 382. Addison-Wesley Longman Publishing Co., Inc. (1984)Google Scholar
  15. 15.
    Mitchell, M.: An Introduction to Genetic Algorithms, p. 209. MIT Press (1998)Google Scholar
  16. 16.
    Goldberg, D.E.: Genetic Algorithms in Search, Optimization and Machine Learning, p. 372. Addison-Wesley Longman Publishing Co., Inc. (1989)Google Scholar
  17. 17.
    Koza, J.R.: Genetic programming: on the programming of computers by means of natural selection, p. 680. MIT Press (1992)Google Scholar
  18. 18.
    Dawkins, R.: The BlindWatchmaker, 1st edn., p. 358. Longman, Essex (1986)Google Scholar
  19. 19.
    Kim, H.S., Cho, S.B.: Application of interactive genetic algorithm to fashion design. In: Engineering Applications of Artificial Intelligence (2000)Google Scholar
  20. 20.
    Chen, Y.-P.: Interactive music composition with the CFE framework. SIGEVOlution 2(1), 9–16 (2007)CrossRefGoogle Scholar
  21. 21.
    Bavota, G., Carnevale, F., De Lucia, A., Di Penta, M., Oliveto, R.: Putting the developer in-the-loop: an interactive GA for software re-modularization. In: Fraser, G., Teixeira de Souza, J. (eds.) SSBSE 2012. LNCS, vol. 7515, pp. 75–89. Springer, Heidelberg (2012)CrossRefGoogle Scholar
  22. 22.
    Van Der Straeten, R., Jonckers, V., Mens, T.: A formal approach to model refactoring and model refinement. J. SoSyM 6(2), 139–162 (2007)CrossRefGoogle Scholar
  23. 23.
    Van Kempen, M., et al.: Towards proving preservation of behaviour of refactoring of UML models. In: Proceedings of the annual SAICSIT 2005, pp. 252–259. White River, South Africa (2005)Google Scholar
  24. 24.
    Mens, T., Taentzer, G., Runge, O.: Analysing refactoring dependencies using graph transformation. J. SoSyM 6(3), 269–285 (2007)CrossRefGoogle Scholar
  25. 25.
    Biermann, E.: EMF model transformation based on graph transformation: formal foundation and tool environment. In: Ehrig, H., Rensink, A., Rozenberg, G., Schürr, A. (eds.) ICGT 2010. LNCS, vol. 6372, pp. 381–383. Springer, Heidelberg (2010)CrossRefGoogle Scholar
  26. 26.
    El Boussaidi, G., Mili, H.: Understanding design patterns — what is the problem? Software: Practice and Experience (2011)Google Scholar
  27. 27.
    Seng, O., Stammel, J., Burkhart, D.: Search-based determination of refactorings for improving the class structure of object-oriented systems. In: Proc. of the 8th Annual GECCO 2006, pp. 1909–1916. ACM, Seattle (2006)Google Scholar
  28. 28.
    Jensen, A.C., Cheng, B.H.C.: On the use of genetic programming for automated refactoring and the introduction of design patterns. In: Proc. of the 12th Annual GECCO 2010, pp. 1341–1348. ACM, Portland (2010)Google Scholar
  29. 29.
    Kessentini, M., et al.: Search-based model transformation by example. J. SoSyM 11(2), 209–226 (2012)CrossRefGoogle Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2013

Authors and Affiliations

  • Adnane Ghannem
    • 1
  • Ghizlane El Boussaidi
    • 1
  • Marouane Kessentini
    • 2
  1. 1.École de Technologie SupérieureMontréalCanada
  2. 2.Missouri University of Science and TechnologyRollaUSA

Personalised recommendations