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


Cite item

Full Text

Open Access Open Access
Restricted Access Access granted
Restricted Access Subscription Access

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.

About the authors

G. Sidorov

Instituto Politécnico Nacional (IPN)

Author for correspondence.
Email: sidorov@cic.ipn.mx
Mexico, Mexico City

M. Ibarra Romero

Instituto Politécnico Nacional (IPN)

Email: francisco.castillo@upq.mx
Mexico, Mexico City

I. Markov

Instituto Politécnico Nacional (IPN)

Author for correspondence.
Email: markovilya@yahoo.com
Mexico, Mexico City

R. Guzman-Cabrera

Engineering Division

Author for correspondence.
Email: guzmanc81@gmail.com
Mexico, Guanajuato

L. Chanona-Hernández

Instituto Politécnico Nacional

Author for correspondence.
Email: lchanona@gmail.com
Mexico, Mexico City

F. Velásquez

Polytechnic University of Queretaro

Author for correspondence.
Email: francisco.castillo@upq.mx
Mexico, Queretaro

Supplementary files

Supplementary Files
Action
1. JATS XML

Copyright (c) 2017 Pleiades Publishing, Ltd.