18463956. SYSTEMS AND METHODS FOR DETECTION OF CODE CLONES simplified abstract (Huawei Technologies Co., Ltd.)

From WikiPatents
Jump to navigation Jump to search

SYSTEMS AND METHODS FOR DETECTION OF CODE CLONES

Organization Name

Huawei Technologies Co., Ltd.

Inventor(s)

Jinfu Chen of Montreal (CA)

Yuan Wang of Kingston (CA)

Dong Qiu of Hangzhou (CN)

Xin Xia of Hangzhou (CN)

SYSTEMS AND METHODS FOR DETECTION OF CODE CLONES - A simplified explanation of the abstract

This abstract first appeared for US patent application 18463956 titled 'SYSTEMS AND METHODS FOR DETECTION OF CODE CLONES

Simplified Explanation

Methods and devices for detecting code clones in a software program are described in this patent application. The process involves converting the source code into n-gram representations and generating a clone index for each code portion in the normalized source code. The clone index includes a feature vector that encodes the features of the code portion based on the corresponding n-gram representations. Code clones are detected by comparing the clone indexes and matching the feature vectors.

  • The patent application describes a method for detecting code clones in a software program.
  • The source code is processed into n-gram representations.
  • A clone index is generated for each code portion in the normalized source code.
  • The clone index includes a feature vector that encodes the features of the code portion.
  • The feature vector is based on the n-gram representations corresponding to the code portion.
  • Code clones are detected by comparing the clone indexes.
  • The detection is based on matching the feature vectors of the clone indexes.

Potential Applications

This technology can be applied in various fields where software development is involved, including:

  • Software development companies can use this technology to identify and eliminate code clones in their projects, improving code quality and reducing redundancy.
  • Open-source software communities can benefit from this technology by detecting code clones in their repositories, allowing for better collaboration and avoiding duplication of effort.
  • Code review tools can integrate this technology to automatically identify code clones, helping developers to refactor and optimize their code.

Problems Solved

The technology presented in this patent application solves the following problems:

  • Code clones in software programs can lead to redundancy, decreased maintainability, and increased chances of introducing bugs.
  • Manually identifying code clones in large software projects is time-consuming and error-prone.
  • Existing code clone detection techniques may not be efficient or accurate enough to handle complex code structures and variations.

Benefits

The use of this technology offers several benefits:

  • Improved code quality by identifying and eliminating code clones, leading to more maintainable and efficient software.
  • Time and effort savings for developers by automating the detection of code clones, allowing them to focus on other critical tasks.
  • Enhanced collaboration and knowledge sharing in software development communities by avoiding duplication of effort and promoting code reuse.


Original Abstract Submitted

Methods and devices are described for detecting code clones in a software program. The source code of the software program is processed into a group of n-gram representations. A clone index is generated for each respective code portion defined in the normalized source code, where each clone index includes a feature vector encoding features of the respective code portion based on the n-gram representations corresponding to the respective code portion. Comparison of the clone indexes is used to detect a code clone, based on matching the feature vectors of the clone indexes.