Measuring similarity between Karel programs using character and word n-grams

Abstract

We present a method for measuring similarity between source codes. We approach this task from the machine learning perspective using character and word n-grams as features and examining different machine learning algorithms. Furthermore, we explore the contribution of the latent semantic analysis in this task. We developed a corpus in order to evaluate the proposed approach. The corpus consists of around 10,000 source codes written in the Karel programming language to solve 100 different tasks. The results show that the highest classification accuracy is achieved when using Support Vector Machines classifier, applying the latent semantic analysis, and selecting as features trigrams of words.

DOI: 10.1134/S0361768817010066

Cite this paper

@article{Sidorov2017MeasuringSB, title={Measuring similarity between Karel programs using character and word n-grams}, author={Grigori Sidorov and Mart{\'i}n Ibarra Romero and Ilia Markov and Rafael Guzm{\'a}n-Cabrera and Liliana Chanona-Hern{\'a}ndez and Francisco Velasquez}, journal={Programming and Computer Software}, year={2017}, volume={43}, pages={47-50} }