The short answer: yes, it’s happening a lot, and your current code plagiarism checker probably isn’t catching it. In a controlled study of 5,000 anonymized student submissions from introductory Java courses at three US universities in Fall 2023, we found that 23.1% of assignments contained code blocks directly traceable to Stack Overflow answers. Only 12% of those blocks also appeared in at least one other submission in the same class—meaning traditional peer-comparison tools like MOSS and JPlag flagged fewer than one in eight. The rest were invisible without a web-source check.

The Hidden Problem of Web-Sourced Code
Every programming instructor knows that students turn to Stack Overflow. The line between legitimate research and plagiarism, however, is blurry when the source is the open web rather than a classmate’s file. A student who copies a 15‑line block from a 2015 answer about reading CSV files, renames the variables, and integrates it into a larger project has, in a strict sense, plagiarized code they did not write. But the act is harder to catch because the other submissions in the course may look nothing like it. Peer‑only comparison tools rely on seeing the same unusual pattern in at least two students’ work. When only one student in a section stumbles upon that particular answer, the copied block vanishes into the noise.
“Only 12% of the web‑sourced blocks were flagged by traditional similarity checkers because the other copies in the class corpus were too few to trigger cross‑submission similarity alerts.”
This gap is structural. MOSS, JPlag, and Dolos build a similarity matrix across a closed set of submissions. They have no knowledge of the outside web, Stack Overflow, GitHub gists, tutorial sites, or even the university’s own sample code repositories unless those appear inside the submission set. To make the problem concrete, we set out to measure exactly how much code slips through.
Methodology: From Submissions to Source Fingerprints
We worked with three computer science departments — University of California, Irvine; Purdue University; and Georgia Tech — to obtain anonymized, IRB‑approved copies of 5,000 final project submissions from introductory Java courses. The assignments ranged from console‑based games to small data‑processing pipelines. No student identifiers were included; we saw only the raw .java files.
We began by building a web‑source index. Using a crawl of Stack Overflow posts tagged [java] and filtered to answers with code blocks, plus a curated set of Java tutorial sites (Jenkov, Baeldung, GeeksforGeeks, and official Oracle tutorials), we collected 1.2 million unique code snippets. Each snippet was transformed into a normalized token fingerprint:
- Lexing into Java tokens (keywords, identifiers, operators, literals).
- Normalization: all user‑defined identifiers were replaced with a common placeholder (
ID), strings and numeric literals replaced bySTR/NUM, and comments removed. - Extraction of overlapping n‑grams of length 10 tokens from the normalized sequence.
- Storage of these n‑gram signatures in a Bloom‑filter‑backed index for O(1) lookup.
The same pipeline was applied to each student submission. When a submission’s fingerprint n‑gram matched one in the web index, we recorded the best‑match snippet, the submission file, and the exact line range. To cut down on false positives from boilerplate (e.g., Scanner scanner = new Scanner(System.in);), we excluded n‑grams that appeared in more than 5% of all web snippets or that matched known Java‑idiom patterns curated from the JDK examples. After filtering, the false‑positive rate on a held‑out validation set of 200 hand‑checked student assignments was 2.1%.
What We Found: 23% Contained Stack Overflow Blocks
Across all 5,000 submissions, 1,155 exhibited at least one fingerprint‑matched block longer than 50 normalized tokens (roughly 8–15 lines of actual code). Breaking that down:
| Web Source | Matched Submissions | % of Total |
|---|---|---|
| Stack Overflow answers | 1,068 | 21.4% |
| Java tutorial sites | 187 | 3.7% |
| GitHub public gists | 132 | 2.6% |
| Any web source | 1,155 | 23.1% |
Several submissions matched multiple sources. The average length of a matched block was 137 normalized tokens, or about 22 lines of original source code. In 41% of cases, the copied block constituted more than half the logic of the student’s submitted method.

Notably, only 138 of those 1,155 submissions — 11.9% — also appeared as a high‑similarity pair when we ran a standard MOSS scan against the full submission corpus. The remaining 1,017 cases were invisible to peer‑only analysis. Even when we loosened the MOSS threshold to flag any pair with a similarity index above 20% (which produces a mountain of false positives), only another 211 web‑copied cases surfaced, still leaving 70% undetected.
Why Traditional Tools Miss Web Plagiarism
Tools like MOSS, JPlag, and Dolos operate on a single, closed set of submissions. They compute a similarity score for every pair of documents, then highlight the most similar clusters. This approach is powerful for catching collusion between students, but it breaks down when the plagiarized source sits outside the corpus. A student who copies a Stack Overflow answer that no classmate uses generates no suspicious pair. The submission looks original to the tool.
Turnitin offers some web source checking, but it is optimized for prose, not code. The heavily‑formatted, token‑dense structure of source code causes Turnitin’s text‑matching engine to miss many blocks or to flag them as low‑confidence matches after the system strips out braces and operators. Moreover, Turnitin lacks AST‑aware normalization, so a simple variable rename can throw it off entirely.
Codequiry’s approach, by contrast, was built from the ground up for source code. It combines peer‑to‑peer similarity (token and AST comparison) with a constantly‑updated web‑source index that covers Stack Overflow, GitHub repositories, open‑source tutorial sites, and more. The fingerprinting engine normalizes code the same way across both channels, so a copied block that was refactored or renamed still matches the web original. And because the pipeline is unified, instructors don’t have to run one tool for collusion and a separate tool for web plagiarism.
Fingerprinting: How It Survives Variable Renaming
The key to web‑code detection is normalizing away everything a student can cheaply change. Consider this real Stack Overflow snippet and a hypothetical student submission side by side:
Original Stack Overflow Answer (Snippet 482‑A)
public static List<String> readLines(String filename) {
List<String> lines = new ArrayList<>();
try (BufferedReader br = new BufferedReader(new FileReader(filename))) {
String line;
while ((line = br.readLine()) != null) {
lines.add(line.trim());
}
} catch (IOException e) {
e.printStackTrace();
}
return lines;
}
Student Submission (renamed variables, reformatted)
public static List<String> loadFileContents(String fileNameInput) {
List<String> resultList = new ArrayList<>();
try {
BufferedReader fileReader = new BufferedReader(new FileReader(fileNameInput));
String currentLine;
while ((currentLine = fileReader.readLine()) != null) {
resultList.add(currentLine.strip());
}
} catch (IOException ex) {
System.err.println(ex.getMessage());
}
return resultList;
}
To a text‑diff tool, the similarity is low: different variable names, different exception handling, and a method name change. The normalized token fingerprint, however, collapses both into nearly identical sequences:
public static ID<ID> ID ( ID ) { ID <ID> = new ID ( ) ; try ( ID = new ID ( new ID ( ID ) ) ) { ID ; while ( ( ID = ID . ID ( ) ) != null ) { ID . ID ( ID . ID ( ) ) ; } } catch ( ID ) { ID . ID ( ) ; } return ID ; }
The only difference in the normalized form is that the student added System.err.println instead of e.printStackTrace(), which introduces a short divergent n‑gram. The surrounding structure, however, produces dozens of matching 10‑token sequences — far beyond any coincidence threshold. That’s how a fingerprinting engine flags the web source with high confidence even after superficial changes.
Tool Comparison: Peer vs. Web Detection
| Tool | Peer Similarity | Web Source Matching | AST‑level | Survives Renaming | CLI / API |
|---|---|---|---|---|---|
| MOSS | Yes | No | Partial (token winnowing) | Yes (with noise) | CLI only (perl script) |
| JPlag | Yes | No | Yes (full AST) | Yes | CLI / web UI |
| Dolos | Yes | No | No (token‑only) | Yes | CLI / web UI |
| Turnitin (Code) | Weak | Limited (prose‑tuned) | No | No | LMS integration |
| Codequiry | Yes | Yes (Stack Overflow, GitHub, tutorials) | Yes (AST + token hybrid) | Yes | Web dashboard, REST API, CLI |
For the 1,155 web‑copied submissions in our study, MOSS flagged 138, JPlag flagged 151 (slightly higher recall due to AST, but still only 13%). Codequiry’s integrated web‑source check, run against the same submission set, flagged 1,069 of the 1,155, with a false‑positive rate of 2.3% after boilerplate filtering. The 86 missed cases were almost entirely trivial one‑liners (e.g., a static Collections.sort call that matched a snippet but was arguably not plagiarised).

Implications for CS Academic Integrity
The numbers make a clear case: any academic‑integrity strategy that ignores web sources is leaving a 23%‑sized hole in the side of the boat. Teaching students proper attribution is essential, but it is equally important to have detection infrastructure that matches the reality of how students actually code today. The traditional “I’ll run MOSS on the assignment” workflow catches collusion rings and egregious copy‑paste between friends, but it does nothing about the lone student who assembles an entire project from Stack Overflow answers and changes a few names.
One obvious objection is that some use of web code falls under fair academic practice — and that’s true. A student who reads a Stack Overflow explanation, understands the algorithm, and writes their own implementation isn’t plagiarising. The fingerprinting approach helps distinguish that case from copy‑paste‑rename by measuring both the length of the matched segment and the density of matching n‑grams. A 5‑line utility method may be acceptable; a 40‑line core algorithm with 18 out of 20 n‑grams identical to a web source is almost certainly copied verbatim.
Practical policies can then tier the response: automatic flag for long blocks, instructor review for moderate matches, and ignore for idiomatic patterns. Some universities have started adding web‑source detection to their automated grading pipelines, running a source code plagiarism checker like Codequiry as a pre‑submission check so students can see their own matches and correct attribution before the final deadline.