Our Proof of Concept (CReN) Design and Implementation (5 of 5)
Refining the inferred rules
When the code is initially pasted, the inferred rule assumes that all identifiers that would resolve to the same program entity should be renamed consistently
Programmer can choose to exclude the currently renamed identifier from the group (this instance is deleted from the vector)
The updated rule is inferred across all clones
Let’s see if CReN can detect/prevent errors...
Our Proof of Concept (CReN) Usage and Demonstration
Three examples from literature show an inconsistent renaming of identifiers within a copy-and-pasted clone in production code
Z. Li, S. Lu, S. Myagmar, and Y. Zhou, “CP-Miner: A Tool for Finding Copy-paste and Related Bugs in Operating System Code”, USENIX-ACM SIGOPS Symposium on Operating Systems Design and Implementation (OSDI) , 2004.
B. Liblit, A. Aiken, A.X. Zheng, and M.I. Jordan, “Bug Isolation via Remote Program Sampling”, ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI) , 2003.
L. Jiang, Z. Su, and E. Chiu, “Context-Based Detection of Clone-Related Bugs”, European Software Engineering Conference (ESEC) and ACM SIGSOFT International Symposium on the Foundations of Software Engineering (FSE) , 2007.