NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

A SVM-based Software Homology Detection Method

Bukuan Sun, Xiaoming Liu, Dian Lei, Qi Li2016

Abstract

With the development of software technology, software is becoming increasingly essential in our daily lives. However, there are more and more sorts of pirated software. Therefore, we need to figure out an effective method to prevent plagiarism, protect intellectual property and so on. Software homology detection can be used as protection of software intellectual property, malware defense, and can chase an important means of accountability and evidence. We did some experiments to evaluate the performance of our method. And the results showed that the proposed method can achieve satisfactory outcome.

Introduction

As software becomes more central to daily life, the industry faces a rising tide of piracy, plagiarism, and intellectual property disputes. Traditional methods of protecting code often fall short when a plagiarist modifies variable names or slightly alters structure. This paper addresses the challenge of software homology detection—determining if two pieces of code share a common origin or author. The core hypothesis is that every programmer has subconscious "living habits" reflected in their code, such as indentation preferences or brace placement. By automating the detection of these stylistic signatures, we can provide robust evidence in copyright disputes or malware forensics.

Methodology

The proposed system is divided into two main phases: Offline Training and Online Testing. The overall workflow is illustrated in Figure 1.

System Architecture for Offline Training and Online Testing

Feature Extraction and Vectorization

The core of the method lies in 12 identified "Basic Features" (F1-F12) that represent programming habits. These features are detailed in the figure below:

The 12 Basic Stylistic Features (F1-F12)

Each source code sample is converted into a 12-dimensional feature vector based on the frequency and presence of these habits. This language-agnostic approach allows the model to function across multi-language codebases (e.g., C++, Java, Python) without requiring specialized parsers for every new language.

SVM Classification

The system utilizes a Support Vector Machine (SVM) classifier. SVM is a supervised learning model that finds the "optimal hyperplane"—a boundary in the 12-dimensional space—that best separates the coding styles of different authors. SVM was chosen because it excels at handling high-dimensional patterns even with relatively small training datasets, leveraging structural risk minimization to improve generalization to unseen code.

Experimental Setup and Results

The researchers compiled a dataset consisting of 140 code samples from 14 different authors. The samples included C++, Java, and Python code gathered from the CSDN developer community and original code.

Three separate tests were conducted to evaluate the system's accuracy using 30 samples per test:

  • Test 1: 73.3% accuracy
  • Test 2: 86.7% accuracy
  • Test 3: 83.3% accuracy

While the results varied, the 12-feature set proved to be a feasible and effective way to distinguish between authors, even when the dataset is relatively small.

Conclusion and Future Work

This study demonstrates that coding habits can serve as a viable "fingerprint" for software homology detection. However, several limitations remain. Obtaining sufficient training samples for every author is a practical hurdle. Additionally, the evolution of a developer's style over time can lead to lower accuracy. Future work will explore expanding the feature set to distinguish between programmers with very similar styles or those following strict corporate style guides, as well as optimizing the computational costs for larger datasets.

Summary updated

BibTeX
@misc{sun2016svm,
  author = {Bukuan Sun and Xiaoming Liu and Dian Lei and Qi Li},
  title = {{A SVM-based Software Homology Detection Method}},
  year = {2016},
  doi = {10.2991/icca-16.2016.46},
}
Figure