@inproceedings{01f0e6cfffdb46c59cb7d9abf302ddba,
title = "Clone-based and interactive recommendation for modifying pasted code",
abstract = "Developers often need to modify pasted code when programming with copy-and-paste practice. Some modifications on pasted code could involve lots of editing efforts, and any missing or wrong edit could incur bugs. In this paper, we propose a clone-based and interactive approach to recommending where and how to modify the pasted code. In our approach, we regard clones of the pasted code as the results of historical copy-and-paste operations and their differences as historical modifications on the same piece of code. Our approach first retrieves clones of the pasted code from a clone repository and detects syntactically complete differences among them. Then our approach transfers each clone difference into a modification slot on the pasted code, suggests options for each slot, and further mines modifying regulations from the clone differences. Based on the mined modifying regulations, our approach dynamically updates the suggested options and their ranking in each slot according to developer's modifications on the pasted code. We implement a proof-of-concept tool CCDemon based on our approach and evaluate its effectiveness based on code clones detected from five open source projects. The results show that our approach can identify 96.9% of the to-be-modified positions in pasted code and suggest 75.0% of the required modifications. Our human study further confirms that CCDemon can help developers to accomplish their modifications of pasted code more efficiently.",
keywords = "Code clone, Copy and paste, Differencing, Recommendation, Reuse",
author = "Yun Lin and Xin Peng and Zhenchang Xing and Diwen Zheng and Wenyun Zhao",
note = "Publisher Copyright: {\textcopyright} 2015 ACM.; 10th Joint Meeting of the European Software Engineering Conference and the ACM SIGSOFT Symposium on the Foundations of Software Engineering, ESEC/FSE 2015 ; Conference date: 30-08-2015 Through 04-09-2015",
year = "2015",
month = aug,
day = "30",
doi = "10.1145/2786805.2786871",
language = "English",
series = "2015 10th Joint Meeting of the European Software Engineering Conference and the ACM SIGSOFT Symposium on the Foundations of Software Engineering, ESEC/FSE 2015 - Proceedings",
publisher = "Association for Computing Machinery (ACM)",
pages = "520--531",
booktitle = "2015 10th Joint Meeting of the European Software Engineering Conference and the ACM SIGSOFT Symposium on the Foundations of Software Engineering, ESEC/FSE 2015 - Proceedings",
address = "United States",
}