ABSTRACT
One of the widely used techniques for evolving software systems is refactoring, a maintenance activity that improves design structure while preserving the external behavior. Exploring past maintenance and development history can be an effective way of finding refactoring opportunities. Code elements which undergo changes in the past, at approximately the same time, bear a good probability for being semantically related. Moreover, these elements that experienced a huge number of refactoring in the past have a good chance for refactoring in the future. In addition, the development history can be used to propose new refactoring solutions in similar contexts. In this paper, we propose a multi-objective optimization-based approach to find the best sequence of refactorings that minimizes the number of bad-smells, and maximizes the use of development history and semantic coherence. To this end, we use the non-dominated sorting genetic algorithm (NSGA-II) to find the best trade-off between these three objectives. We report the results of our experiments using different large open source projects.
- M. Kessentini, W. Kessentini, H. Sahraoui, M. Boukadoum, and A. Ouni. Design Defects Detection and Correction by Example. In Proc. of the 19th IEEE Int. Conf. on Program Comprehension (ICPC), pp. 81--90, Kingston, Canada, 2011. Google ScholarDigital Library
- A. Ouni, M. Kessentini, H. Sahraoui and M. Boukadoum. Maintainability Defects Detection and Correction: A Multi-Objective Approach. Journal of Autmated Software Engineering, Springer, 2012. Google ScholarDigital Library
- M. Harman, and L. Tratt. Pareto optimal search based refactoring at the design level. In Proceedings of the Genetic and Evolutionary Computation Conference (GECCO'07), 1106--1113, 2007. Google ScholarDigital Library
- O. Seng, J. Stammel, and D. Burkhart, Search-based determination of refactorings for improving the class structure of object-oriented systems, In Proceedings of the Genetic and Evolutionary Computation Conference (GECCO'06), 1909--1916, 2006. Google ScholarDigital Library
- A. Ouni, M. Kessentini, H. Sahraoui and M. S. Hamdi. Search-based Refactoring: Towards Semantics Preservation. In Proceedings of the 28th IEEE International Conference on Software Maintenance (ICSM), Italy, september 2012. Google ScholarDigital Library
- M. Fowler, K. Beck, J. Brant, W. Opdyke, and D. Roberts. Refactoring -- Improving the Design of Existing Code, 1st ed. Addison-Wesley, June 1999.Google Scholar
- N. Fenton and S. L. Pfleeger. Software Metrics: A Rigorous and Practical Approach, 2nd ed. London, UK: International Thomson Computer Press, 1997. Google ScholarDigital Library
- K. Deb, A. Pratap, S. Agarwal, and T. Meyarivan. A fast and elitist multiobjective genetic algorithm: NSGA-II, IEEE Trans. Evol. Comput., vol. 6, pp. 182--197, Apr. 2002. Google ScholarDigital Library
- http://www.refactoring.com/catalog/Google Scholar
- M. O'Keeffe, and M. O. Cinnéide. Search-based Refactoring for Software Maintenance. Journal of Systems and Software, 81(4), 502--516, 2006. Google ScholarDigital Library
- W. F. Opdyke, Refactoring: A Program Restructuring Aid in Designing Object-Oriented Application Frameworks, Ph.D. thesis, University of Illinois at Urbana-Champaign, 1992.Google Scholar
- F. Qayum, and R. Heckel. Local search-based refactoring as graph transformation. Proceedings of 1st Int. Symposium on Search Based Software Engineering, 2009; 43--46. Google ScholarDigital Library
- R. Heckel, Algebraic graph transformations with application conditions, M.S. thesis, TU Berlin, 1995.Google Scholar
- M. Ó Cinnéide, L. Tratt, M. Harman, S. Counsell, and I. H. Moghadam, Experimental Assessment of Software Metrics Using Automated Refactoring, Proc. Empirical Software Engineering and Management (ESEM), pages 49--58, 2012. Google ScholarDigital Library
- A. Ouni, M. Kessentini and H. Sahraoui, Search-based Refactoring Using Recorded Code Changes, in Proc of the 17th European Conference on Software Maintenance and Reengineering (CSMR), Genova, Italy, march 5--8, 2013. Google ScholarDigital Library
- T. Zimmermann, P. Weißgerber, S. Diehl, and A. Zeller. Mining version histories to guide software changes. In Proc. 26th International Conference on Software Engineering (ICSE), Edinburgh, Scotland, May 2004. Google ScholarDigital Library
- T. Gîrba, S. Ducasse, A. Kuhn, R. Marinescu, and R. Daniel. Using Concept Analysis to Detect Co-Change Patterns. In Proceedings of International Workshop on Principles of Software Evolution (IWPSE), 2007. Google ScholarDigital Library
- D. Beyer, and A. Noack. Clustering Software Artifacts Based on Frequent Common Changes. Proceedings of the 13th International Workshop on Program Comprehension, 2005. Google ScholarDigital Library
- A. Hassan and R. Holt. Predicting change propagation in software systems. In Proceedings 20th Int. Conference on Software Maintenance (ICSM'04), pp. 284--293, 2004. Google ScholarDigital Library
- H. Gall, K. Hajek, and M. Jazayeri. Detection of logical coupling based on product release history. Int. Proc. of Conf. on Soft. Maintenance (ICSM), pages 190--198, Los Alamitos CA, 1998. Google ScholarDigital Library
- T.T. Ying, G. C. Murphy, R. Ng, and M. C. Chu-Carroll. Predicting source code changes by mining change history. IEEE Transactions on Soft. Eng. (TSE), Vol 30, No. 9, 2004. Google ScholarDigital Library
- T. Mens, T. Tourwé: A Survey of Software Refactoring. IEEE Trans. Software Eng. 30(2), pp. 126--139, 2004. Google ScholarDigital Library
- P. Cederqvist. Version Management with CVS, Dec. 2003. www.cvshome.org/docs/manual/Google Scholar
- http://www.jfree.org/jfreechart/Google Scholar
- http://xerces.apache.org/Google Scholar
- John R. Koza. 1992. Genetic Programming: On the Programming of Computers by Means of Natural Selection. MIT Press, Cambridge, MA, USA. Google ScholarDigital Library
- K. Prete, N. Rachatasumrit, N. Sudan, M. Kim. Template-based reconstruction of complex refactorings. in Proc. of the Int. Conf. on Software Maintenance (ICSM), 2010. Google ScholarDigital Library
- http://www.eclipse.org/Google Scholar
Index Terms
- The use of development history in software refactoring using a multi-objective evolutionary algorithm
Recommendations
Multi-Criteria Code Refactoring Using Search-Based Software Engineering: An Industrial Case Study
One of the most widely used techniques to improve the quality of existing software systems is refactoring—the process of improving the design of existing code by changing its internal structure without altering its external behavior. While it is ...
On the use of many quality attributes for software refactoring: a many-objective search-based software engineering approach
Search-based software engineering (SBSE) solutions are still not scalable enough to handle high-dimensional objectives space. The majority of existing work treats software engineering problems from a single or bi-objective point of view, where the main ...
Improving multi-objective code-smells correction using development history
A new formulation of the refactoring recommendation as a multi-objective optimization problem.Refactoring recommendation is based on the change history of the system and past refactorings applied to similar contexts.Validation on five medium and large ...
Comments