A code quality management system

By setting critical paths and regression tests in the code management system, only auditing is carried out during critical paths, and testing is done using the latest code with changed serial numbers, the problem of insufficient code quality supervision is solved and efficient code management is achieved.

CN120045467BActive Publication Date: 2025-08-08METAX INTEGRATED CIRCUITS (SHANGHAI) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510536681.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-04-27
Publication Date
2025-08-08
Estimated Expiration
2045-04-27

AI Technical Summary

Technical Problem

The existing code management system cannot effectively supervise the quality of submitted codes, resulting in reduced availability of code bases, and low automation of manual review methods, which consumes a lot of human resources.

Method used

By setting the critical path and regression test, the audit process is carried out only when the target path submitted by the code is the critical path, and the regression test is performed with the code corresponding to the latest change sequence number in the code warehouse, the tag sequence number is updated according to the test results, and the comparison is used to determine whether the code can be submitted to the server.

Benefits of technology

It improves the reliability and efficiency of code management, avoids follow-up inspections caused by code quality problems, and improves the automation and reliability of the code management system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120045467B_ABST
    Figure CN120045467B_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of code management, and in particular to a code quality management system, which sets a critical path so that an audit process is performed only when the target path of the code submission is a critical path, selects the code corresponding to the latest change number in the code warehouse as the code to be submitted, checks the code to be submitted through regression testing, updates the first sequence number corresponding to the test failure label or the second sequence number corresponding to the test pass label according to the regression test result, and determines whether the code to be submitted can be submitted to the server according to the comparison result of the first sequence number and the second sequence number, thereby improving the reliability of code management, avoiding the subsequent code inspection required due to code quality problems, and improving the efficiency of code management.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of code management, and in particular to a code quality management system. Background Art

[0002] Typically, a codebase requires multiple members to collaborate on writing and updating it. Using a code management system facilitates codebase maintenance. A code management system typically includes a server and several clients. The server maintains the codebase, and members can submit code to the server through any client. The server then updates the submitted code to the codebase. Code updates can include adding, modifying, and deleting code in the codebase, thus achieving distributed code management. For example, a code management system can use the Perforce system.

[0003] However, in the code management scenario, existing code management systems can usually only be used to standardize the code submission process and cannot effectively supervise the quality of the submitted code, which may lead to quality problems in the submitted code, and thus reduce the availability of the code base. A large amount of human resources is required to locate quality problems, resulting in low reliability and efficiency of the code management system.

[0004] In the prior art, there is a method that proposes to add password book management to the code submission process, so that when submitting code, it needs to be reviewed by a specific person and the password information is obtained before it can be submitted normally. This can ensure the quality of the code to a certain extent. However, since the code base may involve a large amount of code that needs to be reviewed, the review pressure on the reviewer is too high, and the degree of automation of the manual review method is still low.

[0005] Therefore, how to improve the reliability and efficiency of the code management system has become an urgent problem to be solved. Summary of the Invention

[0006] In view of the above technical problems, the technical solution adopted by the present invention is:

[0007] A code quality management system, comprising: a code repository, a client, a server, a processor, and a memory storing a computer program, wherein the server includes several critical paths, the code repository contains several codes, each code having a corresponding change sequence number, and when the computer program is executed by the processor, the following steps are implemented:

[0008] S101: At a preset time point, select the code corresponding to the latest change sequence number from the code warehouse as the code to be submitted.

[0009] S102: Perform regression testing on the code to be submitted to obtain regression test results.

[0010] S103: If the regression test result does not meet the first preset condition, the change serial number corresponding to the code to be submitted is used as the first serial number corresponding to the test failure label.

[0011] S104: Otherwise, the change serial number corresponding to the code to be submitted is used as the second serial number corresponding to the test pass label.

[0012] S105 , when the client submits the target code to the target path of the server, it is detected whether there is a critical path consistent with the target path.

[0013] S106: If there is a critical path that is consistent with the target path, the first sequence number is compared with the second sequence number to obtain a comparison result.

[0014] S107: If the comparison result meets a second preset condition, submit the code corresponding to the second serial number to the server.

[0015] Compared with the prior art, the present invention has significant benefits. By means of the above technical solution, the code quality management system provided by the present invention can achieve considerable technological advancement and practicality, and has wide industrial application value. It has at least the following beneficial effects:

[0016] The present invention provides a code quality management system, the system comprising: a code warehouse, a client, a server, a processor, and a memory storing a computer program, wherein the server comprises a plurality of critical paths, the code warehouse comprises a plurality of codes, each code has a corresponding change sequence number, and when the computer program is executed by the processor, the following steps are implemented: S101, at a preset time point, selecting the code corresponding to the latest change sequence number from the code warehouse as the code to be submitted; S102, performing regression testing on the code to be submitted to obtain a regression test result; S103, if the regression test result does not meet a first preset condition, , then the change serial number corresponding to the code to be submitted is used as the first serial number corresponding to the test failure label, S104, otherwise, the change serial number corresponding to the code to be submitted is used as the second serial number corresponding to the test pass label, S105, when the client submits the target code to the target path of the server, detect whether there is a critical path consistent with the target path, S106, if there is a critical path consistent with the target path, compare the first serial number and the second serial number to obtain a comparison result, S107, if the comparison result meets the second preset condition, submit the code corresponding to the second serial number to the server.

[0017] It can be seen that by setting the critical path, the review process is only carried out when the target path of the code submission is the critical path, and the code corresponding to the latest change number is selected in the code warehouse as the code to be submitted. The code to be submitted is checked through regression testing, and the first serial number corresponding to the test failure label or the second serial number corresponding to the test pass label is updated according to the regression test result. According to the comparison result of the first serial number and the second serial number, it is determined whether the code to be submitted can be submitted to the server. This improves the reliability of code management, avoids the subsequent code inspection required due to code quality issues, and improves the efficiency of code management. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0019] Figure 1 A flowchart of a computer program executed by a processor in a code quality management system provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0020] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without making any creative efforts shall fall within the scope of protection of the present invention.

[0021] This embodiment provides a code quality management system. Figure 1 , is a flow chart of a computer program executed by a processor in a code quality management system provided by an embodiment of the present invention. The system includes: a code repository, a client, a server, a processor, and a memory storing the computer program. The server includes several critical paths, and the code repository contains several codes, each of which has a corresponding change sequence number. When the computer program is executed by the processor, the following steps are implemented:

[0022] S101, selecting the code corresponding to the latest change sequence number from the code warehouse at a preset time point as the code to be submitted;

[0023] S102, performing regression testing on the code to be submitted to obtain regression test results;

[0024] S103, if the regression test result does not meet the first preset condition, using the change serial number corresponding to the code to be submitted as the first serial number corresponding to the test failure label;

[0025] S104: Otherwise, the change serial number corresponding to the code to be submitted is used as the second serial number corresponding to the test pass label;

[0026] S105, when the client submits the target code to the target path of the server, detecting whether there is a critical path consistent with the target path;

[0027] S106, if there is a critical path that is consistent with the target path, compare the first sequence number with the second sequence number to obtain a comparison result;

[0028] S107: If the comparison result meets a second preset condition, submit the code corresponding to the second serial number to the server.

[0029] The code quality management system provided in this embodiment can be based on an existing code management system, such as the Perforce system. The code quality management system can include multiple clients. This embodiment uses a single client for code submission as an example. Users can use any client to submit code based on their actual needs.

[0030] The server may include a code library, which may include several code libraries corresponding to different tasks. Each code library may include several code paths. The critical path may be configured by the implementer. The code submission under the critical path is the code submission that needs to be reviewed. The target path may refer to the corresponding path in the server when the client submits the code to the server.

[0031] The code repository can be deployed on the client. The code repository contains several codes, each of which has a corresponding change number. The change number can be used to represent the version of the code.

[0032] The preset time points may be determined according to a fixed setting interval, that is, the time interval between adjacent preset time points is the fixed setting interval. In this embodiment, the fixed setting interval may be one day.

[0033] Specifically, the code corresponding to the latest change number may refer to the latest version of the code in the code repository, and the regression test result may include a test pass and a test fail. The first preset condition may refer to the regression test result being a test pass.

[0034] The first serial number corresponding to the test failure tag can be used to record the latest change serial number of the test failure code, and the second serial number corresponding to the test pass tag can be used to record the latest change serial number of the test pass code. The comparison result can represent the size relationship between the first serial number and the second serial number.

[0035] In a specific implementation, the regression test results include configuration compilation results and use case simulation results.

[0036] The regression test results may include configuration compilation results and use case simulation results. The configuration compilation results may include two states: pass and fail. Similarly, the use case simulation results may also include two states: pass and fail.

[0037] In a specific implementation, the first preset condition is that both the configuration compilation result and the use case simulation result are in a pass state.

[0038] Among them, when the configuration compilation result and the use case simulation result are both in the passed state, it means that the regression test result meets the first preset condition; otherwise, it means that at least one of the configuration compilation result and the use case simulation result is in the failed state, then the regression test result does not meet the first preset condition.

[0039] In a specific implementation, the second preset condition is that the second sequence number is greater than or equal to the first sequence number.

[0040] Among them, when the second serial number is greater than or equal to the first serial number, it means that the code to be submitted is the latest and has passed the regression test or the quality check of the target personnel, and can be submitted to the server.

[0041] In a specific embodiment, when the computer program is executed by a processor, the following steps are further implemented:

[0042] S108, if the comparison result meets the third preset condition, an alarm message is sent to the target person, and the server stops accepting the submitted code;

[0043] After the server stops receiving the submitted code, the comparison result is continuously detected at a preset frequency until the comparison result meets the second preset condition.

[0044] Among them, when the comparison result meets the third preset condition, it means that there are quality problems in the code to be submitted, and the target personnel need to take corresponding measures. Therefore, an alarm message is sent to the target personnel, the server is closed to receive code submissions, and the comparison results are continuously tested at the preset frequency until the comparison results meet the second preset condition. Only then can the code be submitted normally.

[0045] It should be noted that if regression testing of new code to be submitted has begun before closing the server to receive code submissions, the new code to be submitted may be a repair version of the current code to be submitted. Therefore, the new code to be submitted can be allowed to be submitted normally after passing the quality check.

[0046] In a specific implementation, the third preset condition is that the second sequence number is smaller than the first sequence number.

[0047] When the second serial number is smaller than the first serial number, it indicates that the code to be submitted is the latest but fails the quality check based on the regression test.

[0048] In a specific embodiment, after the target person receives the alarm information and checks that the code to be submitted is passed, the second serial number corresponding to the test pass label is modified to the change serial number corresponding to the code to be submitted, and the server starts to receive the submitted code.

[0049] Among them, the target personnel checking that the code to be submitted has passed may mean that the target personnel believes that the quality of the code to be submitted determined by the regression test is negligible. At this time, the target personnel does not need to repair the code to be submitted, but only needs to modify the second serial number corresponding to the test pass label and then modify the comparison result, so that the current code to be submitted can be submitted to the server normally.

[0050] Enabling the server to receive code submissions will allow the server to receive the submitted code normally.

[0051] In a specific embodiment, after the target person receives the warning information and fixes the code to be submitted into the fixed code, the change number corresponding to the code to be submitted is increased by one as the change number corresponding to the fixed code, and the server starts to receive the submitted code;

[0052] The repaired code is used as the code to be submitted, and steps S102 to S107 are executed.

[0053] Among them, the target personnel repairs the code to be submitted into the repair code, which may mean that the target personnel repairs the problematic part after checking the quality issues of the code to be submitted, and obtains the repair code, and increases the change number corresponding to the current code to be submitted by one as the change number corresponding to the repair code, and uses the repair code as the new code to be submitted, that is, uses the repair code as a new version of the code. The target personnel can submit the repair code normally to the code warehouse to execute the normal regression testing process at the preset time point, and then update the comparison results so that the modified code can be submitted to the server normally.

[0054] In one embodiment, the target personnel can directly execute the regression testing process through the backdoor to fix the code, and then update the comparison results so that the modified code can be submitted to the server normally, without waiting for the regression testing process to be triggered.

[0055] In this embodiment, by setting a critical path, the review process is only performed when the target path of the code submission is a critical path, and the code corresponding to the latest change number is selected in the code warehouse as the code to be submitted. The code to be submitted is checked through regression testing, and the first serial number corresponding to the test failure label or the second serial number corresponding to the test pass label is updated according to the regression test result. Based on the comparison result of the first serial number and the second serial number, it is determined whether the code to be submitted can be submitted to the server. This improves the reliability of code management, avoids the subsequent code inspection required due to code quality issues, and improves the efficiency of code management.

[0056] Although some specific embodiments of the present invention have been described in detail by way of example, it will be understood by those skilled in the art that the above examples are for illustration only and are not intended to limit the scope of the present invention. It will also be understood by those skilled in the art that various modifications may be made to the embodiments without departing from the scope and spirit of the present invention. The scope of the present invention is defined by the appended claims.

Claims

1. A code quality management system, characterized in that: The system includes: a code repository, a client, a server, a processor, and a memory storing a computer program, wherein the server includes several critical paths, the code repository contains several codes, each code has a corresponding change sequence number, and when the computer program is executed by the processor, the following steps are implemented: S101, selecting the code corresponding to the latest change sequence number from the code warehouse at a preset time point as the code to be submitted; S102, performing regression testing on the code to be submitted to obtain regression test results; S103, if the regression test result does not meet the first preset condition, using the change serial number corresponding to the code to be submitted as the first serial number corresponding to the test failure label; S104: Otherwise, the change serial number corresponding to the code to be submitted is used as the second serial number corresponding to the test pass label; S105, when the client submits the target code to the target path of the server, detecting whether there is a critical path consistent with the target path; S106, if there is a critical path that is consistent with the target path, compare the first sequence number with the second sequence number to obtain a comparison result; S107: If the comparison result satisfies a second preset condition, submitting the code corresponding to the second serial number to the server, wherein the second preset condition is that the second serial number is greater than or equal to the first serial number; When the computer program is executed by a processor, the following steps are further implemented: S108, if the comparison result meets a third preset condition, sending an alarm message to the target person, and the server stops accepting submitted codes, wherein the third preset condition is that the second serial number is smaller than the first serial number; After the server stops receiving the submitted code, continuously detecting the comparison result at a preset frequency until the comparison result meets the second preset condition; After the target person receives the warning information and checks that the code to be submitted is passed, the second serial number corresponding to the test pass label is modified to the change serial number corresponding to the code to be submitted, and the server starts to receive the submitted code.

2. The code quality management system according to claim 1, characterized in that: The regression test results include configuration compilation results and use case simulation results.

3. The code quality management system according to claim 2, characterized in that: The first preset condition is that both the configuration compilation result and the use case simulation result are in a passed state.

4. The code quality management system according to claim 1, characterized in that: After the target person receives the warning information and fixes the code to be submitted into the fixed code, the change number corresponding to the code to be submitted is increased by one as the change number corresponding to the fixed code, and the server starts to receive the submitted code; The repaired code is used as the code to be submitted, and steps S102 to S107 are executed.

Citation Information

Patent Citations

  • Code submission method, electronic device, storage medium and program product

    CN117971692A

  • Code submission management system

    CN119088446A