Checking student code for plagiarism means looking for evidence that a submission improperly reuses code from another source, while accounting for legitimate similarities such as shared assignments and standard programming patterns.
The important work happens after a match appears: context, process, and institutional rules determine what it means.
What does a code plagiarism check look for?
Source-code similarity tools compare programs for overlapping structure or text.
Depending on the tool, this may include matching lines, renamed identifiers, reordered fragments, or related program structures.
A report can help an instructor locate passages worth reviewing, but it does not establish who wrote them or whether copying occurred.
Programming naturally produces similarities.
Students may use the same starter files, libraries, syntax, algorithms taught in class, or examples from documentation.
Short solutions to narrowly defined problems can also resemble one another without collaboration.
Conversely, meaningful reuse may be obscured by changes to names, formatting, comments, or statement order.
Similarity is a lead for review, not a verdict.
How to check student code for plagiarism
- Check the course rules first. Review the assignment instructions and applicable academic-integrity policy.
Confirm what collaboration, external resources, generated code, and citation practices are permitted.
Requirements vary across institutions and assignments. - Collect comparable files. Use the submitted source files and, where authorized, relevant reference material or submissions from the same assignment.
Keep starter code and instructor-provided scaffolding in view, since shared material can create expected matches. - Choose a source-code similarity tool. Select a tool intended to compare code rather than a general text or AI-writing classifier.
For example, Codespy is an external source-code detector that may be considered for this purpose.
Review its current documentation, data handling terms, supported languages, and workflow before submitting student work.
Do not assume a product’s capabilities or results without checking its own materials. - Run comparisons with suitable settings. Follow the tool’s guidance for file formats, language selection, and excluded material.
Excluding common starter files or generated files can make a report easier to interpret, when the tool supports those options.
Retain the original files so the comparison can be checked against the actual submissions. - Inspect the flagged passages manually. Compare the code’s logic, sequence, unusual choices, errors, comments, and surrounding context.
A common function or required algorithm carries less weight than a distinctive sequence of decisions or identical uncommon mistakes, but neither pattern alone proves misconduct. - Seek an explanation through the proper process. If the evidence raises a concern, follow the institution’s procedures and give the student an appropriate opportunity to explain their work.
Avoid treating a score or automated label as a finding of guilt.
How should you interpret a similarity report?
Read the matched code, not just the overall percentage or ranking.
Determine whether overlap comes from required scaffolding, standard library calls, a common solution path, or a distinctive section that is difficult to explain by the assignment constraints.
Check whether the compared files are actually comparable: submissions from different prompts, versions, or languages can produce misleading results.
Consider alternative explanations and corroborating information.
A student’s drafts, version history, notes, cited sources, and explanation of design choices may help clarify how the solution was developed, subject to school policy and privacy rules.
These materials should be considered consistently and fairly.
Do not infer misconduct from a single indicator or demand access to personal accounts outside the approved process.
Code similarity is different from AI detection
AI authorship classifiers estimate whether text may have been produced by a generative system.
Source-code similarity tools compare code against other code.
These are different tasks, and a result from one cannot substitute for the other.
A code match does not establish AI use, and an AI-writing score does not show that a student copied source code.
Turnitin states that its AI writing model does not reliably detect code.
Its AI writing report should not be confused with source-code similarity checking.
If the question concerns reused code, use a process designed for code comparison and interpret its evidence in context.
More generally, detection scores are not proof of authorship or misconduct.
Common mistakes to avoid
- Treating a percentage as a decision. Similarity scores depend on what was compared and what the system counts.
Review the actual matches and the assignment context. - Assuming renamed code is original. Renaming variables or changing formatting may leave underlying similarities, but a transformed solution still needs careful, case-specific review.
- Ignoring shared materials. Starter code, templates, required examples, and standard patterns can inflate apparent overlap.
- Using an AI detector for a code-copying question. Match the method to the concern: code comparison for code similarity, handled under the relevant policy.
- Uploading student work without checking data practices. Code can contain names, credentials, or other sensitive information.
Follow institutional rules and review a vendor’s handling terms before using an external service.
What makes a fair review?
A fair review uses the same standards for comparable cases, preserves the submitted files and relevant report details, and separates observable evidence from interpretation.
Record which files were compared, what material was excluded, and why particular matches merit attention.
Limit access to student work and follow local retention and privacy requirements.
Most importantly, communicate the concern in specific terms.
Point to the passages or patterns that need explanation, describe the applicable course rule, and allow the student to respond through the established process.
The tool can help focus that review; the decision belongs to the people and procedures responsible for applying the policy.