What MOSS misses
MOSS is good at one thing: finding pairs of students whose code shares long runs of tokens. A low MOSS score does not mean a submission is original. This brief shows, on one fixed example, the three kinds of copying a MOSS report cannot see, and what to add so they do not slip through.
2-day free trial. Checks every file against classmates, the web and AI, in 65+ languages.
stats.pystats.pyThe loop and the comparison were rewritten into equivalent forms (highlighted). A fingerprint comparison looks at runs of tokens, and almost every run changed.
How MOSS works
MOSS reads each file as a stream of tokens, so names, comments and whitespace drop out. It hashes short runs of those tokens into fingerprints using winnowing, then reports the pairs of files that share the most fingerprints.
That is why renaming variables does nothing against MOSS. It is also why MOSS has three blind spots:
Rewritten statements
If the token runs change, the fingerprints change, even when the program does exactly the same thing.
Anything outside the batch
MOSS only compares the files you send. The web and last year's class are invisible unless you add them.
AI-written code
Generated code is usually different for every student, so it matches nothing in the batch.
Results that expire
The report page is deleted after 14 days, so the evidence has to be saved by hand.
Rewritten copies
The example above uses four ordinary rewrites, each of which leaves the program's behavior unchanged:
- A counted
forloop becomes an equivalentwhileloop. - A compound assignment like
total += nis expanded intototal = total + n. - A comparison is inverted and negated:
n > mbecomesnot (value <= m). - An indexed value is pulled into its own named variable.
None of these is sophisticated. Together they change almost every run of tokens, so a fingerprint comparison finds little in common. A person reading the two side by side sees the same function immediately.
What catches it: comparing structure at a higher level than token runs, and reading the top pairs yourself. Codequiry's Zeus engine is built for restructured code like this.
Code from outside the batch
Most copied code in a programming course now comes from outside the class: a GitHub repository, a Stack Overflow answer, a tutorial site, a student from last year, or an AI assistant. MOSS cannot look at any of those, so a file copied from one of them scores low unless a classmate copied the same thing.
There is a worked example of exactly that on the MOSS alternative page: a Stack Overflow answer with the names changed, which a batch-only comparison has nothing to match against.
Check what MOSS cannot see
Run the same batch against classmates, past terms, the web and AI.
2-day free trial
What to do about it
You do not need to stop using MOSS. You need to stop treating its report as the whole answer:
- Keep the peer comparison, with the starter code passed as a base file.
- Add a web check against GitHub, Stack Overflow and the web, and include earlier terms.
- Add an AI check, and treat its result as a question for the student, not a verdict.
- Read the top pairs yourself. Look for shared bugs, odd names and dead code, which survive any rewrite.
- Save the evidence before it expires.
Codequiry does steps 1 to 3 in one check and keeps every report. Comparing the free options instead? See MOSS vs Dolos vs JPlag, or read the full guide to detecting code plagiarism.
Frequently asked questions
What is MOSS?
MOSS (Measure of Software Similarity) is a free service from Stanford, written by Alex Aiken in 1994, that compares a batch of programs with each other. It is free for academic use and widely used in programming courses.
How does MOSS detect plagiarism?
It turns each file into a stream of tokens, hashes short runs of tokens into fingerprints with an algorithm called winnowing, and reports pairs of files that share many fingerprints. Names, comments and whitespace do not affect it.
What does MOSS miss?
Copies whose statements were rewritten into equivalent forms, code copied from the web that no classmate also used, code written by AI, and anything from earlier terms you did not add to the batch yourself.
Does a low MOSS score mean a submission is original?
No. It means the file shares few token runs with the other files in the batch. The code can still be copied from outside the batch, rewritten from a classmate's work, or AI-written.
What languages does MOSS support?
About 25, including C, C++, Java, C#, Python, JavaScript, MATLAB, Perl, Haskell, Lisp, Scheme, Pascal, Ada, Verilog, VHDL and MIPS assembly.
Should I stop using MOSS?
Not necessarily. It is a good peer comparison. Just do not treat it as the whole check: add a web check and an AI check, and read the top pairs yourself.
See what your last MOSS batch missed
Upload the same files and check them against classmates, past terms, the web and AI.
Start free trial2-day free trial
Just one assignment? Run a single check