CN116860314A - Code management method, device, electronic equipment and storage medium - Google Patents
Code management method, device, electronic equipment and storage medium Download PDFInfo
- Publication number
- CN116860314A CN116860314A CN202310632785.3A CN202310632785A CN116860314A CN 116860314 A CN116860314 A CN 116860314A CN 202310632785 A CN202310632785 A CN 202310632785A CN 116860314 A CN116860314 A CN 116860314A
- Authority
- CN
- China
- Prior art keywords
- code
- test
- management method
- quality index
- detected
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000007726 management method Methods 0.000 title claims abstract description 57
- 238000012360 testing method Methods 0.000 claims abstract description 144
- 230000004044 response Effects 0.000 claims abstract description 12
- 238000001514 detection method Methods 0.000 claims description 38
- 238000012986 modification Methods 0.000 claims description 28
- 230000004048 modification Effects 0.000 claims description 28
- 238000012795 verification Methods 0.000 claims description 24
- 238000004590 computer program Methods 0.000 claims description 16
- 230000008859 change Effects 0.000 claims description 14
- 230000003068 static effect Effects 0.000 claims description 10
- 238000007477 logistic regression Methods 0.000 claims description 9
- 238000004458 analytical method Methods 0.000 claims description 5
- 238000000034 method Methods 0.000 description 19
- 238000004364 calculation method Methods 0.000 description 14
- 230000008569 process Effects 0.000 description 10
- 230000006870 function Effects 0.000 description 9
- 238000004422 calculation algorithm Methods 0.000 description 7
- 238000010586 diagram Methods 0.000 description 6
- 238000013145 classification model Methods 0.000 description 5
- 230000006872 improvement Effects 0.000 description 4
- 238000010348 incorporation Methods 0.000 description 4
- 230000003287 optical effect Effects 0.000 description 3
- 238000011161 development Methods 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 230000010354 integration Effects 0.000 description 2
- 230000000644 propagated effect Effects 0.000 description 2
- 238000013139 quantization Methods 0.000 description 2
- 101100101428 Drosophila melanogaster heix gene Proteins 0.000 description 1
- 230000006399 behavior Effects 0.000 description 1
- 238000004891 communication Methods 0.000 description 1
- 238000012790 confirmation Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 239000000835 fiber Substances 0.000 description 1
- 230000003116 impacting effect Effects 0.000 description 1
- 238000007689 inspection Methods 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 239000013307 optical fiber Substances 0.000 description 1
- 238000012545 processing Methods 0.000 description 1
- 230000008439 repair process Effects 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
- 238000012916 structural analysis Methods 0.000 description 1
- 239000002699 waste material Substances 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/70—Software maintenance or management
- G06F8/71—Version control; Configuration management
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Preventing errors by testing or debugging software
- G06F11/3668—Software testing
- G06F11/3672—Test management
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Computer Security & Cryptography (AREA)
- Computer Hardware Design (AREA)
- Quality & Reliability (AREA)
- Debugging And Monitoring (AREA)
Abstract
The application provides a code management method, a device, electronic equipment and a storage medium, wherein when code management is carried out, the step of judging whether a detected code needs to be subjected to code test again or not in response to a check request is added, and code merging is carried out after judging that the detected code does not need to be subjected to code test again or the code test carried out by the detected code passes through again after the check request is received.
Description
Technical Field
The present application relates to the field of computer technologies, and in particular, to a code management method, a device, an electronic apparatus, and a storage medium.
Background
The current chip projects are more and more complex, and from the project standpoint, the chip projects can be actually put into production and used only through a plurality of stages such as code writing, code submitting, code verifying, code modifying and the like. In the project management process, it is inevitable to involve a code management section, and the version robustness, stability and completeness of the code are important contents of code management. In order to meet different business scenes, the version of the code needs to support a large number of business requirements, and the code management needs to synchronously guarantee the version stability on the basis of quickly responding to the client requirements.
Conventional project code management includes code testing and management flow, wherein the code testing mainly includes white box testing, special testing, integration testing, and system testing.
In order to guarantee version quality, each modification point or requirement is integrated in current code management, the code testing flow is strictly followed, the consumed labor and time cost is high, and the project cost and timeliness are seriously affected.
Accordingly, there is a need to provide an improved solution to overcome the above technical problems in the prior art.
Disclosure of Invention
In order to solve the technical problems, the application provides a code management method, a device, electronic equipment and a storage medium, which can solve the problem that the version stability, the management cost and the timeliness influence cannot be considered in the code management process.
According to a first aspect of the present application, there is provided a code management method comprising:
receiving a verification request, and responding to the verification request to judge whether the detected code needs to be subjected to code test again;
and when the detected code is judged not to need to be subjected to code testing again, or the detected code is subjected to code testing again, code merging is performed to realize version updating.
Optionally, the code management method further includes:
static detection and automatic continuous integrated detection are carried out on codes,
and the verification request is obtained according to the automatic continuous integrated detection result.
Optionally, the determining whether the detected code needs to be subjected to code testing again in response to the verification request includes:
acquiring parameter data after temporarily integrating codes in response to the verification request;
evaluating a quality index of the integrated code according to the parameter data, wherein the quality index represents the influence degree of the integrated code on version stability;
judging whether the detected code needs to be subjected to code test again according to the category to which the quality index belongs.
Optionally, the parameter data includes at least one of the following data:
version size change, version remaining memory change, total modification file number, total modification point number, total modification range size, total modification content reference number, single file maximum modification ratio, single file maximum modification point number, single file modification range size, and single file content maximum application number.
Optionally, the evaluating the quality index of the integrated code according to the parameter data includes:
analyzing the parameter data by adopting a pre-trained Logistic regression model;
and obtaining the quality index according to the analysis result.
Optionally, the evaluating the quality index of the integrated code according to the parameter data includes:
quantizing each item of data in the parameter data;
and calculating the weighted sum of the quantized parameter data according to a preset weight parameter to obtain the quality index.
Optionally, the evaluating the quality index of the integrated code according to the parameter data includes:
sequentially judging the size relation of each item of data in the parameter data relative to a preset threshold value, and determining the change level of each item of data according to a judging result;
and calculating the weighted sum of the change levels of each item of data according to preset weight parameters to obtain the quality index.
Optionally, when it is determined that the detected code needs to be subjected to the code test again, performing at least one of the following:
determining test items to be tested again according to the second category corresponding to the quality index;
and determining the test cases when the test needs to be performed again according to the second category corresponding to the quality index.
Optionally, the test item includes at least one of a special test, an integrated test, and a system test.
According to a second aspect of the present application, there is provided a code management apparatus comprising:
a judging unit for judging whether the detected code needs to be subjected to code test again in response to the verification request;
and the code merging unit is used for merging codes to realize version updating after judging that the detected codes do not need to be subjected to code testing again or the detected codes pass the code testing again.
According to a third aspect of the present application, there is provided an electronic device comprising: a processor and a memory storing a computer program, wherein the processor is capable of implementing a code management method according to some embodiments of the application when executing the computer program.
According to a fourth aspect of the present application, there is provided a computer readable storage medium storing a computer program, wherein the computer program, when executed by a processor, is capable of implementing a code management method according to some embodiments of the present application.
By adopting the technical scheme in any embodiment of the application, the code management flow can be optimized, the version stability of the code is greatly improved, the test workload is reduced, the management cost is low, and the timeliness is strong.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the application as claimed.
Drawings
FIG. 1 illustrates a flow chart of code management;
FIG. 2 shows a flow chart of a code management method provided in accordance with an embodiment of the present application;
FIG. 3 is a flow chart of a determination of whether code testing is needed again provided in accordance with an embodiment of the present application;
FIG. 4 shows a schematic diagram of a code management apparatus provided according to an embodiment of the present application;
fig. 5 shows a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
In order that the application may be readily understood, a more complete description of the application will be rendered by reference to the appended drawings. Preferred embodiments of the present application are shown in the drawings. The application may, however, be embodied in different forms and is not limited to the embodiments described herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete.
In the description of the present application, words such as "exemplary" or "such as" are used to mean serving as an example, instance, or illustration. Any embodiment described as "exemplary" or "for example" in this disclosure should not be construed as preferred or advantageous over other embodiments. "and/or" herein is a description of an association relationship of an associated object, meaning that there may be three relationships, e.g., a and/or B, which may represent: a exists alone, A and B exist together, and B exists alone. "plurality" means two or more than two. In addition, in order to facilitate the clear description of the technical solutions of the embodiments of the present application, the words "first", "second", etc. are used to distinguish the same item or similar items having substantially the same function and effect. It will be appreciated by those of skill in the art that the words "first," "second," and the like do not limit the amount and order of execution, and that the words "first," "second," and the like do not necessarily differ.
In describing representative exemplary embodiments, the specification may have presented the method and/or process as a particular sequence of steps. However, to the extent that the method or process does not rely on the particular order of steps set forth herein, the method or process should not be limited to the particular sequence of steps described. Other sequences of steps are possible as will be appreciated by those of ordinary skill in the art. Accordingly, the particular order of the steps set forth in the specification should not be construed as limitations on the claims. Furthermore, the claims directed to the method and/or process should not be limited to the performance of their steps in the order written, and one skilled in the art can readily appreciate that the sequences may be varied and still remain within the scope of the embodiments of the present application.
Fig. 1 shows a code management flow, as shown in fig. 1, comprising:
code submission, step 110.
After code development or modification is carried out on new requirements, functions or tasks, code developers submit codes to carry out a code-listing test flow, so that whether the codes after the development or modification meet requirements or not is verified.
Step 120, code testing.
The test flow of the code comprises the following steps: manual walkthrough, static detection, and automated CI (Continuous Integration, continuously integrated) detection.
Wherein, the manual walk is also called manual inspection or code examination, i.e. manually inspecting the tested code. Manual walkthrough is a process by which developers and architects centrally discuss code. The purpose of the manual walk is to exchange ideas about how the code is written and to establish a standard collective description of the code. During the manual walk, the developer should have an opportunity to state their code to others. Often, even simple code statements will help developers identify errors and anticipate new solutions to the previously bothersome problems.
Static detection refers to checking the correctness of a program by only analyzing or checking the syntax, structure, procedure, interface, etc. of source code without running the code under test itself. The method comprises the steps of carrying out structural analysis, flow chart analysis and symbol execution on a demand specification, a software design specification and source codes to find errors. Static detection finds shortfalls and suspicious through analysis of program static characteristics, such as unmatched parameters, improper loop nesting and branch nesting, impermissible recursion, unused variables, reference to null pointers, suspicious computation, and the like. The static test results can be used for further debugging and provide guidance for test case selection. In other words, static detection technology refers to scanning submitted codes, understanding behaviors of programs from grammar and semantics, directly analyzing features of detected codes, and searching for anomalies that may cause errors.
Conventional static detection tools include: heix QACs, klocwork, codeSonar, defenseCode ThunderScan, embold, etc.
Automated CI detection may help developers to incorporate code changes into shared branches or "backbones" more frequently (e.g., daily or every few days). Once changes made to an application by a developer are incorporated, the system validates the changes by automatically building the application and running different levels of automated testing, including, for example, unit testing (also known as specialized testing) and integrated testing, to ensure that the changes do not destroy the application. Typically, automated CI detection runs specific test cases to achieve code verification based on the class of code under test. The content of the automated CI detection needs to range from classes and functions to different modules that make up the whole application. If a new code has holes (bug) or conflicts with the existing code, the automatic CI detection can more easily and quickly find the problems, and a developer can conveniently and quickly repair the errors.
And 130, updating the code version.
According to the code test results, after all tests are passed, the submitted code is integrated into a shared branch or "backbone" and a new code version is issued.
However, the automatic CI detection may only indicate that the submitted codes are qualified from the aspect of code rule, but in the aspect of pure version management, some submitted codes pass the automatic CI detection, but since the test cases operated during the automatic CI detection are only some cases which can be realized by automation, the covered cases or scenes are limited, and thus, when the codes are really integrated into and updated with the version, the integrated codes still have the possibility of impacting the version, thereby affecting the stability of the version.
In order to improve the version stability of the items in the code management, the embodiment of the application provides a novel code management method, and the code management flow can be optimized by adding the judgment operation of whether to carry out the code test again after the automatic CI detection, so that the version stability of the codes is greatly improved, the test workload is reduced, the management cost is low, and the timeliness is strong.
As shown in fig. 2, the code management method provided by the embodiment of the present application includes:
step 210, receiving the verification request, and responding to the verification request to determine whether the detected code needs to be subjected to code testing again.
In this step, the detected code refers to a code that has passed one or more detections. Again code testing refers to a new code test being performed on the current detected code.
Optionally, the code management method further includes: after the code is submitted, manual walking, static detection and automatic continuous integrated detection (namely automatic CI detection) are carried out on the submitted code, wherein only the code passing the previous detection or test can enter the next test flow, and otherwise, the code is returned to a developer for modification or re-writing.
Alternatively, this step is performed after the automated CI detection passes, i.e., the verification request is obtained from the automated CI detection results. In the implementation, based on the consideration of ensuring the quality and stability of the version, after the automatic CI detection is passed, a verification request can be submitted by a manual or system algorithm according to the detection result of the automatic CI detection, so as to trigger an algorithm model to judge whether the code detected by the automatic CI needs to be subjected to code test again. In other words, the detected code in the embodiments of the present application refers specifically to code that has been detected by an automated CI.
In an exemplary embodiment, code incorporation corresponding to a large demand, improvement or solution of an important issue may be determined by a technical expert initially after the automated CI detection passes to determine whether the incorporated detected code (also referred to herein simply as incorporated code) needs to be subjected to code test again, and for code incorporation not required for conclusion, submitting a verification request to trigger an intelligent algorithm model to perform secondary judgment confirmation so as to truly ensure version quality; code incorporation corresponding to small requirements, improvement or general problems can be directly submitted to check requests after the automatic CI detection is passed to trigger the adoption of an intelligent algorithm model for judgment, so that the test flow is reduced to the greatest extent under the condition of guaranteeing the incorporation quality. Of course, in another exemplary embodiment, whether the code corresponding to the large demand, improvement or solution of the important problem is incorporated, or the code corresponding to the small demand, improvement or solution of the general problem is incorporated, the check request is directly submitted after the automatic CI detection is passed, so as to reduce the labor participation degree, reduce the labor cost, and improve the test efficiency and the judgment accuracy. The present application is not limited in this regard.
In this embodiment, as shown in fig. 3, in response to the verification request, determining whether the detected code needs to be subjected to the code test again further includes executing the following steps:
and step 310, acquiring parameter data after the temporary code combination in response to the verification request.
For different types of codes, the judging standard of whether the codes will impact the version after the codes are combined may be different, so that in this step, corresponding parameter data of the combined detected codes after the codes are temporarily combined is obtained in response to the verification request, and the parameter data is used as a judging basis for judging whether the detected codes need to be subjected to code test again.
In an exemplary embodiment, the parameter data obtained in this step includes at least one of the following: version size change, version remaining memory change, total modification file number, total modification point number, total modification range size, total modification content reference number, single file maximum modification ratio, single file maximum modification point number, single file modification range size, and single file content maximum application number.
Wherein, the parameter data can be obtained in the process of the automatic CI detection. For example, a parameter file (if existing, no creation is needed) may be created, the parameter data are acquired in real time in the automated CI detection process and stored in the parameter file, and after a verification request is received, the required parameter data are called according to the code type to be incorporated in response to the verification request, which is convenient and fast. Of course, other ways of obtaining parameter data are possible, and embodiments of the present application are not limited in this respect.
And step 320, evaluating the quality index of the synthesized code according to the parameter data, wherein the quality index represents the influence degree of the synthesized code on the version stability.
In order to enable the influence degree of each combined code on the version stability to be intuitively and comprehensively displayed, the quality judgment standard of different combined codes is facilitated to be standardized, and in the step, the quality index representing the influence degree of the combined codes on the version stability is obtained after the parameter data are processed. Based on the quality index, it can be appreciated that the system or operator can quickly and accurately determine whether the current code needs to be tested again, thereby improving the efficiency and quality of code management to some extent.
In an exemplary embodiment, the evaluating the quality index of the integrated code according to the acquired parameter data in this step includes: analyzing the parameter data by adopting a pre-trained Logistic regression model; and obtaining quality indexes according to the analysis result. The Logistic regression model can be trained in advance according to data and results obtained by combining codes for a plurality of times.
In the exemplary embodiment, optionally, the pre-trained Logistic regression model may be a two-class model or a multi-class model. When the Logistic regression model is a two-class model, the quality index output after the parameter data is analyzed according to the Logistic regression model corresponds to one of two-class results, for example, 0 and 1, wherein 0 indicates that the influence degree or impact of the current integrated code on version stability is smaller, and code test is not needed again; 1 indicates that the current integrated code has a larger influence degree or impact on version stability, and code test needs to be performed again, and of course, other forms of classification results which indicate opposite types, such as big and small, high and low, yes and no, and the like, can also be output. It can be appreciated that the quality index accuracy and reliability obtained using the method of this embodiment is higher.
When the Logistic regression model is a multi-classification model, one of the quality indexes corresponding to the multi-classification results, such as one of 0, 1, 2, 3 and the like, which is output after the parameter data is analyzed according to the Logistic regression model, wherein 0 indicates that the current integrated code has smaller influence degree or impact on version stability, and code test is not needed again; 1. 2 and 3 indicate that the current incorporated code has a large degree of influence or impact on version stability, code testing needs to be performed again, and the degree of influence or impact types indicated by 1, 2 and 3 are different.
In another exemplary embodiment, the evaluating the quality index of the integrated code according to the acquired parameter data in this step includes: quantizing each item of data in the parameter data; and calculating the weighted sum of the quantized parameter data according to the preset weight parameters to obtain the quality index. Wherein quantization means that the values of the respective parameter data are converted to have the same units and/or orders of magnitude, quantization may be achieved, for example, by calculating the percentage of the respective parameter data relative to the corresponding base data.
In this exemplary embodiment, the obtained quality index may be calculated by performing weighted sum calculation, that is, the value corresponding to the calculation result represents the influence degree of the synthesized code on the version stability, for example, the calculation result with a defined value smaller than a specific value represents the influence degree or impact of the synthesized code on the version stability is smaller, the code test is not required to be performed again, the calculation result with a defined value greater than or equal to the specific value represents the influence degree or impact of the synthesized code on the version stability is greater, the code test is required to be performed again, and the greater the value is, the greater the influence degree is; the value range to which the value corresponding to the calculation result belongs may be used to indicate the influence degree of the integrated code on the version stability, for example, the calculation result defining the value belonging to the first value range may be used to indicate that the influence degree or impact of the integrated code on the version stability is small, the code test is not required to be performed again, the calculation result defining the value belonging to the second value range (even the third value range and the fourth value range) may be used to indicate that the influence degree or impact of the integrated code on the version stability is large, the code test is required to be performed again, and different value ranges correspond to different influence degrees. It will be appreciated that by setting a suitable numerical range, the algorithm model corresponding to this embodiment may be a classification model or a multi-classification model.
In yet another exemplary embodiment, the evaluating the quality index of the integrated code according to the acquired parameter data in this step includes: sequentially judging the size relation of each item of data in the parameter data relative to a preset threshold value, and determining the change level of each item of data according to a judging result; and calculating the weighted sum of the change levels of each item of data according to the preset weight parameters to obtain the quality index. The size relation of each item of data relative to the preset threshold value comprises a difference value or duty ratio information of each item of data relative to the preset threshold value; each change level corresponds to one or more difference values or duty ratio information in a numerical range, and the embodiment can respectively represent the influence degree of each parameter data based on the change level.
In this exemplary embodiment, the obtained quality index may be calculated by performing weighted sum calculation, that is, the value corresponding to the calculation result represents the influence degree of the synthesized code on the version stability, for example, the calculation result with a defined value smaller than a specific value represents the influence degree or impact of the synthesized code on the version stability is smaller, the code test is not required to be performed again, the calculation result with a defined value greater than or equal to the specific value represents the influence degree or impact of the synthesized code on the version stability is greater, the code test is required to be performed again, and the greater the value is, the greater the influence degree is; the value range to which the value corresponding to the calculation result belongs may be used to indicate the influence degree of the integrated code on the version stability, for example, the calculation result defining the value belonging to the first value range may be used to indicate that the influence degree or impact of the integrated code on the version stability is small, the code test is not required to be performed again, the calculation result defining the value belonging to the second value range (even the third value range and the fourth value range) may be used to indicate that the influence degree or impact of the integrated code on the version stability is large, the code test is required to be performed again, and different value ranges correspond to different influence degrees. It will be appreciated that by setting a suitable numerical range, the algorithm model corresponding to this embodiment may be a classification model or a multi-classification model.
And 330, judging whether the detected code needs to be subjected to code test again according to the category to which the quality index belongs.
In this step, the categories to which the quality indicators belong include a first category and at least one second category. When the quality index corresponds to the first category, judging that the detected code does not need to be subjected to code testing again; when the quality index corresponds to at least one second category, it is determined that the detected code needs to be subjected to code testing again.
It will be appreciated that in one example, in a two-class analytical model, the number of second classes is one. At this time, when it is determined that the detected code needs to be tested again, that is, when the obtained second index corresponds to the second category, the system or related personnel can realize retesting of the combined code according to the preset test item and test case; and the related personnel can select test items and test cases according to the type of the current combined code so as to realize retesting of the combined code.
It will be appreciated that in another example, in a multi-class analytical model, the number of second classes is a plurality. At this time, when it is determined that the detected code needs to be subjected to the code test again, that is, when the obtained second index corresponds to the second class, the system may directly determine a test item of the detected code that needs to be subjected to the test again according to the second class actually corresponding to the quality index; and directly determining the test case when the detected code needs to be tested again according to the second category actually corresponding to the quality index, and providing the test case for related personnel for reference. Therefore, the intelligent degree in the process of testing again can be provided, unnecessary time waste is reduced, and the testing efficiency is improved, namely the influence of timeliness on release of the version is reduced.
In the embodiment of the present application, when the test is performed again, the test items to be performed by the detected code include at least one of a special test, an integrated test and a system test, and the test cases used are at least partially different from the test cases used in the automated CI detection, for example, include test cases that cannot be realized by automation.
The special test is mainly used for verifying and testing the functions corresponding to one or more code modules in the combined code and relevant sweep influence test according to the test cases; the integrated test is mainly used for testing the exchange channels or interfaces among different code modules according to test cases; the system test is mainly used for verifying and testing the basic functions, performance, stability and the like of the synthesized code version according to the test cases. Wherein, each test item is at least partially different from the corresponding test case. It can be understood that the special test and the integrated test are both equivalent to the test performed on the functional points of the code module, and the disassembly test needs to be performed on the code to be integrated when the test is performed again.
And 220, when the detected code is judged not to need to be subjected to code testing again, or the detected code is subjected to code testing again, code merging is performed to realize version updating.
In this step, when it is determined that the detected code does not need to be subjected to code testing again, or after all the test items and test cases of the detected code that need to be subjected to code testing again pass, it indicates that the currently incorporated code has no or less impact risk on the current version, and in the safety range, the code can be incorporated at this time to realize version update and release a new version.
Further, when the code test performed again by the detected code is in a failed state, the impact risk of the currently-incorporated code on the current version is large, and the currently-incorporated code needs to be returned to a developer for modification, or returned to a tester for test again.
According to the embodiment of the application, after the CI detection is automated, an intelligent algorithm model is introduced to judge the quality of each code, whether the detected code needs to be subjected to code test again is judged according to the judging result, for example, the category to which the determined quality index belongs, and when the detected code needs to be subjected to code test again, the test item and the test case to be subjected to the code detection can be selected according to the judging result, so that all the test items are not required to be performed on each code, the version stability of the code can be greatly improved, the test workload can be greatly reduced on the basis of ensuring the version stability, and further the management cost is lower and the timeliness is stronger through optimizing the code management flow.
It should be noted that the technical solution of the present application may be applied to a dual-mode chip, such as a WIFI (WIreless Fidelity ) or BLE (Bluetooth Low Energy, bluetooth low energy) scenario, but the present application is not limited thereto, and the technical solution disclosed in the embodiments of the present application may be applied only in an application scenario involving program code management.
An embodiment of the present application further provides a code management apparatus, as shown in fig. 4, including: a judging unit 1 and a code merging unit 2.
Wherein the judging unit 1 receives the verification request and judges whether the detected code needs to be subjected to the code test again in response to the verification request.
The code merging unit 2 is configured to perform code merging to implement version updating when it is determined that the detected code does not need to be subjected to code testing again, or the detected code passes the code testing again.
In an exemplary embodiment, the code management apparatus further includes a test unit, where the test unit is configured to, when it is determined that the detected code needs to be tested again, generate a trigger signal according to the determination result by the determination unit 1, or perform a corresponding code test on the combined code again according to an instruction signal provided by the relevant tester, and return a corresponding test result after the test is completed.
In specific implementation, each module/unit in the code management apparatus of this embodiment may be implemented as a separate entity, or may be implemented as the same entity or several entities in any combination. Meanwhile, the specific implementation of each module/unit in the above-described code management apparatus may refer to the code management method embodiment in any of the foregoing embodiments, which is not described herein again.
An embodiment of the present application further provides an electronic device, as shown in fig. 5, including a processor 60 and a memory 50 storing a computer program, where the processor 60 can implement the code management method according to any embodiment of the present application when executing the computer program.
In particular, any of the implementations described above with reference to flowcharts may be implemented as computer software programs in accordance with the disclosed embodiments of the application. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method shown in the flow chart. In such embodiments, the computer program may be downloaded and installed from a network via a communication portion, and/or installed from a removable medium. The above-described functions defined in the system of the present application are performed when the computer program is executed by a Central Processing Unit (CPU).
The computer readable medium shown in the present application may be a computer readable signal medium or a computer readable storage medium, or any combination of the two. The computer readable storage medium includes, for example, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples of the computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present application, however, the computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, with the computer-readable program code embodied therein. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units or modules involved in the embodiments of the present application may be implemented in software or in hardware. The described units or modules may also be provided in a processor. Wherein the names of the units or modules do not in some cases constitute a limitation of the units or modules themselves.
As another aspect, the present application also provides a computer-readable medium that may be contained in the apparatus described in the above embodiments; or may be present alone without being fitted into the device. The computer readable medium carries one or more programs which, when executed by one such device, implement the code management method described in any of the embodiments of the present application.
Finally, it should be noted that: it is apparent that the above examples are only illustrative of the present application and are not limiting of the embodiments. Other variations or modifications of the above teachings will be apparent to those of ordinary skill in the art. It is not necessary here nor is it exhaustive of all embodiments. And obvious variations or modifications thereof are contemplated as falling within the scope of the present application.
Claims (12)
1. A code management method, comprising:
receiving a verification request, and responding to the verification request to judge whether the detected code needs to be subjected to code test again;
and when the detected code is judged not to need to be subjected to code testing again, or the detected code is subjected to code testing again, code merging is performed to realize version updating.
2. The code management method of claim 1, wherein the code management method further comprises:
static detection and automatic continuous integrated detection are carried out on codes,
and the verification request is obtained according to the automatic continuous integrated detection result.
3. The code management method according to claim 1 or 2, wherein the determining whether the detected code needs to be code tested again in response to the check request comprises:
acquiring parameter data after temporarily integrating codes in response to the verification request;
evaluating a quality index of the integrated code according to the parameter data, wherein the quality index represents the influence degree of the integrated code on version stability;
judging whether the detected code needs to be subjected to code test again according to the category to which the quality index belongs.
4. A code management method according to claim 3, wherein the parameter data comprises at least one of:
version size change, version remaining memory change, total modification file number, total modification point number, total modification range size, total modification content reference number, single file maximum modification ratio, single file maximum modification point number, single file modification range size, and single file content maximum application number.
5. A code management method according to claim 3, wherein said evaluating a quality index of an incorporated code from said parameter data comprises:
analyzing the parameter data by adopting a pre-trained Logistic regression model;
and obtaining the quality index according to the analysis result.
6. A code management method according to claim 3, wherein said evaluating a quality index of an incorporated code from said parameter data comprises:
quantizing each item of data in the parameter data;
and calculating the weighted sum of the quantized parameter data according to a preset weight parameter to obtain the quality index.
7. A code management method according to claim 3, wherein said evaluating a quality index of an incorporated code from said parameter data comprises:
sequentially judging the size relation of each item of data in the parameter data relative to a preset threshold value, and determining the change level of each item of data according to a judging result;
and calculating the weighted sum of the change levels of each item of data according to preset weight parameters to obtain the quality index.
8. The code management method of any of claims 3-7, wherein when it is determined that the detected code requires code testing again, further comprising performing at least one of:
determining test items to be tested again according to the second category corresponding to the quality index;
and determining the test cases when the test needs to be performed again according to the second category corresponding to the quality index.
9. The code management method of claim 8, wherein the test items include at least one of a proprietary test, an integrated test, and a system test.
10. A code management apparatus, comprising:
a judging unit for judging whether the detected code needs to be subjected to code test again in response to the verification request;
and the code merging unit is used for merging codes to realize version updating after judging that the detected codes do not need to be subjected to code testing again or the detected codes pass the code testing again.
11. An electronic device, comprising: a processor and a memory storing a computer program, wherein the processor is capable of implementing the code management method according to any of claims 1-9 when executing the computer program.
12. A computer readable storage medium storing a computer program, wherein the computer program, when executed by a processor, is capable of implementing the code management method according to any of claims 1-9.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310632785.3A CN116860314A (en) | 2023-05-30 | 2023-05-30 | Code management method, device, electronic equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310632785.3A CN116860314A (en) | 2023-05-30 | 2023-05-30 | Code management method, device, electronic equipment and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN116860314A true CN116860314A (en) | 2023-10-10 |
Family
ID=88227562
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202310632785.3A Pending CN116860314A (en) | 2023-05-30 | 2023-05-30 | Code management method, device, electronic equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN116860314A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117786666A (en) * | 2024-02-26 | 2024-03-29 | 九音科技(南京)有限公司 | Function code starting verification method and device, electronic equipment and storage medium |
-
2023
- 2023-05-30 CN CN202310632785.3A patent/CN116860314A/en active Pending
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117786666A (en) * | 2024-02-26 | 2024-03-29 | 九音科技(南京)有限公司 | Function code starting verification method and device, electronic equipment and storage medium |
CN117786666B (en) * | 2024-02-26 | 2024-05-31 | 九音科技(南京)有限公司 | Function code starting verification method and device, electronic equipment and storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US9710257B2 (en) | System and method to map defect reduction data to organizational maturity profiles for defect projection modeling | |
CN108804326B (en) | Automatic software code detection method | |
CN105279084A (en) | Defect localization in software integration tests | |
CN116860314A (en) | Code management method, device, electronic equipment and storage medium | |
CN110727437A (en) | Code optimization item acquisition method and device, storage medium and electronic equipment | |
CN111860698A (en) | Method and device for determining stability of learning model | |
CN117331836A (en) | Evaluation method based on code syntax tree analysis | |
CN114968817A (en) | Method, device, equipment and storage medium for evaluating code change influence range | |
CN114490413A (en) | Test data preparation method and device, storage medium and electronic equipment | |
CN112783513B (en) | Code risk checking method, device and equipment | |
CN116401113B (en) | Environment verification method, device and medium for heterogeneous many-core architecture acceleration card | |
CN116054910B (en) | Fault analysis and device for earth station equipment based on knowledge graph construction | |
CN112559369A (en) | Automatic testing method, automatic testing equipment and storage medium | |
CN110716859A (en) | Method for automatically pushing test cases for modified codes and related device | |
CN116627804A (en) | Test method, system, electronic equipment and storage medium based on artificial intelligence | |
CN113791980B (en) | Conversion analysis method, device and equipment for test cases and storage medium | |
Yan et al. | Revisiting the correlation between alerts and software defects: A case study on myfaces, camel, and cxf | |
CN114564391A (en) | Method and device for determining test case, storage medium and electronic equipment | |
CN113282504A (en) | Incremental code coverage rate detection method and service development method and device | |
CN113656321A (en) | Automated testing method, system, device and medium | |
CN113590484A (en) | Algorithm model service testing method, system, equipment and storage medium | |
CN113434408B (en) | Unit test case sequencing method based on test prediction | |
CN116704248B (en) | Serum sample image classification method based on multi-semantic unbalanced learning | |
CN116383068B (en) | Quick test method, device and storage medium of C++ program interface | |
CN118445214B (en) | Code file modification-based method, device, equipment, medium and product for obtaining measurement |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |