The paper presents a hybrid method for detecting source-code plagiarism in computer programming courses. For many programming courses, the students’ assignments are in the form of electronic source files and it is difficult for the teacher to manually detect the plagiarisms among the assignments. Our system can compare two source files automatically and help to solve this problem. The principle of the system is summarized: Firstly, the source files are processed with intension of filtering the noise elements such as header file include statements, comments, input/output statements and string literals. Secondly, a feature-based detection component is proposed. For each source file, a feature vector is generated which include physic metrics such as the number of source lines and the number of total words, Halstead metrics such as the statistics of source code operators, execution flows and operands. Then the distance between two feature vectors is computed which is considered as the similarity between the corresponding source files. Thirdly, a structure-based detection component is proposed. For each source file, the source code is transformed into a sequence of well-defined tokens. Then to improve the computational efficiency each token is transformed into a single character using a mapping table. The LCS (Longest Common Subsequence) is computed for each two strings, which is considered as the similarity between the corresponding source files. Lastly, an integration component is proposed which uses a two-stage strategy to combine the above two separate components into one complete system. Experimental results show that our system can effectively spot the suspect program copies, even when they have some kind of minor modifications.
[1]
Hal Berghel,et al.
Measurements of program similarity in identical task environments
,
1984,
SIGP.
[2]
Maurice H. Halstead,et al.
Elements of software science (Operating and programming systems series)
,
1977
.
[3]
S. K. Robinson,et al.
An empirical approach for detecting program similarity and plagiarism within a university programming environment
,
1987
.
[4]
Ann-Marie Lancaster,et al.
A plagiarism detection system
,
1981,
SIGCSE '81.
[5]
Michael J. Wise.
Detection of similarities in student programs: YAP'ing may be preferable to plague'ing
,
1992,
SIGCSE '92.
[6]
Lutz Prechelt,et al.
JPlag: Finding plagiarisms among a set of programs
,
2000
.
[7]
Michael J. Wise,et al.
Software for detecting suspected plagiarism: comparing structure and attribute-counting systems
,
1996,
ACSE '96.
[8]
K. J. Ottenstein.
An algorithmic approach to the detection and prevention of plagiarism
,
1976,
SGCS.