Readable source code should contain a relatively small amount of latent bugs and should be easy to maintain. However, it is difficult for a teacher to teach all students to write code in accordance with a certain coding style because each of them naturally has his/her own different coding styles, and the teacher needs to advise them considering their original coding styles. To deal with this issue, the CM algorithm is introduced, which was originally developed to detect source code plagiarism in Java programming classes. It quantifies a student's coding style feature by using a set of hidden Markov models called coding models. Coding models quantify a person's code writing style as that person's coding style feature. In this paper, an attempt to apply the CM algorithm for facilitating coding style instruction is reported. Experimental results showed that the coding models provided information that was useful for teaching coding styles.
展开▼