MOSS (Measure of Software Similarity) compares source code to find passages that resemble code in other submissions or reference files.

Its results can help reviewers identify work that deserves closer inspection, but a match score alone does not establish who wrote the code or whether misconduct occurred.

What is MOSS?

MOSS is a code similarity detection system developed by Alex Aiken and collaborators at Stanford.

It has been used in programming courses to help instructors locate similar code across sets of programs.

It is designed for comparing source code, rather than classifying whether a person or an AI system authored it.

That distinction matters because code similarity and AI authorship detection address different questions.

A similarity tool asks how much selected code resembles other code in a comparison set.

An AI detector attempts to infer whether text or code was generated by an AI model.

A similarity result cannot, by itself, answer the authorship question.

How does MOSS detect code similarity?

MOSS compares submitted programs and produces a report identifying pairs with similar code. It highlights matching passages so a reviewer can examine them side by side.

The report points to overlap worth investigating; it does not establish why that overlap exists.

Assignments often include code that students are expected to share. MOSS can exclude matches to supplied common material, such as libraries or instructor-provided code.

That exclusion depends on how the comparison is prepared. Reviewers still need to distinguish required shared material from unexplained similarities. See Stanford’s MOSS overview for the service’s scope and limitations.

After processing, MOSS presents matches for a reviewer to inspect.

The report can help narrow attention to corresponding portions of files, but it does not explain why those portions are alike.

A human reviewer must consider the assignment, permitted collaboration, starter code, shared examples, and other relevant context.

What does a MOSS similarity score mean?

A similarity score summarizes the amount of matching material that the system identified under its comparison process.

It is a signal for review, not a probability that a student copied, a verdict of plagiarism, or proof that two programs have the same author.

Two legitimate solutions to a constrained problem may share algorithmic steps or required scaffolding.

Conversely, copied code may be altered enough that a simple comparison does not show the full relationship.

The score must be read alongside the matching passages and the circumstances of the work.

  • High similarity: Review the overlapping passages and check whether the assignment or supplied code explains them.
  • Low similarity: Do not treat it as proof that no copying occurred; the programs may have been transformed or may not be comparable in the selected dataset.
  • Unusual matches: Look for distinctive shared choices, errors, comments, or structure, while checking whether these came from common materials.

Can MOSS detect renamed variables or changed formatting?

Formatting changes and superficial edits do not necessarily remove similarity.

Code comparison systems can focus on program elements and sequences rather than relying only on whitespace or exact line matches.

Renaming identifiers, rearranging statements, or making small edits may change a report, but those changes do not guarantee that related code will become dissimilar.

At the same time, no similarity report should be treated as a complete account of a program’s history.

Different implementations can solve the same task in similar ways, and extensive transformations can make relationships harder to assess automatically.

MOSS helps surface potential overlap; it is not a substitute for examining the actual code.

What are MOSS’s limitations?

Results depend on what files are compared, which reference materials are included, and how common or assignment-specific code is handled.

If a relevant program is absent from the comparison set, MOSS cannot match against it.

If starter code or shared examples are not accounted for, their overlap can complicate interpretation.

Similarity also does not establish intent, chronology, permission, or direction of copying.

Two students may have collaborated in an allowed way, used the same public example, or independently followed a conventional solution.

Policies and review procedures vary by institution, so a report should be considered under the rules that applied to the assignment.

Is MOSS an AI code detector?

No.

MOSS is a source-code similarity system, not an AI authorship classifier.

It compares code with other code available in a particular review.

It does not determine from a similarity score whether a person, a code-generation model, or a combination of sources produced a program.

AI writing detection is also distinct from code similarity analysis.

Turnitin says its AI writing model does not reliably detect code, so its writing report should not be confused with a source-code comparison tool.

A detector’s label or score should not be presented as proof of authorship or misconduct.

How should instructors interpret a MOSS report?

A careful review starts with the matched passages rather than the headline score.

The reviewer can compare the programs, identify overlap in supplied or standard material, consult the assignment instructions, and give the students an opportunity to explain their process where the applicable policy calls for it.

Any decision should follow the institution’s established procedures.

For students, a similarity flag is not itself a finding.

Keep drafts, version history, notes, and source citations where appropriate, and follow the assignment’s collaboration and tool-use rules.

If asked about a match, explain how the work was developed and identify any shared resources honestly.

How does MOSS compare with other code similarity tools?

Different systems may compare files using different preprocessing, matching methods, reference sets, and reporting formats.

A result from one tool is not directly interchangeable with a result from another, and a tool’s presence on a website does not establish independent validation or suitability for a particular academic decision.

Codespy is an external source-code similarity detector that may be relevant when someone is looking for a code comparison service.

Treat any result as an investigative aid, review its stated scope and data handling, and avoid interpreting its output as an authorship verdict.

This article does not report a hands-on test or endorse a specific product.