# US 2016/0259710 A1 · Code consistency checking method

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2016/0259710 A1
- Document ID: US20160259710A1
- Status: Published application
- Kind: A1
- Application number: 14/969,578
- Filed: 2015-12-15
- Published: 2016-09-08
- Earliest claimed: 2015-03-02
- Assignees: Hangzhou Glority Software Limited
- Applicants: Hangzhou Glority Software Limited
- Inventors: Qingsong XU; Huan LUO; Mingquan CHEN
- Web page: https://patentgrep.com/patent/US20160259710A1

## CPC

- G06F 11/3616: {using software metrics}
- G06F 8/71: Version control (security arrangements therefor G06F21/57); Configuration management
- G06F 8/751: {Code clone detection}
- G06F 11/3604: Analysis of software for verifying properties of programs (testing of software G06F11/3668)
- G06F 16/2365: {Ensuring data consistency and integrity}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

The present invention belongs to the technical field of software development and maintenance, and more especially related to a code consistency checking method. The consistency checking method of the present invention sustains the code consistency checking and maintenance in large-scale program at the code segment and function level rather than checking of duplicated files only, and maintains the consistency checking of duplicated codes at the development stage in the software development cycle, namely, before test phase, so as to greatly reduce the fix time of errors caused by inconsistency problems.

## Claims

### Claim 1

A code consistency checking method, characterized in that, comprising the following steps:
1) Conduct code duplication detection to the original codes and store the result into the database.
2) Retrieve all file information involving the changed codes according to the code version base before the developer submits the changed codes.
3) Obtain the information of all duplicated code segments contained in the files involving the changed codes according to the retrieval of the changed files in the database as described in Step 1).
4) Compare the changed codes with the duplicated code segments retrieved in Step 3); judge whether the changed codes submitted have changed these duplicated code segments. If the answer is NO, there is no inconsistency problem and the detection passes, if YES, perform the next detection.
5) According to the retrieval of the files where the duplicated code segments changed by the changed codes lie in the database as described in Step 1), if the files retrieved are not within the list of files involving the changed codes, it indicates some of the duplicated code segments before change are not changed, namely inconsistency problem exists. Report inconsistent code change in such case, but if the files retrieved are within the list of files involving the changed codes, it indicates inconsistency problem may exist, conduct the next checking in such case.
6) Compare the changed code with the duplicated code segments in the files within the list of files involving the changed codes retrieved. If the changes of these duplicated code segments are consistent, there is no inconsistency problem. But if the changes of these code segments are inconsistent, there is inconsistency problem. Report inconsistent code change in such a case.
7) Run code duplication detection and update the database after changes are submitted.

### Claim 2 (depends on 1)

The code consistency checking method as claimed in claim 1, characterized in that the repeatability detection in Step 1) is to check the code segments and functions.

### Claim 3 (depends on 1)

The code consistency checking method as claimed in claim 1, characterized in that the storage structure of the database in Step 1) includes three layers, namely file, link of file and code segment, and code segment.

### Claim 4 (depends on 1)

The code consistency checking method as claimed in claim 1, characterized in that the length of the code segment can be configured according to actual needs.

### Claim 5 (depends on 2)

The code consistency checking method as claimed in claim 2, characterized in that the length of the code segment can be configured according to actual needs.

### Claim 6 (depends on 3)

The code consistency checking method as claimed in claim 3, characterized in that the length of the code segment can be configured according to actual needs.
