Skip to main content

Scalable and Accurate Detection of Function Clones in Software Using Multithreading

  • Chapter
  • First Online:
Integrating Research and Practice in Software Engineering

Part of the book series: Studies in Computational Intelligence ((SCI,volume 851))

Abstract

Code cloning is defined as a programming practice in which a programmer reuses a code fragment after modifying existing codes or copying it as it is. Code clones can be detected at various levels or varying granularity size but when they are detected at the function level of a program, they are called function clones. Since in non-object oriented languages, functions are the defining components of any software, so detection of function clones can be very useful and can help in reducing the cost of maintenance. In this paper, we have proposed a multi-threading metrics-based detection algorithm for detecting Type-I and Type-II function clones. We evaluated our approach on three C-language open source projects. The time-consumption for detection is reduced to a greater extent giving a higher performance as compared to CloneManager, one of the recent function clone detector.

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

Access this chapter

Subscribe and save

Springer+ Basic
$34.99 /Month
  • Get 10 units per month
  • Download Article/Chapter or eBook
  • 1 Unit = 1 Article or 1 Chapter
  • Cancel anytime
Subscribe now

Buy Now

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 79.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 99.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info
Hardcover Book
USD 129.99
Price excludes VAT (USA)
  • Durable hardcover 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

Similar content being viewed by others

References

  1. Rattan, D., Bhatia, R., Singh, M.: Software clone detection: a systematic review. Inf. Softw. Technol. 55, 1165–1199 (2013)

    Article  Google Scholar 

  2. Roy, C.K., Cordy, J.R.: A survey on software clone detection research. Technical Report 541, Queen’s University at Kingston (2007)

    Google Scholar 

  3. Kodhai, E., Kanmani, S.: Method-level code clone detection through LWH (Light Weight Hybrid) approach. J. Softw. Eng. Res. Dev. 2, 1–29 (2014). https://doi.org/10.1186/s40411-014-0012-8

    Article  Google Scholar 

  4. Roy, C.K., Cordy, J.R.: Near-miss function clones in open source software: an empirical study. J. Softw. Maintenance Evol. Res. Pract. 22, 165–189 (2010). https://doi.org/10.1002/smr.v22:3

    Article  Google Scholar 

  5. Huang, A.: Similarity measures for text document clustering. In: New Zealand Computer Science Research Student Conference (NZCSRSC), pp. 49–56 (2008)

    Google Scholar 

  6. Sommerville, I.: Software Engineering. Pearson Addison Wesley (2016)

    Google Scholar 

  7. Koschke, R.: Survey of research on software clones (2007)

    Google Scholar 

  8. Yang, Y., Ren, Z., Chen, X., Jiang, H.: Structural function based code clone detection using a new hybrid technique. In: 2018 IEEE 42nd Annual Computer Software and Applications Conference (COMPSAC), vol. 01, pp. 286–291 (2018). https://doi.org/10.1109/COMPSAC.2018.00045

  9. Basit, H.A., Jarzabek, S.: A data mining approach for detecting higher-level clones in software. IEEE Trans. Softw. Eng. 35, 497–514 (2009). https://doi.org/10.1109/tse.2009.16

    Article  Google Scholar 

  10. Lanubile, F., Mallardo, T.: Finding function clones in Web applications. In: Proceedings of the Seventh European Conference on Software Maintenance and Reengineering, pp. 379–386 (2003). https://doi.org/10.1109/CSMR.2003.1192447

  11. Lague, B., Proulx, D., Mayrand, J., Merlo, E.M., Hudepohl, J.: Assessing the benefits of incorporating function clone detection in a development process. In: Proceedings International Conference on Software Maintenance, pp. 314–321 (IEEE Comput. Soc.) (2002). https://doi.org/10.1109/ICSM.1997.624264

  12. Mayrand, J., Leblanc, C., Merlo, E.: Experiment on the automatic detection of function clones in a software system using metrics. In: Proceedings of International Conference on Software Maintenance ICSM-96, pp. 244–253. IEEE (1996). https://doi.org/10.1109/ICSM.1996.565012

  13. Abyss 0.3. http://abyss.sourceforge.net/downlast.html. Accessed 19 Mar 2019

  14. Apache HTTP 2.2.8. https://archive.apache.org/dist/httpd/. Accessed 19 Mar 2019

  15. Bison 2.4. https://ftp.gnu.org/gnu/bison/. Accessed 19 Mar 2019

Download references

Acknowledgements

This work has been supported by a research grant from the Science and Engineering Research Board (SERB), Department of Science and Technology, Government of India under Early Career Research Award Scheme.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Kuldeep Kumar .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2020 Springer Nature Switzerland AG

About this chapter

Check for updates. Verify currency and authenticity via CrossMark

Cite this chapter

Singh, M.K., Kumar, K. (2020). Scalable and Accurate Detection of Function Clones in Software Using Multithreading. In: Jarzabek, S., Poniszewska-Marańda, A., Madeyski, L. (eds) Integrating Research and Practice in Software Engineering. Studies in Computational Intelligence, vol 851. Springer, Cham. https://doi.org/10.1007/978-3-030-26574-8_3

Download citation

Publish with us

Policies and ethics