<p>Take a look at MOSS from Stanford (<a href="https://theory.stanford.edu/%7Eaiken/moss" rel="nofollow noreferrer">https://theory.stanford.edu/~aiken/moss</a>). It is an easy to use free web service that compares files and reports similarities. You set up a free account and submit a request and what is returned is a URL to a report showing the similarities of various files.</p>
<p>I have found that the easiest way to do this is to submit a .tar file structured at the first level as a series of sub directories, each identifying a single student (name, studentID, etc). Beneath each student directory are the file(s) they have submitted. These commonly have exactly the same names as the assignment typically specifies the class names of the Java classes.</p>
<p>For small assignments, you will get a high correlation between students as there is only so much variation possible, but you can look at the &quot;most similar&quot; and get a good feel for whether cheating is likely to have taken place. Depending on how the students actually submit their programs, it may be easy to write a script that automates the process. I'm happy to share details with anyone</p>

CC BY-SA 4.0
2020-11-20T16:46:54.987Z
2020-11-20T21:45:51.963Z
2020-11-20T21:45:51.963Z
Fritz Sieker
<p>The pandemics has incredibly increased the number of cheating cases. Do you know of any script (bash or other scripting language) for checking a bunch of Java code submissions for similarity? I know I could use <code>diff</code>, but it would be hard to detect similarity.</p>

CC BY-SA 4.0
2020-11-20T16:37:56.420Z
Let me give a warning about such things, as I've done on another site. Any cheating detection system, automated or not, needs to have the property that it produces zero false positives. But it isn't well understood that a system permitting no false positives will almost invariably produce some false negatives. But the consequences of error in a cheating detection system are so asymmetrical that such a rule is required. So, to use such a script, if it exists, you need additional measures as well to assure fair treatment.
Buffy
CC BY-SA 4.0
2020-11-22T22:55:05.427Z
If your question is different from the one indicated in the closed message, please edit the question to make the difference clearer and it can be reopened.
Ben I.
<programming><java><cheating>
Cheating detection script
# Cheating detection script

(Asked by: username_0 on 2020-11-20)

The pandemics has incredibly increased the number of cheating cases. Do you know of any script (bash or other scripting language) for checking a bunch of Java code submissions for similarity? I know I could use `diff`, but it would be hard to detect similarity.

**Tags:** programming, java, cheating

> **Comments:**
> **username_1**: Let me give a warning about such things, as I've done on another site. Any cheating detection system, automated or not, needs to have the property that it produces zero false positives. But it isn't well understood that a system permitting no false positives will almost invariably produce some false negatives. But the consequences of error in a cheating detection system are so asymmetrical that such a rule is required. So, to use such a script, if it exists, you need additional measures as well to assure fair treatment.  
> **username_2**: If your question is different from the one indicated in the closed message, please edit the question to make the difference clearer and it can be reopened.  

---

## 1 answers

### Answer by username_3 on 2020-11-20. Score: 3

Take a look at MOSS from Stanford ([https://theory.stanford.edu/~aiken/moss](https://theory.stanford.edu/%7Eaiken/moss)). It is an easy to use free web service that compares files and reports similarities. You set up a free account and submit a request and what is returned is a URL to a report showing the similarities of various files.

I have found that the easiest way to do this is to submit a .tar file structured at the first level as a series of sub directories, each identifying a single student (name, studentID, etc). Beneath each student directory are the file(s) they have submitted. These commonly have exactly the same names as the assignment typically specifies the class names of the Java classes.

For small assignments, you will get a high correlation between students as there is only so much variation possible, but you can look at the "most similar" and get a good feel for whether cheating is likely to have taken place. Depending on how the students actually submit their programs, it may be easy to write a script that automates the process. I'm happy to share details with anyone


---

