TY - GEN
T1 - AntiCopyPaster
T2 - 37th IEEE/ACM International Conference on Automated Software Engineering, ASE 2022
AU - Alomar, Eman Abdullah
AU - Ivanov, Anton
AU - Kurbatova, Zarina
AU - Golubev, Yaroslav
AU - Mkaouer, Mohamed Wiem
AU - Ouni, Ali
AU - Bryksin, Timofey
AU - Nguyen, Le
AU - Kini, Amit
AU - Thakur, Aditya
N1 - Publisher Copyright:
© 2022 ACM.
PY - 2022/9/19
Y1 - 2022/9/19
N2 - We developed a plugin for IntelliJ IDEA called AntiCopyPaster, which tracks the pasting of code fragments inside the IDE and suggests the appropriate Extract Method refactoring to combat the propagation of duplicates. Unlike the existing approaches, our tool is integrated with the developer's workflow, and pro-actively recommends refactorings. Since not all code fragments need to be extracted, we develop a classification model to make this decision. When a developer copies and pastes a code fragment, the plugin searches for duplicates in the currently opened file, waits for a short period of time to allow the developer to edit the code, and finally inferences the refactoring decision based on a number of features. Our experimental study on a large dataset of 18,942 code fragments mined from 13 Apache projects shows that AntiCopyPaster correctly recommends Extract Method refactorings with an F-score of 0.82. Furthermore, our survey of 59 developers reflects their satisfaction with the developed plugin's operation. The plugin and its source code are publicly available on GitHub at https://github.com/JetBrains-Research/anti-copy-paster. The demonstration video can be found on YouTube: https://youtu.be/-wwHg-qFjJY.
AB - We developed a plugin for IntelliJ IDEA called AntiCopyPaster, which tracks the pasting of code fragments inside the IDE and suggests the appropriate Extract Method refactoring to combat the propagation of duplicates. Unlike the existing approaches, our tool is integrated with the developer's workflow, and pro-actively recommends refactorings. Since not all code fragments need to be extracted, we develop a classification model to make this decision. When a developer copies and pastes a code fragment, the plugin searches for duplicates in the currently opened file, waits for a short period of time to allow the developer to edit the code, and finally inferences the refactoring decision based on a number of features. Our experimental study on a large dataset of 18,942 code fragments mined from 13 Apache projects shows that AntiCopyPaster correctly recommends Extract Method refactorings with an F-score of 0.82. Furthermore, our survey of 59 developers reflects their satisfaction with the developed plugin's operation. The plugin and its source code are publicly available on GitHub at https://github.com/JetBrains-Research/anti-copy-paster. The demonstration video can be found on YouTube: https://youtu.be/-wwHg-qFjJY.
KW - machine learning
KW - refactoring
KW - software quality
UR - http://www.scopus.com/inward/record.url?scp=85136277619&partnerID=8YFLogxK
UR - http://www.scopus.com/inward/citedby.url?scp=85136277619&partnerID=8YFLogxK
U2 - 10.1145/3551349.3559537
DO - 10.1145/3551349.3559537
M3 - Conference contribution
AN - SCOPUS:85136277619
T3 - ACM International Conference Proceeding Series
BT - 37th IEEE/ACM International Conference on Automated Software Engineering, ASE 2022
A2 - Aehnelt, Mario
A2 - Kirste, Thomas
Y2 - 10 October 2022 through 14 October 2022
ER -