In recent years, plagiarism in programming assignments and excessive code reuse in software development have become pressing concerns for both academia and the IT industry. Traditional text-matching tools often fail to identify copied programs when developers or students disguise them by altering variable names, rearranging code segments, or modifying formatting. This paper presents a web-based system designed to detect source code similarity by integrating structural analysis with Natural Language Processing (NLP) techniques. The proposed model evaluates code resemblance using multiple approaches, such as sequence-based (Difflib), vector-based (Cosine Similarity), token-based (Jaccard Index), and structure-based (Abstract Syntax Tree) methods. Among these, the AST-based technique stands out by focusing on the syntactic and structural patterns of code rather than its surface-level text. Experimental results demonstrate that this approach provides higher reliability and accuracy, especially when identifying refactored or slightly modified code segments.

错误:搜索内容不能为空,请输入英文关键词
错误:关键词超出字数限制,请精简
高级检索

Source Code Similarity Detection Using NLP Techniques

  • Rakhi Wajgi,
  • Krutika Funde,
  • Prathmesh Ghormade,
  • Sachin Bisen,
  • Rohit Gajbhiye,
  • Raj Dhoble,
  • Pritam Chaudhari

摘要

In recent years, plagiarism in programming assignments and excessive code reuse in software development have become pressing concerns for both academia and the IT industry. Traditional text-matching tools often fail to identify copied programs when developers or students disguise them by altering variable names, rearranging code segments, or modifying formatting. This paper presents a web-based system designed to detect source code similarity by integrating structural analysis with Natural Language Processing (NLP) techniques. The proposed model evaluates code resemblance using multiple approaches, such as sequence-based (Difflib), vector-based (Cosine Similarity), token-based (Jaccard Index), and structure-based (Abstract Syntax Tree) methods. Among these, the AST-based technique stands out by focusing on the syntactic and structural patterns of code rather than its surface-level text. Experimental results demonstrate that this approach provides higher reliability and accuracy, especially when identifying refactored or slightly modified code segments.