Refactor-Oriented Cloned Source Code Normalizer

blanker a refactor oriented cloned source code n.w
1 / 26
Embed
Share

This research by Davide Pizzolotto and Katsuro Inoue from Osaka University focuses on a refactor-oriented approach to normalizing cloned source code, presenting solutions to limitations in compilation and decompilation processes. Discover insights on code clone detection, errors, and false positives, along with a unique single source-to-source transformation method.

  • Source Code
  • Refactor
  • Cloned
  • Normalizer
  • Compilation

Uploaded on | 0 Views


Download Presentation

Please find below an Image/Link to download the presentation.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author. If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.

You are allowed to download the files provided on this website for personal or commercial use, subject to the condition that they are used lawfully. All files are the property of their respective owners.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author.

E N D

Presentation Transcript


  1. Blanker: A Refactor-Oriented Cloned Source Code Normalizer Davide Pizzolotto, Katsuro Inoue Osaka University, Japan Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University

  2. Based on the results of Ragkhitwetsagul et al. Department of Computer Science, Graduate School of Information Science and Technology, Osaka University

  3. Previous work overview Original Source Compilation Decompilation Decompiled Source Department of Computer Science, Graduate School of Information Science and Technology, Osaka University

  4. Previous work overview Original Source Compilation Code Clone Detector Decompilation Decompiled Source Department of Computer Science, Graduate School of Information Science and Technology, Osaka University

  5. Previous work overview Original Source Clones Original Source Compilation Code Clone Detector Decompilation Decompiled Source Clones Decompiled Source Department of Computer Science, Graduate School of Information Science and Technology, Osaka University

  6. Previous work overview Original Source Clones Original Source Compilation Code Clone Detector Results Decompilation Decompiled Source Clones Decompiled Source Department of Computer Science, Graduate School of Information Science and Technology, Osaka University

  7. Limitations Compilation/Decompilation not be available in every language Decompilation may introduce errors and false positives Department of Computer Science, Graduate School of Information Science and Technology, Osaka University

  8. Our solution A single source-to-source transformation mimicking the entire compilation/decompilation step Department of Computer Science, Graduate School of Information Science and Technology, Osaka University

  9. Our solution overview Original Source Code Clone Detector Transformation Results Transformed Source Transformed Source Clones Department of Computer Science, Graduate School of Information Science and Technology, Osaka University

  10. Transformations overview Based on the results of Ragkhitwetsagul et al., most transformation happens in the control-flow structures We analyzed their results and implemented those transformation not requiring flow analysis Department of Computer Science, Graduate School of Information Science and Technology, Osaka University

  11. Transformations example Department of Computer Science, Graduate School of Information Science and Technology, Osaka University

  12. Transformation Approach 1. Source code parsing 2. Parsed structure analysis 3. Applying transformation Department of Computer Science, Graduate School of Information Science and Technology, Osaka University

  13. Source code parsing Challenges: - Recognize needed structures - Avoid requiring a new grammar for every language Department of Computer Science, Graduate School of Information Science and Technology, Osaka University

  14. Source code parsing Challenges: - Recognize needed structures - Avoid requiring a new grammar for every language -> Unknown to Java Department of Computer Science, Graduate School of Information Science and Technology, Osaka University

  15. Source code parsing Challenges: - Recognize needed structures - Avoid requiring a new grammar for every language -> Unknown to Java `new` Unknown to C Department of Computer Science, Graduate School of Information Science and Technology, Osaka University

  16. Source code parsing We recorded only semicolon and important keywords Department of Computer Science, Graduate School of Information Science and Technology, Osaka University

  17. Transformation Approach 1. Source code parsing 2. Parsed structure analysis 3. Applying transformation Department of Computer Science, Graduate School of Information Science and Technology, Osaka University

  18. Transformation Approach 1. Source code parsing 2. Parsed structure analysis 3. Applying transformation Department of Computer Science, Graduate School of Information Science and Technology, Osaka University

  19. Applying transformation User (developer) does not care about transformed source code Department of Computer Science, Graduate School of Information Science and Technology, Osaka University

  20. Applying transformation User (developer) does not care about transformed source code Run the clone detector on the transformed code, presents the results on the original code Department of Computer Science, Graduate School of Information Science and Technology, Osaka University

  21. Applying transformation User (developer) does not care about transformed source code Run the clone detector on the transformed code, presents the results on the original code May require code remapping Department of Computer Science, Graduate School of Information Science and Technology, Osaka University

  22. Evaluation Same configuration of the original paper System Version LoC JUnit JFreeChart Apache Tomcat 4.13 1.5.0 9.0 9,777 96,711 256,974 Department of Computer Science, Graduate School of Information Science and Technology, Osaka University

  23. Evaluation Same configuration of the original paper Code Clone Detector NiCad 5.2 Type Configuration Type-1 Type-2 Type-3 UPI=0.0; renaming = none UPI=0.0; renaming = constistent UPI=0.3; renaming = constistent Department of Computer Science, Graduate School of Information Science and Technology, Osaka University

  24. Evaluation Type-2 clone detection System Original clones Transformed clones Delta JUnit JFreeChart Apache Tomcat 6 6 0% 373 242 397 275 6.43% 13.64% Department of Computer Science, Graduate School of Information Science and Technology, Osaka University

  25. Notable points We detected a superset of clones with no false positives Every detected clone can be refactored with an extract method procedure and little to no effort Department of Computer Science, Graduate School of Information Science and Technology, Osaka University

  26. Conclusion This slide intentionally left blank Department of Computer Science, Graduate School of Information Science and Technology, Osaka University

Related


More Related Content