Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
skip to main content
10.1145/3639478.3640035acmconferencesArticle/Chapter ViewAbstractPublication PagesicseConference Proceedingsconference-collections
research-article

AntiCopyPaster 2.0: Whitebox just-in-time code duplicates extraction

Published: 23 May 2024 Publication History
  • Get Citation Alerts
  • Abstract

    AntiCopyPaster is an IntelliJ IDEA plugin, implemented to detect and refactor duplicate code interactively as soon as a duplicate is introduced. The plugin only recommends the extraction of a duplicate when it is worth it. In contrast to current Extract Method refactoring approaches, our tool seamlessly integrates with the developer's workflow and actively provides recommendations for refactorings. This work extends our tool to allow developers to customize the detection rules, i.e., metrics, based on their needs and preferences. The plugin and its source code are publicly available on GitHub at https://github.com/refactorings/anti-copy-paster. The demonstration video can be found on YouTube: https://youtu.be/Y1sbfpds2Ms.

    References

    [1]
    Juan Pablo Sandoval Alcocer, Alejandra Siles Antezana, Gustavo Santos, and Alexandre Bergel. 2020. Improving the success rate of applying the extract method refactoring. Science of Computer Programming 195 (2020), 102475.
    [2]
    Miltiadis Allamanis. 2019. The adverse effects of code duplication in machine learning models of code. In Proceedings of the 2019 ACM SIGPLAN International Symposium on New Ideas, New Paradigms, and Reflections on Programming and Software. 143--153.
    [3]
    Eman Abdullah AlOmar, Anton Ivanov, Zarina Kurbatova, Yaroslav Golubev, Mohamed Wiem Mkaouer, Ali Ouni, Timofey Bryksin, Le Nguyen, Amit Kini, and Aditya Thakur. 2022. AntiCopyPaster: extracting code duplicates as soon as they are introduced in the IDE. In Proceedings of the 37th IEEE/ACM International Conference on Automated Software Engineering. 1--4.
    [4]
    Eman Abdullah AlOmar, Anton Ivanov, Zarina Kurbatova, Yaroslav Golubev, Mohamed Wiem Mkaouer, Ali Ouni, Timofey Bryksin, Le Nguyen, Amit Kini, and Aditya Thakur. 2023. Just-in-time code duplicates extraction. Information and Software Technology 158 (2023), 107169.
    [5]
    Eman Abdullah AlOmar, Mohamed Wiem Mkaouer, Christian Newman, and Ali Ouni. 2021. On preserving the behavior in software refactoring: A systematic mapping study. Information and Software Technology 140 (2021), 106675.
    [6]
    Eman Abdullah AlOmar, Mohamed Wiem Mkaouer, and Ali Ouni. 2023. Behind the Intent of Extract Method Refactoring: A Systematic Literature Review. IEEE Transactions on Software Engineering (2023).
    [7]
    Mauricio Aniche, Erick Maziero, Rafael Durelli, and Vinicius Durelli. 2020. The effectiveness of supervised machine learning algorithms in predicting software refactoring. IEEE Transactions on Software Engineering (2020).
    [8]
    Richard Fanta and Václav Rajlich. 1999. Removing clones from the code. Journal of Software Maintenance: Research and Practice 11, 4 (1999), 223--243.
    [9]
    Francesca Arcelli Fontana, Vincenzo Ferme, Marco Zanoni, and Aiko Yamashita. 2015. Automatic metric thresholds derivation for code smell detection. In 2015 IEEE/ACM 6th International Workshop on Emerging Trends in Software Metrics. IEEE, 44--53.
    [10]
    Martin Fowler. 2018. Refactoring: improving the design of existing code. Addison-Wesley Professional.
    [11]
    Roman Haas and Benjamin Hummel. 2016. Deriving extract method refactoring suggestions for long methods. In Int. Conf. on Software Quality. 144--155.
    [12]
    Keisuke Hotta, Yukiko Sano, Yoshiki Higo, and Shinji Kusumoto. 2010. Is duplicate code more frequently modified than non-duplicate code in software evolution? An empirical study on open source software. In Joint ERCIM Workshop on Software Evolution and Int. Workshop on Principles of Software Evolution (IWPSE). 73--82.
    [13]
    Cristina V Lopes, Petr Maj, Pedro Martins, Vaibhav Saini, Di Yang, Jakub Zitny, Hitesh Sajnani, and Jan Vitek. 2017. DéjàVu: a map of code duplicates on GitHub. Proceedings of the ACM on Programming Languages 1, OOPSLA (2017), 1--28.
    [14]
    Ali Ouni, Marouane Kessentini, Houari Sahraoui, Katsuro Inoue, and Kalyanmoy Deb. 2016. Multi-criteria code refactoring using search-based software engineering: An industrial case study. TOSEM 25, 3 (2016), 1--53.
    [15]
    Dhavleesh Rattan, Rajesh Bhatia, and Maninder Singh. 2013. Software clone detection: A systematic review. Information and Software Technology 55, 7 (2013), 1165--1199.
    [16]
    Mahnoosh Shahidi, Mehrdad Ashtiani, and Morteza Zakeri-Nasrabadi. 2022. An automated extract method refactoring approach to correct the long method code smell. Journal of Systems and Software (2022), 111221.
    [17]
    Danilo Silva, Ricardo Terra, and Marco Túlio Valente. 2015. Jextract: An eclipse plug-in for recommending automated extract method refactorings. arXiv preprint arXiv:1506.06086 (2015).
    [18]
    Patanamon Thongtanunam, Weiyi Shang, and Ahmed E Hassan. 2019. Will this clone be short-lived? Towards a better understanding of the characteristics of short-lived clones. Empirical Software Engineering 24, 2 (2019), 937--972.
    [19]
    Omkarendra Tiwari and Rushikesh Joshi. 2022. Identifying Extract Method Refactorings. In 15th Innovations in Software Engineering Conference. 1--11.
    [20]
    Alexander Trautsch, Fabian Trautsch, and Steffen Herbold. 2021. MSR Mining Challenge: The SmartSHARK Repository Data. In Proceedings of the International Conference on Mining Software Repositories (MSR 2022).
    [21]
    Nikolaos Tsantalis, Matin Mansouri, Laleh Eshkevari, Davood Mazinanian, and Danny Dig. 2018. Accurate and efficient refactoring detection in commit history. In 2018 IEEE/ACM 40th International Conference on Software Engineering (ICSE). IEEE, 483--494.
    [22]
    David van der Leij, Jasper Binda, Robbert van Dalen, Pieter Vallen, Yaping Luo, and Mauricio Aniche. 2021. Data-driven extract method recommendations: a study at ING. In ACM Joint Meeting on European Software Engineering Conference and Symposium on the Foundations of Software Engineering. 1337--1347.
    [23]
    Norihiro Yoshida, Seiya Numata, Eunjong Choiz, and Katsuro Inoue. 2019. Proactive clone recommendation system for extract method refactoring. In 2019 IEEE/ACM 3rd International Workshop on Refactoring (IWoR). IEEE, 67--70.

    Recommendations

    Comments

    Information & Contributors

    Information

    Published In

    cover image ACM Conferences
    ICSE-Companion '24: Proceedings of the 2024 IEEE/ACM 46th International Conference on Software Engineering: Companion Proceedings
    April 2024
    531 pages
    ISBN:9798400705021
    DOI:10.1145/3639478
    Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than the author(s) must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected].

    Sponsors

    In-Cooperation

    • Faculty of Engineering of University of Porto

    Publisher

    Association for Computing Machinery

    New York, NY, United States

    Publication History

    Published: 23 May 2024

    Check for updates

    Author Tags

    1. refactoring
    2. duplicated code
    3. software quality

    Qualifiers

    • Research-article

    Conference

    ICSE-Companion '24
    Sponsor:

    Acceptance Rates

    Overall Acceptance Rate 276 of 1,856 submissions, 15%

    Upcoming Conference

    ICSE 2025

    Contributors

    Other Metrics

    Bibliometrics & Citations

    Bibliometrics

    Article Metrics

    • 0
      Total Citations
    • 25
      Total Downloads
    • Downloads (Last 12 months)25
    • Downloads (Last 6 weeks)6
    Reflects downloads up to 10 Aug 2024

    Other Metrics

    Citations

    View Options

    Get Access

    Login options

    View options

    PDF

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader

    Media

    Figures

    Other

    Tables

    Share

    Share

    Share this Publication link

    Share on social media