Leveraging Compiler Optimization for Code Clone Detection
Shirish Singh · Proceedings/Proceedings of the ... International Conference on Software Engineering and Knowledge Engineering · 2021
Finding similar code in software systems can guide several software engineering tasks such as code maintenance, program understanding, and code reuse.Similar code detection has been actively studied in the past.In the paper, we propose a novel approach that leverages compiler optimizations to transform semantically similar code and detect similar programs.The key observation of our work is that the compiler optimizations can be used to smooth out source code level idiosyncrasies introduced by the developers, thus making the optimized programs, for the same task, similar in structure.The similarity in structure can then be used to classify the programs.We conducted experiments on the Google CodeJam dataset to demonstrate the effectiveness of our approach.The experimental results show that our technique can achieve up to 85% accuracy on the program classification task, which is an improvement of more than 25% over the source code level classification.