Advertisement

Recommending Refactoring Operations in Large Software Systems

Chapter

Abstract

During its lifecycle, the internal structure of a software system undergoes continuous modifications. These changes push away the source code from its original design, often reducing its quality. In such cases, refactoring techniques can be applied to improve the readability and reducing the complexity of source code, to improve the architecture and provide for better software extensibility. Despite its advantages, performing refactoring in large and nontrivial software systems might be very challenging. Thus, a lot of effort has been devoted to the definition of automatic or semi-automatic approaches to support developer during software refactoring. Many of the proposed techniques are for recommending refactoring operations. In this chapter, we present guidelines on how to build such recommendation systems and how to evaluate them. We also highlight some of the challenges that exist in the field, pointing toward future research directions.

Keywords

Recommendation System Quality Metrics Original Developer Code Component Open Source System 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.

References

  1. 1.
    Abadi, A., Ettinger, R., Feldman, Y.A.: Fine slicing for advanced method extraction. In: Proceedings of the Workshop on Refactoring Tools (2009)Google Scholar
  2. 2.
    Abadi, A., Ettinger, R., Feldman, Y.A.: Fine slicing: theory and applications for computation extraction. In: Proceedings of the International Conference on Fundamental Approaches to Software Engineering. Lecture Notes in Computer Science, vol. 7212, pp. 471–485 (2012). doi:10.1007/978-3-642-28872-2_32?Google Scholar
  3. 3.
    Abdeen, H., Ducasse, S., Sahraoui, H.A., Alloui, I.: Automatic package coupling and cycle minimization. In: Proceedings of the Working Conference on Reverse Engineering, pp. 103–112 (2009). doi:10.1109/WCRE.2009.13Google Scholar
  4. 4.
    Abebe, S.L., Tonella, P.: Automated identifier completion and replacement. In: Proceedings of the European Conference on Software Maintenance and Reengineering, pp. 263–272 (2013). doi:10.1109/CSMR.2013.35Google Scholar
  5. 5.
    Atkinson, D.C., King, T.: Lightweight detection of program refactorings. In: Proceedings of the Asia–Pacific Software Engineering Conference, pp. 663–670 (2005). doi:10.1109/APSEC.2005.76Google Scholar
  6. 6.
    Baeza-Yates, R., Ribeiro-Neto, B.: Modern Information Retrieval. Addison-Wesley, Reading, MA (1999)Google Scholar
  7. 7.
    Basili, V.R., Briand, L., Melo, W.L.: A validation of object-oriented design metrics as quality indicators. IEEE T. Software Eng. 22(10), 751–761 (1995). doi:10.1109/32.544352CrossRefGoogle Scholar
  8. 8.
    Bavota, G., De Carluccio, B., De Lucia, A., Di Penta, M., Oliveto, R., Strollo, O.: When does a refactoring induce bugs?: an empirical study. In: Proceedings of the IEEE International Working Conference on Source Code Analysis and Manipulation, pp. 104–113 (2012a). doi:10.1109/SCAM.2012.20Google Scholar
  9. 9.
    Bavota, G., De Lucia, A., Marcus, A., Oliveto, R.: Automating extract class refactoring: an improved method and its evaluation. Empir. Software Eng. (2013a, in press). doi:10.1007/s10664-013-9256-xGoogle Scholar
  10. 10.
    Bavota, G., De Lucia, A., Marcus, A., Oliveto, R.: Using structural and semantic measures to improve software modularization. Empir. Software Eng. 18(5), 901–932 (2013b). doi:10.1007/s10664-012-9226-8?CrossRefGoogle Scholar
  11. 11.
    Bavota, G., De Lucia, A., Marcus, A., Oliveto, R., Palomba, F.: Supporting extract class refactoring in Eclipse: the ARIES project. In: Proceedings of the ACM/IEEE International Conference on Software Engineering, pp. 1419–1422 (2012b). doi:10.1109/ICSE.2012.6227233Google Scholar
  12. 12.
    Bavota, G., De Lucia, A., Oliveto, R.: Identifying extract class refactoring opportunities using structural and semantic cohesion measures. J. Syst. Software 84(3), 397–414 (2011). doi:10.1016/j.jss.2010.11.918CrossRefGoogle Scholar
  13. 13.
    Bavota, G., Dit, B., Oliveto, R., Di Penta, M., Poshyvanyk, D., De Lucia, A.: An empirical study on the developers’ perception of software coupling. In: Proceedings of the ACM/IEEE International Conference on Software Engineering, pp. 692–701 (2013c). doi:10.1109/ICSE.2013.6606615Google Scholar
  14. 14.
    Bavota, G., Gethers, M., Oliveto, R., Poshyvanyk, D., De Lucia, A.: Improving software modularization via automated analysis of latent topics and dependencies. ACM T. Software Eng. Meth. (2013d, in press)Google Scholar
  15. 15.
    Beck, K., Andres, C.: Extreme Programming Explained: Embrace Change. Addison-Wesley, Reading, MA (2004)Google Scholar
  16. 16.
    Binkley, A.B., Schach, S.R.: Validation of the coupling dependency metric as a predictor of run-time failures and maintenance measures. In: Proceedings of the ACM/IEEE International Conference on Software Engineering, pp. 452–455 (1998). doi:10.1109/ICSE.1998.671604Google Scholar
  17. 17.
    Briand, L.C., Wuest, J., Lounis, H.: Using coupling measurement for impact analysis in object-oriented systems. In: Proceedings of the IEEE International Conference on Software Maintenance, pp. 475–482 (1999a). doi:10.1109/ICSM.1999.792645Google Scholar
  18. 18.
    Briand, L.C., Wüst, J., Ikonomovski, S.V., Lounis, H.: Investigating quality factors in object-oriented designs: an industrial case study. In: Proceedings of the ACM/IEEE International Conference on Software Engineering, pp. 345–354 (1999b). doi:10.1145/302405.302654Google Scholar
  19. 19.
    Brown, W.J., Malveau, R.C., Brown, W.H., McCormick III, H.W., Mowbray, T.J.: Anti Patterns: Refactoring Software, Architectures, and Projects in Crisis. Wiley, New York (1998)Google Scholar
  20. 20.
    Chang, J., Blei, D.M.: Hierarchical relational models for document networks. Ann. Appl. Stat. 4(1), 124–150 (2010). doi:10.1214/09-AOAS309CrossRefzbMATHMathSciNetGoogle Scholar
  21. 21.
    Chidamber, S.R., Kemerer, C.F.: A metrics suite for object oriented design. IEEE T. Software Eng. 20(6), 476–493 (1994). doi:10.1109/32.295895CrossRefGoogle Scholar
  22. 22.
    Das, A.S., Datar, M., Garg, A., Rajaram, S.: Google news personalization: scalable online collaborative filtering. In: Proceedings of the International Conference on the World Wide Web, pp. 271–280 (2007). doi:10.1145/1242572.1242610Google Scholar
  23. 23.
    Deerwester, S., Dumais, S., Furnas, G., Landauer, T., Harshman, R.: Indexing by latent semantic analysis. J. Am. Soc. Inform. Sci. 41(6), 391–407 (1990). doi:10.1002/(SICI)1097-4571(199009)41:6⟨391::AID-ASI1⟩3.0.CO;2-9CrossRefGoogle Scholar
  24. 24.
    Du Bois, B., Demeyer, S., Verelst, J.: Refactoring: improving coupling and cohesion of existing code. In: Proceedings of the Working Conference on Reverse Engineering, pp. 144–151 (2004). doi:10.1109/WCRE.2004.33Google Scholar
  25. 25.
    Fokaefs, M., Tsantalis, N., Chatzigeorgiou, A., Sander, J.: Decomposing object-oriented class modules using an agglomerative clustering technique. In: Proceedings of the IEEE International Conference on Software Maintenance, pp. 93–101 (2009)Google Scholar
  26. 26.
    Fokaefs, M., Tsantalis, N., Stroulia, E., Chatzigeorgiou, A.: Identification and application of extract class refactorings in object-oriented systems. J. Syst. Software 85(10), 2241–2260 (2012). doi:10.1016/j.jss.2012.04.013CrossRefGoogle Scholar
  27. 27.
    Fowler, M.: Refactoring: improving the design of existing code. Addison-Wesley, Reading, MA (1999)Google Scholar
  28. 28.
    Gui, G., Scott, P.D.: Coupling and cohesion measures for evaluation of component reusability. In: Proceedings of the International Workshop on Mining Software Repositories, pp. 18–21 (2006). doi:10.1145/1137983.1137989Google Scholar
  29. 29.
    Gyimóthy, T., Ferenc, R., Siket, I.: Empirical validation of object-oriented metrics on open source software for fault prediction. IEEE T. Software Eng. 31(10), 897–910 (2005). doi:10.1109/TSE.2005.112CrossRefGoogle Scholar
  30. 30.
    Harman, M., Hierons, R.M., Proctor, M.: A new representation and crossover operator for search-based optimization of software modularization. In: Proceedings of the Genetic and Evolutionary Computation Conference, pp. 1351–1358 (2002)Google Scholar
  31. 31.
    Hartigan, J.A.: Clustering Algorithms. Wiley, New York (1975)zbMATHGoogle Scholar
  32. 32.
    Kerievsky, J.: Refactoring to Patterns. Pearson, London (2004)Google Scholar
  33. 33.
    Khomh, F., Vaucher, S., Guéhéneuc, Y.G., Sahraoui, H.: BDTEX: a GQM-based Bayesian approach for the detection of antipatterns. J. Syst. Software 84(4), 559–572 (2011). doi:10.1016/j.jss.2010.11.921CrossRefGoogle Scholar
  34. 34.
    Kim, M., Zimmermann, T., Nagappan, N.: A field study of refactoring challenges and benefits. In: Proceedings of the ACM SIGSOFT International Symposium on Foundations of Software Engineering, pp. 50:1–50:11 (2012). doi:10.1145/2393596.2393655Google Scholar
  35. 35.
    Lanza, M., Marinescu, R.: Object-Oriented Metrics in Practice: Using Software Metrics to Characterize, Evaluate, and Improve the Design of Object-Oriented Systems. Springer, Berlin (2006). doi:10.1007/3-540-39538-5Google Scholar
  36. 36.
    Lawrie, D., Morrell, C., Feild, H., Binkley, D.: Effective identifier names for comprehension and memory. Innov. Syst. Software Eng. 3(4), 303–318 (2007). doi:10.1007/s11334-007-0031-2?CrossRefGoogle Scholar
  37. 37.
    Lee, Y.S., Liang, B.S., Wu, S.F., Wang, F.J.: Measuring the coupling and cohesion of an object-oriented program based on information flow. In: Proceedings of the International Conference on Software Quality, pp. 81–90 (1995)Google Scholar
  38. 38.
    Li, W., Henry, S.: Maintenance metrics for the object oriented paradigm. In: Proceedings of the International Software Metrics Symposium, pp. 52–60 (1993). doi:10.1109/METRIC.1993.263801Google Scholar
  39. 39.
    Liu, Y., Poshyvanyk, D., Ferenc, R., Gyimóthy, T., Chrisochoides, N.: Modeling class cohesion as mixtures of latent topics. In: Proceedings of the IEEE International Conference on Software Maintenance, pp. 233–242 (2009). doi:10.1109/ICSM.2009.5306318Google Scholar
  40. 40.
    Mancoridis, S., Mitchell, B.S., Rorres, C., Chen, Y.F., Gansner, E.R.: Using automatic clustering to produce high-level system organizations of source code. In: Proceedings of the IEEE International Workshop on Program Comprehenension, pp. 45–52 (1998). doi:10.1109/WPC.1998.693283Google Scholar
  41. 41.
    Marcus, A., Poshyvanyk, D., Ferenc, R.: Using the conceptual cohesion of classes for fault prediction in object-oriented systems. IEEE T. Software Eng. 34(2), 287–300 (2008). doi:10.1109/TSE.2007.70768CrossRefGoogle Scholar
  42. 42.
    Marinescu, R.: Detection strategies: metrics-based rules for detecting design flaws. In: Proceedings of the IEEE International Conference on Software Maintenance, pp. 350–359 (2004). doi:10.1109/ICSM.2004.1357820Google Scholar
  43. 43.
    Martin, R.C. (ed.): Clean Code: A Handbook of Agile Software Craftsmanship. Prentice Hall, Upper Saddle River (2009)Google Scholar
  44. 44.
    Maruyama, K., Shima, K.: Automatic method refactoring using weighted dependence graphs. In: Proceedings of the ACM/IEEE International Conference on Software Engineering, pp. 236–245 (1999). doi:10.1145/302405.302627Google Scholar
  45. 45.
    Mens, T., Tourwe, T.: A survey of software refactoring. IEEE T. Software Eng. 30(2), 126–139 (2004). doi:10.1109/TSE.2004.1265817CrossRefGoogle Scholar
  46. 46.
    Mens, T., Van Eetvelde, N., Demeyer, S., Janssens, D.: Formalizing refactorings with graph transformations. J. Software Maint. Evol. R. 17(4), 247–276 (2005). doi:10.1002/smr.316CrossRefGoogle Scholar
  47. 47.
    Mitchell, B.S., Mancoridis, S.: On the automatic modularization of software systems using the Bunch tool. IEEE T. Software Eng. 32(3), 193–208 (2006). doi:10.1109/TSE.2006.31CrossRefGoogle Scholar
  48. 48.
    Moha, N., Guéhéneuc, Y.G., Duchien, L., Le Meur, A.F.: DECOR: a method for the specification and detection of code and design smells. IEEE T. Software Eng. 36(1), 20–36 (2010). doi:10.1109/TSE.2009.50CrossRefGoogle Scholar
  49. 49.
    Murphy-Hill, E., Parnin, C., Black, A.P.: How we refactor, and how we know it. IEEE T. Software Eng. 38(1), 5–18 (2011). doi:10.1109/TSE.2011.41CrossRefGoogle Scholar
  50. 50.
    Nierstrasz, O., Ducasse, S., Demeyer, S.: Object-Oriented Reengineering Patterns. Morgan Kaufmann, San Francisco (2003)zbMATHGoogle Scholar
  51. 51.
    O’Keeffe, M., Ó Cinnéide, M.: Search-based software maintenance. In: Proceedings of the European Conference on Software Maintenance and Reengineering, pp. 249–260 (2006). doi:10.1109/CSMR.2006.49Google Scholar
  52. 52.
    Oliveto, R., Gethers, M., Bavota, G., Poshyvanyk, D., De Lucia, A.: Identifying method friendships to remove the feature envy bad smell. In: Proceedings of the ACM/IEEE International Conference on Software Engineering, pp. 820–823 (2011). doi:10.1145/1985793.1985913Google Scholar
  53. 53.
    Oppenheim, A.N.: Questionnaire Design, Interviewing and Attitude Measurement. Pinter, New York(1992)Google Scholar
  54. 54.
    Overbey, J.L., Johnson, R.E.: Differential precondition checking: a lightweight, reusable analysis for refactoring tools. In: Proceedings of the IEEE/ACM International Conference on Automated Software Engineering, pp. 303–312 (2011). doi:10.1109/ASE.2011.6100067Google Scholar
  55. 55.
    Poshyvanyk, D., Marcus, A., Ferenc, R., Gyimóthy, T.: Using information retrieval based coupling measures for impact analysis. Empir. Software Eng. 14(1), 5–32 (2009). doi:10.1007/s10664-008-9088-2?CrossRefGoogle Scholar
  56. 56.
    Praditwong, K., Harman, M., Yao, X.: Software module clustering as a multi-objective search problem. IEEE T. Software Eng. 37(2), 264–282 (2011). doi:10.1109/TSE.2010.26CrossRefGoogle Scholar
  57. 57.
    Prete, K., Rachatasumrit, N., Sudan, N., Kim, M.: Template-based reconstruction of complex refactorings. In: Proceedings of the IEEE International Conference on Software Maintenance, pp. 1–10 (2010). doi:10.1109/ICSM.2010.5609577Google Scholar
  58. 58.
    Rao, A.A., Reddy, K.N.: Detecting bad smells in object oriented design using design change propagation probability matrix. In: Proceedings of the International MultiConference of Engineers and Computer Scientists. Lecture Notes in Engineering and Computer Science, pp. 1001–1007 (2008)Google Scholar
  59. 59.
    Reichenbach, C., Coughlin, D., Diwan, A.: Program metamorphosis. In: Proceedings of the European Conference on Object-Oriented Programming. Lecture Notes in Computer Science, vol. 5653, pp. 394–418 (2009). doi:10.1007/978-3-642-03013-0_18Google Scholar
  60. 60.
    Rousseeuw, P.J.: Silhouettes: a graphical aid to the interpretation and validation of cluster analysis. J. Comput. Appl. Math. 20, 53–65 (1987). doi:10.1016/0377-0427(87)90125-7CrossRefzbMATHGoogle Scholar
  61. 61.
    Schäfer, M., Verbaere, M., Ekman, T., de Moor, O.: Stepping stones over the refactoring Rubicon. In: Proceedings of the European Conference on Object-Oriented Programming. Lecture Notes in Computer Science, vol. 5653, pp. 369–393 (2009). doi:10.1007/978-3-642-03013-0_17Google Scholar
  62. 62.
    Seng, O., Stammel, J., Burkhart, D.: Search-based determination of refactorings for improving the class structure of object-oriented systems. In: Proceedings of the Genetic and Evolutionary Computation Conference, pp. 1909–1916 (2006). doi:10.1145/1143997.1144315Google Scholar
  63. 63.
    Simon, F., Steinbrückner, F., Lewerentz, C.: Metrics based refactoring. In: Proceedings of the European Conference on Software Maintenance and Reengineering, pp. 30–38 (2001). doi:10.1109/.2001.914965Google Scholar
  64. 64.
    Thulasiraman, K., Swamy, M.N.S.: Graphs: Theory and Algorithms. Wiley, New York (1992)CrossRefzbMATHGoogle Scholar
  65. 65.
    Travassos, G., Shull, F., Fredericks, M., Basili, V.R.: Detecting defects in object-oriented designs: using reading techniques to increase software quality. In: Proceedings of the ACM SIGPLAN Conference on Object-Oriented Programming, Systems, Languages, and Applications, pp. 47–56 (1999). doi:10.1145/320384.320389Google Scholar
  66. 66.
    Tsantalis, N., Chatzigeorgiou, A.: Identification of move method refactoring opportunities. IEEE T. Software Eng. 35, 347–367 (2009). doi:10.1109/TSE.2009.1CrossRefGoogle Scholar
  67. 67.
    Tsantalis, N., Chatzigeorgiou, A.: Identification of extract method refactoring opportunities for the decomposition of methods. J. Syst. Software 84(10), 1757–1782 (2011). doi:10.1016/j.jss.2011.05.016CrossRefGoogle Scholar
  68. 68.
    Walker, R.J., Holmes, R.: Simulation: a methodology to evaluate recommendation systems in software engineering. In: Robillard, M., Maalej, W., Walker, R.J., Zimmermann, T. (eds.) Recommendation Systems in Software Engineering, Springer, Heidelberg, Chap.  12 (2014)
  69. 69.
    Weiser, M.: Program slicing. IEEE T. Software Eng. 10(4), 352–357 (1984). doi:10.1109/TSE.1984.5010248CrossRefzbMATHGoogle Scholar
  70. 70.
    Wen, Z., Tzerpos, V.: An effectiveness measure for software clustering algorithms. In: Proceedings of the IEEE International Workshop on Program Comprehenension, pp. 194–203 (2004). doi:10.1109/WPC.2004.1311061Google Scholar
  71. 71.
    Wu, J., Hassan, A.E., Holt, R.C.: Comparison of clustering algorithms in the context of software evolution. In: Proceedings of the IEEE International Conference on Software Maintenance, pp. 525–535 (2005). doi:10.1109/ICSM.2005.31Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2014

Authors and Affiliations

  1. 1.University of SannioBeneventoItaly
  2. 2.University of SalernoFiscianoItaly
  3. 3.Wayne State UniversityDetroitUSA
  4. 4.University of MolisePescheItaly

Personalised recommendations