Abstract
Software is frequently refactored to improve its design, either as part of an agile development process or as part of a major design overhaul. In either case, it is very useful to determine what refactorings have recently taken place in order to comprehend better the software and its development trajectory. To this end, we have developed an approach to automate the detection of source code refactorings using structural information extracted from the source code. Our approach takes as input a list of possible refactorings, a set of structural metrics and the initial and revised versions of the source code. It generates as output a sequence of detected changes expressed as refactorings. This refactoring sequence is determined by a search-based process that minimizes the metrics variation between the revised version of the software and the version yielded by the application of the refactoring sequence to the initial version of the software. We use both global and local heuristic search algorithms to explore the space of possible solutions. In applying our approach to several versions of four open source projects we find the average Precision and Recall to be over 90%, thus confirming the effectiveness of our detection approach.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
References
Robbes, R.: Mining a Change-Based Software Repository. In: Proceedings of MSR 2007, pp. 15–23. IEEE Computer Society (2007)
Dig, D., Comertoglu, C., Marinov, D., Johnson, R.: Automated Detection of Refactorings in Evolving Components. In: Thomas, D. (ed.) ECOOP 2006. LNCS, vol. 4067, pp. 404–428. Springer, Heidelberg (2006)
Weissgerber, P., Diehl, S.: Identifying Refactorings from Source-Code Changes. In: Proceedings of ASE 2006, pp. 231–240. IEEE (2006)
Kim, M., Notkin, D., Grossman, D., Wilson Jr., G.: Identifying and Summarizing Systematic Code Changes via Rule Inference. TSE: IEEE Transactions on Software Engineering, 45–62 (2013)
Prete, K., Rachatasumrit, N., Sudan, N., Kim, M.: Template-based reconstruction of complex refactorings. In: ICSM 2010, pp. 1–10 (2010)
Fowler, M., Beck, K., Brant, J., Opdyke, W., Roberts, D.: Refactoring – Improving the Design of Existing Code, 1st edn. Addison-Wesley (June 1999)
Liu, H., Yang, L., Niu, Z., Ma, Z., Shao, W.: Facilitating software refactoring with appropriate resolution order of bad smells. In: Proc. of the ESEC/FSE 2009, pp. 265–268 (2009)
Harman, M., Tratt, L.: Pareto optimal search based refactoring at the design level. In: Proceedings of the Genetic and Evolutionary Computation Conference (GECCO 2007), pp. 1106–1113 (2007)
Seng, O., Stammel, J., Burkhart, D.: Search-based determination of refactorings for improving the class structure of object-oriented systems. In: GECCO 2006, pp. 1909–1916 (2006)
Du Bois, B., Demeyer, S., Verelst, J.: Refactoring—Improving Coupling and Cohesion of Existing Code. In: Proc. 11th Working Conf. Reverse Eng., pp. 144–151 (2004)
Mens, T., Tourwé, T.: A Survey of Software Refactoring. IEEE Trans. Software Eng. 30(2), 126–139 (2004)
Koza, J.R.: Genetic Programming: On the Programming of Computers by Means of Natural Selection. MIT Press, Cambridge (1992)
Kirkpatrick, S., Gelatt Jr., C.D., Vecchi, M.P.: Optimization by simulated annealing. Sciences 220(4598), 671–680 (1983)
Langer, P.: Adaptable Model Versioning based on Model Transformation By Demonstration, PhD Thesis, Vienna University of Technology (2011)
O’Keeffe, M., Cinnéide, M.Ó.: Search-based Refactoring for Software Maintenance. Journal of Systems and Software 81(4), 502–516
Ó Cinnéide, M., Tratt, L., Harman, M., Counsell, S., Hemati Moghadam, I.: Experimental assessment of software metrics using automated refactoring. In: Proceedings of the International Symposium on Empirical Software Engineering and Measurement (Septembrer 2012)
Hemati Moghadam, I., Cinnéide, M.Ó.: Automated refactoring using design differencing. In: Proc. of European Conference on Software Maintenance and Reengineering, Szeged (March 2012)
Fadhel, A.B., Kessentini, M., Langer, P., Wimmer, M.: Search-based detection of high-level model changes. In: ICSM 2012, pp. 212–221 (2012)
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 WCRE 2012, IEEE Press (2012)
Harman, M., Afshin Mansouri, S., Zhang, Y.: Search-based software engineering: Trends, techniques and applications. ACM Comput. Surv. 45(1), 11 (2012)
Murphy-Hill, E., Parnin, C., Black, A.P.: How We Refactor, and How We Know It. IEEE Transactions on Software Engineering (2011)
Briand, L.C., Wüst, J., Daly, J.W., Victor Porter, D.: A Comprehensive Empirical Validation of Design Measures for Object-Oriented Systems. In: IEEE METRICS 1998, pp. 246–257 (1998)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2013 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Mahouachi, R., Kessentini, M., Cinnéide, M.Ó. (2013). Search-Based Refactoring Detection Using Software Metrics Variation. In: Ruhe, G., Zhang, Y. (eds) Search Based Software Engineering. SSBSE 2013. Lecture Notes in Computer Science, vol 8084. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-39742-4_11
Download citation
DOI: https://doi.org/10.1007/978-3-642-39742-4_11
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-642-39741-7
Online ISBN: 978-3-642-39742-4
eBook Packages: Computer ScienceComputer Science (R0)