Skip to main content

Part of the book series: Advances in Intelligent Systems and Computing ((AISC,volume 250))

  • 1633 Accesses

Abstract

Cloned code, also known as duplicated code, is among the bad “code smells.” Refactoring can be used to remove clones and makes a software system more maintainable. However, there is a problem that causes the output results of the clone code detection tool cannot be directly refactored. The problem is not all the clone groups are suitable for refactoring. To address it, we propose a metric method to identify clone groups that are suitable for refactoring. The results of several large-scale software system studies indicate that our method can significantly increase the accuracy of identifying clone groups that are suitable for refactoring. It is not only beneficial to the following study of refactoring, but also it connects the entire process from clone detection to clone refactoring.

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 169.00
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 219.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

References

  1. Cai, D., Kim, M.: An empirical study of long-lived code clones. In Proceedings of the 14th International Conference on Fundamental Approaches to Software Engineering: Part of the Joint European Conferences on Theory and Practice of Software, FASE’11/ETAPS’11, pp. 432–446 (2011)

    Google Scholar 

  2. Rahman, M.S., Saha, R.K., Krinke, J. Schneider, K.A., Mondal, M., Roy, C.K.: Comparative stability of cloned and non-cloned code: an empirical study. SAC12 March 25–29 (2012)

    Google Scholar 

  3. Inoue, K., Higo, Y., Kusumoto, S.: Identifying refactoring opportunities for removing code clones with a metrics-based approach. Create Space (Nov 30, 2011)

    Google Scholar 

  4. Juergens, E., Deissenboeck, F., Hummel, B., Wagner, S.: Do code clones matter? In: Proceedings of the 31st International Conference on Software Engineering, ICSE’09, pp. 485–495 (2009)

    Google Scholar 

  5. Roy, C.K., Cordy, J.R., Koschke, R.: Comparison and evaluation of code clone detection techniques and tools: a qualitative approach. Sci. Comput. Program. 74(7), 470–495 (2009)

    Article  MATH  MathSciNet  Google Scholar 

  6. Li, Z., Lu, S., Myagmar, S., Zhou, Y.: CP-miner: finding copy-paste and related bugs in large-scale software code. IEEE Trans. Software Eng. 32(3), 176–192 (2006)

    Article  Google Scholar 

  7. Lozano, A., Wermelinger, M.: Tracking clones’ imprint. In: Proceedings of the 4th International Workshop on Software Clones, IWSC’10, pp. 65–72 (2010)

    Google Scholar 

  8. Lozano, A., Wermelinger, M.: Assessing the effect of clones on changeability. In: IEEE International Conference on Software Maintenance ICSM, pp. 227–236 (2008)

    Google Scholar 

  9. Aversano, L., Cerulo, L., Di Penta, M.: How clones are maintained: an empirical study. In: 11th European Conference on Software Maintenance and Reengineering, CSMR’07, pp. 81–90, March (2007)

    Google Scholar 

  10. Hotta, K., Sano, Y., Higo, Y., Kusumoto, S.: Is duplicate code more frequently modified than non-duplicate code in software evolution? An empirical study on open source software. In: Proceedings of the Joint ERCIM Workshop on Software Evolution (EVOL) and International Workshop on Principles of Software Evolution (IWPSE), IWPSE-EVOL’10, pp. 73–82 (2010)

    Google Scholar 

  11. Kim, M., Sazawal, V., Notkin, D., Murphy, G.: An empirical study of code clone genealogies. SIGSOFT Softw. Eng. 30, 187–196 (2005)

    Article  Google Scholar 

  12. Saha, R.K., Asaduzzaman, M., Zibran, M.F., Roy, C.K., Schneider, K.A.: Evaluating code clone genealogies at release level: an empirical study. In: 10th IEEE Working Conference on Source Code Analysis and Manipulation (SCAM), pp. 87–96 (2010)

    Google Scholar 

  13. Maruyama, K., Omori, T.: A security-aware refactoring tool for Java programs. In Proceedings of the 4th Workshop on Refactoring Tools, WRT’11, pp. 22–28 (2011)

    Google Scholar 

  14. Fowler, M.: Refactoring: Improving the Design of Existing Code. Addison Wesley, USA (1999)

    Google Scholar 

  15. Murphy-Hill, E., Parnin, C., Black, A.P.: How we refactor, and how we know It. In: Proceedings of the 31st International Conference on Software Engineering, ICSE’09, pp. 287–297 (2009)

    Google Scholar 

  16. Liu, H., Ma, Z., Shao, W., Niu, Z.: Schedule of bad smell detection and resolution: a new way to save effort. IEEE Trans. Softw. Eng. 38(1), 220–235 (2012)

    Article  Google Scholar 

  17. Ishio, T., Inoue, K., Sano, T., Choi, E., Yoshida, N.: Finding code clones for refactoring with clone metrics: a case study of open source

    Google Scholar 

  18. Roy, C.K., Cordy, J.R.: A survey on software clone detection research. School of Computing TR 2007-541, Queens University, pp. 115 (2007)

    Google Scholar 

  19. Rieger, M., Ducasse, S., Lanza, M.: Insights into system-wide code duplication. In: Proceedings of the 11th Working Conference on Reverse Engineering, pp. 100–109 (2004)

    Google Scholar 

Download references

Acknowledgments

The research is supported by the National Natural Science Foundation of China under Grant No. 61173021.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Yixin Bian .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2014 Springer India

About this paper

Cite this paper

Bian, Y., Su, X., Ma, P. (2014). Identifying Accurate Refactoring Opportunities Using Metrics. In: Patnaik, S., Li, X. (eds) Proceedings of International Conference on Soft Computing Techniques and Engineering Application. Advances in Intelligent Systems and Computing, vol 250. Springer, New Delhi. https://doi.org/10.1007/978-81-322-1695-7_17

Download citation

  • DOI: https://doi.org/10.1007/978-81-322-1695-7_17

  • Published:

  • Publisher Name: Springer, New Delhi

  • Print ISBN: 978-81-322-1694-0

  • Online ISBN: 978-81-322-1695-7

  • eBook Packages: EngineeringEngineering (R0)

Publish with us

Policies and ethics