Skip to main content

Search-Based Refactoring Detection Using Software Metrics Variation

  • Conference paper
Search Based Software Engineering (SSBSE 2013)

Part of the book series: Lecture Notes in Computer Science ((LNPSE,volume 8084))

Included in the following conference series:

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.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Robbes, R.: Mining a Change-Based Software Repository. In: Proceedings of MSR 2007, pp. 15–23. IEEE Computer Society (2007)

    Google Scholar 

  2. 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)

    Google Scholar 

  3. Weissgerber, P., Diehl, S.: Identifying Refactorings from Source-Code Changes. In: Proceedings of ASE 2006, pp. 231–240. IEEE (2006)

    Google Scholar 

  4. 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)

    Google Scholar 

  5. Prete, K., Rachatasumrit, N., Sudan, N., Kim, M.: Template-based reconstruction of complex refactorings. In: ICSM 2010, pp. 1–10 (2010)

    Google Scholar 

  6. Fowler, M., Beck, K., Brant, J., Opdyke, W., Roberts, D.: Refactoring – Improving the Design of Existing Code, 1st edn. Addison-Wesley (June 1999)

    Google Scholar 

  7. 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)

    Google Scholar 

  8. 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)

    Google Scholar 

  9. 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)

    Google Scholar 

  10. 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)

    Google Scholar 

  11. Mens, T., Tourwé, T.: A Survey of Software Refactoring. IEEE Trans. Software Eng. 30(2), 126–139 (2004)

    Article  Google Scholar 

  12. Koza, J.R.: Genetic Programming: On the Programming of Computers by Means of Natural Selection. MIT Press, Cambridge (1992)

    MATH  Google Scholar 

  13. Kirkpatrick, S., Gelatt Jr., C.D., Vecchi, M.P.: Optimization by simulated annealing. Sciences 220(4598), 671–680 (1983)

    Article  MathSciNet  MATH  Google Scholar 

  14. Langer, P.: Adaptable Model Versioning based on Model Transformation By Demonstration, PhD Thesis, Vienna University of Technology (2011)

    Google Scholar 

  15. O’Keeffe, M., Cinnéide, M.Ó.: Search-based Refactoring for Software Maintenance. Journal of Systems and Software 81(4), 502–516

    Google Scholar 

  16. Ó 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)

    Google Scholar 

  17. Hemati Moghadam, I., Cinnéide, M.Ó.: Automated refactoring using design differencing. In: Proc. of European Conference on Software Maintenance and Reengineering, Szeged (March 2012)

    Google Scholar 

  18. Fadhel, A.B., Kessentini, M., Langer, P., Wimmer, M.: Search-based detection of high-level model changes. In: ICSM 2012, pp. 212–221 (2012)

    Google Scholar 

  19. http://www.eclipse.org/gmf http://www.eclipse.org/gmf ;

  20. http://argouml.tigris.org

  21. http://www.jhotdraw.org

  22. http://xerces.apache.org

  23. 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)

    Google Scholar 

  24. Harman, M., Afshin Mansouri, S., Zhang, Y.: Search-based software engineering: Trends, techniques and applications. ACM Comput. Surv. 45(1), 11 (2012)

    Article  Google Scholar 

  25. http://metrics.sourceforge.net

  26. Murphy-Hill, E., Parnin, C., Black, A.P.: How We Refactor, and How We Know It. IEEE Transactions on Software Engineering (2011)

    Google Scholar 

  27. 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)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints 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)

Publish with us

Policies and ethics