Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Detect duplicated programs

 
Sitrarasu Jayaraman
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I need to develop an application which should get 2 java source code files (ex : file1.java , file2.java) as input and tell whether the 2 files are copied from one another..

this project is for my department, they want to find who are all copying when a programming assignment is given to them.

the copier should not escape if he just adds extra comments, change the variable names, change the position of some codes ex: writing main() at last or at the beginning etc..

i am looking for a best algorithm to solve this problem..

please help me by your valuable suggestions.. Any help in this regard is greatly appreciated. please post whatever idea comes to your mind..

Thanks for your help.
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
the copier should not escape if he just adds extra comments, change the variable names, change the position of some codes ex: writing main() at last or at the beginning etc..

When is it going to fail then ??
 
Campbell Ritchie
Sheriff
Posts: 48910
58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Such applications are already available; we use one here at Teesside. Would you like me to find out what it's called?
 
Sitrarasu Jayaraman
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
@Christophe Verré

The condition will fail if they the logic used is different, or the coding style is different.

It should report if someone exactly replicates the logic but changes the variable names and add extra space and comments to escape from the fast inspection nature of the human(i.e the staff members)

And i believe if someone can change the programming constructs altogether, then he need not be considered as a copier. because the assignment is aimed at checking his/her programming ability, so when he can change the constructs used in the program altogether then that should be fine..
ex:


Note: it would be fine if our application could detect the similar flow like the following, i.e just changing the looping construct but rest of them remains the same.
ex:


 
Sitrarasu Jayaraman
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
@Campbell Ritchie,

That would be helpful to me, if you could do that..

looking forward to your help.

Thanks.
 
Leonardo Shikida
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
try google "java code plagiarism analysis"

there are several tools/tecniques

TIA

Leo K.
 
Campbell Ritchie
Sheriff
Posts: 48910
58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So sorry; I forgot to ask. I went round today, and haven't yet found anybody who knows. I shall try to remember to ask again next week.
 
Campbell Ritchie
Sheriff
Posts: 48910
58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It is called Turnitin.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic