Click here to Skip to main content
15,892,697 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello,

My final year project is to develop a java application which should get the two java programs as input and tell us if the programs are copied or not.
The copiers should not be able to cheat if they just change the variable names.
The copiers should not be able to cheat if they add just spaces in between the code lines or inside the code line.

Your help is greatly appreciated..
Posted
Comments
Richard MacCutchan 12-Jan-11 11:27am    
Dave has suggested a good answer, but are you looking to compare two versions of the source code or two versions of the compiled class?
Аslam Iqbal 12-Jan-11 14:36pm    
"if the programs are copied or not">> What is programs? is that bytecode(.java file) or binary(object or class file)?
sitrarasu 13-Jan-11 10:56am    
The program here is .java files only.
for example:
x has written a program(a class assignment) and submitted, obviously its a .java file, and y also submits an assignment. now when these two files are given to our application it should tell whether someone have copied from the other person or not.
sitrarasu 13-Jan-11 11:02am    
@Richard MacCutchan:
The input can be tailored to anything, there is no restriction as to we should compare the source code or only the compiled class.
If the solution can be found easily when it is done with compiled class then well and good. or if the solution is easy by comparing the source code then also i am double happy..

what method do you suggest?

1 solution

Instead of looking at the source code, compile them and look at the resulting bytecode.
 
Share this answer
 
Comments
sitrarasu 13-Jan-11 11:21am    
@dave:
can you give me some link where i can learn how to compare the byte codes, because comparing the source is easy as i have done it before using pattern matching, but with byte codes this is the first time for me., kindly help me.
Dave Kreskowiak 13-Jan-11 19:23pm    
Do you want this on a silver platter too? http://www.ibm.com/developerworks/ibm/library/it-haggar_bytecode/

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900