Automated Management and Testing Methods for Programming Code and Related Equipment
By using automated code management and testing methods, and employing basic, intermediate, and advanced management rules to inspect source code, this approach solves the problem of existing technologies being unable to quickly locate and efficiently guarantee development quality. It achieves process-oriented management and inspection from source code development to compilation and execution, ensuring project delivery quality.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- CHINA PING AN PROPERTY INSURANCE CO LTD
- Filing Date
- 2022-12-08
- Publication Date
- 2026-07-31
AI Technical Summary
Existing technologies cannot quickly identify and efficiently guarantee the quality of project development during the development phase, resulting in low project delivery quality and high maintenance costs.
An automated code management and testing method is adopted, which uses primary, intermediate and advanced management rules to test the source code, determine whether it meets the integration, compilation and delivery requirements, and perform corresponding optimization at each stage.
It implements process-oriented control and detection from the source code development stage to the compilation and execution stage, making it convenient for project developers to obtain detection information as soon as possible, quickly locate and optimize the project, and ensure efficient and high-quality development.
Smart Images

Figure CN116069621B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of R&D management technology, and in particular to an automated control and testing method for programming code and related equipment. Background Technology
[0002] In businesses that combine auto insurance projects with vehicle service apps, the rush to expedite launch often leads to insufficient testing or simplistic, hasty code verification during development and processing of project requirements. This can result in lower-quality deliverables or even delayed delivery, significantly increasing subsequent modification and maintenance costs. Furthermore, the inconsistencies in coding standards and the difficulty in addressing, standardizing, and optimizing project pain points often prevent the production of efficient, high-quality projects and delivery scenarios suitable for internet products, failing to achieve the quality expected during rapid product iterations.
[0003] In existing technologies, such as CN115202722A, a method for automated integration and testing of vehicle software systems is provided. This method includes: establishing software code version branch management, establishing software code inspection rules and configuring the corresponding project repository, establishing the association between the automated compilation system and the software code repository, configuring the configuration files required by the software system, configuring the automatic compilation time and connecting the compilation server and the test server, building an automated testing and verification vehicle bench, simulating real-vehicle scenarios for automated testing, automatically analyzing test results and outputting the final report. However, this method cannot facilitate project developers to directly optimize the project in the first instance during the development phase, and it has the problem of failing to achieve rapid positioning and efficient and high-quality development assurance. Summary of the Invention
[0004] The purpose of this application is to propose an automated management and testing method for programming code and related equipment, so as to solve the problem that the existing technology cannot facilitate project developers to directly optimize the project in the first time during the development stage, and cannot achieve rapid positioning and efficient and high-quality guarantee of development quality.
[0005] To address the aforementioned technical problems, this application provides an automated control and testing method for programming code, employing the following technical solution:
[0006] A method for automated control and testing of programming code includes the following steps:
[0007] Obtain basic, intermediate, and advanced control rules from the control test rule base;
[0008] Based on the aforementioned primary control rules, detect the source code that has been developed but not compiled by project development team members on each development branch server;
[0009] Based on the detection results of the source code, it is determined whether the source code meets the integration requirements. If it does, the source code is transferred to the source code integration server and combined into integrated source code.
[0010] The integrated source code is detected on the source code integration server according to the aforementioned primary control rules;
[0011] Based on the detection results of the integrated source code, it is determined whether the integrated source code meets the compilation requirements. If it meets the compilation requirements, the integrated source code is compiled to generate executable program code.
[0012] Run the executable code and obtain the execution log;
[0013] Based on the execution log, the intermediate control rules, and the advanced control rules, determine whether the executable code meets the delivery requirements. If it does, send a delivery notification to the delivery coordinator.
[0014] Furthermore, the primary control rules include detecting unused ref references, unused components, unused variables, unused functions, and unused configuration files in the source code and integrated source code. The step of detecting uncompiled but developed source code by project development team members on each development branch server according to the primary control rules specifically includes:
[0015] The source code is examined line by line to identify all refs, components, variables, functions, and configuration files contained in the source code during the development phase.
[0016] Calculate the frequency of each of the aforementioned ref references, components, variables, functions, and configuration files in the source code.
[0017] The step of determining whether the source code meets the integration requirements based on the detection results of the source code specifically includes:
[0018] Based on the frequency values of the ref references, components, variables, functions, and configuration files appearing in the source code and the frequency thresholds corresponding to the ref references, components, variables, functions, and configuration files, it is determined whether the frequency values meet their corresponding frequency thresholds.
[0019] If the frequency value meets the corresponding frequency threshold, then the source code satisfies the integration requirements;
[0020] If the frequency value does not conform to its corresponding frequency threshold, then the source code does not meet the integration requirements.
[0021] Furthermore, the step of detecting the integrated source code on the source code integration server according to the primary control rules specifically includes:
[0022] The integrated source code is inspected line by line to identify all ref references, components, variables, functions, and configuration files contained in the integrated source code during the integration phase.
[0023] The step of determining whether the integrated source code meets the compilation requirements specifically includes:
[0024] The system identifies whether the same indicator object appears with different names in the ref references, components, variables, functions, and configuration files; if the same indicator object does not appear with different names, the integrated source code meets the compilation requirements.
[0025] If the same pointer object has different names, then the integrated source code does not meet the compilation requirements.
[0026] Furthermore, after executing the step of determining whether the source code meets the integration requirements based on the detection results of the source code, the method further includes:
[0027] If the integration requirements are not met, a modification notice will be issued to the first target development team member based on the detection results of the source code, and instructions and optimization methods will be provided for the source code that needs to be modified.
[0028] Furthermore, after executing the step of determining whether the integrated source code meets the compilation requirements based on the detection results of the integrated source code, the method further includes:
[0029] If the compilation requirements are not met, a modification notice will be issued to the second target development team members based on the detection results of the integrated source code, and instructions and optimization methods will be provided for the integrated code that needs to be modified.
[0030] Furthermore, the intermediate-level control rules include detecting size restrictions on transmitted files, displayed images, and font icons in the target code, as well as unused image data; the advanced-level control rules include detecting function execution time, file resource loading execution time, and component lazy loading time in the target code; the step of determining whether the executable code meets the delivery requirements based on the execution log, the intermediate-level control rules, and the advanced-level control rules specifically includes:
[0031] Based on the execution log and the intermediate control rules, it is determined whether the executable code needs to be optimized.
[0032] If optimization is required, the executable code will be optimized based on the test results.
[0033] Obtain the optimized executable code as the latest target code;
[0034] Based on the execution logs and the advanced control rules, check whether the latest target code meets the delivery requirements.
[0035] Furthermore, the step of detecting whether the executable code needs optimization based on the execution log and the intermediate control rules specifically includes:
[0036] Obtain the sizes of transferred files, displayed images, and font icons recorded in the executable code in the execution log;
[0037] Obtain the identification information of the images used in the executable code recorded in the execution log;
[0038] Determine whether the sizes of the transmitted files, displayed images, and font icons in the executable program code meet the corresponding data volume thresholds;
[0039] If the size of the transmitted file, displayed image, and font icon in the executable program code does not meet the corresponding data volume threshold, the size of the transmitted file, displayed image, and font icon is adjusted by data compression so that the size of the transmitted file, displayed image, and font icon meets the corresponding data volume threshold.
[0040] If the size of the file to be transmitted, the image to be displayed, and the font icon to be font in the executable program code meets the corresponding data volume threshold, then based on the preset image library and the identification information of the images used in the executable program code, it is identified whether there is any unused image data in the executable program code.
[0041] If the executable code contains unused image data, the unused image data is deleted from the image library based on the recognition result, thus completing the optimization process of the executable code.
[0042] Furthermore, the step of detecting whether the latest target code meets the delivery requirements based on the execution log and the advanced control rules specifically includes:
[0043] Obtain the execution time of functions, file resource loading execution time, and component lazy loading time recorded in the latest target code in the execution log;
[0044] Determine whether the execution time of functions, file resource loading execution time, and component lazy loading time in the target code meet the corresponding time thresholds;
[0045] If the execution time of functions, the file resource loading execution time, and the component lazy loading time in the target code meet the corresponding time thresholds, then the executable code meets the delivery requirements.
[0046] If any of the comparison items in the target code—function execution time, file resource loading execution time, or component lazy loading time—does not meet the corresponding time threshold, then the executable code does not meet the delivery requirements.
[0047] Furthermore, after performing the step of determining whether the executable code meets the delivery requirements based on the execution log, the intermediate control rules, and the advanced control rules, the method further includes:
[0048] If the delivery requirements are not met, a modification notice and performance optimization strategy document will be issued to the third target development team members based on the judgment results.
[0049] If the delivery requirements are met, the project's post-maintenance design documents will be sent to the delivery coordinator along with a delivery notification.
[0050] To address the aforementioned technical problems, this application also provides an automated control and testing device for programming code, which employs the following technical solution:
[0051] An automated control and testing device for programming code includes:
[0052] The control rule acquisition module is used to acquire primary control rules, intermediate control rules, and advanced control rules from the control test rule library;
[0053] A source code detection module is developed to detect uncompiled source code developed by project development team members on each development branch server according to the aforementioned primary control rules.
[0054] The source code integration judgment module is used to determine whether the source code meets the integration requirements based on the detection results of the source code. If the integration requirements are met, the source code is transmitted to the source code integration server and combined into integrated source code.
[0055] An integrated source code detection module is used to detect the integrated source code on the source code integration server according to the primary control rules.
[0056] The source code compilation judgment module is used to determine whether the integrated source code meets the compilation requirements based on the detection results of the integrated source code. If the compilation requirements are met, the integrated source code is compiled to generate executable program code.
[0057] The execution log acquisition module is used to run the executable program code and acquire the execution log.
[0058] The program delivery judgment module is used to determine whether the executable program code meets the delivery requirements based on the execution log, the intermediate control rules, and the advanced control rules. If the delivery requirements are met, a delivery prompt is sent to the delivery liaison personnel.
[0059] To address the aforementioned technical problems, this application also provides a computer device that employs the following technical solution:
[0060] A computer device includes a memory and a processor, wherein the memory stores computer-readable instructions, and the processor executes the computer-readable instructions to implement the steps of the above-described automated control and testing method for programming code.
[0061] To address the aforementioned technical problems, this application also provides a computer-readable storage medium, employing the technical solution described below:
[0062] A computer-readable storage medium storing computer-readable instructions, which, when executed by a processor, implement the steps of the programming code automated control and testing method described above.
[0063] Compared with the prior art, the embodiments of this application have the following main advantages:
[0064] The automated control and testing method for programming code described in this application involves detecting uncompiled source code developed by project development team members on each development branch server according to primary control rules; determining whether the source code meets integration requirements; if it does, transferring the source code to the source code integration server to form integrated source code; detecting the integrated source code; determining whether the integrated source code meets compilation requirements; if it does, compiling the integrated source code to generate executable code; running the executable code and obtaining execution logs; and, based on the execution logs, intermediate control rules, and advanced control rules, determining whether the executable code meets delivery requirements; if it does, sending a delivery notification to the delivery coordinator. This method achieves process-oriented control and testing of programming code from the source code development stage, source code integration stage, code compilation stage, and compilation execution stage, allowing project developers to obtain detection information immediately for timely project optimization, rapid identification, and ensuring efficient and high-quality development. Attached Figure Description
[0065] To more clearly illustrate the solutions in this application, the accompanying drawings used in the description of the embodiments of this application will be briefly introduced below. Obviously, the accompanying drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0066] Figure 1 This is an exemplary system architecture diagram to which this application can be applied;
[0067] Figure 2 A flowchart of an embodiment of the programming code automated control testing method according to this application;
[0068] Figure 3 yes Figure 2 A flowchart of a specific implementation of steps 202 and 203 shown;
[0069] Figure 4 yes Figure 2 A flowchart of a specific implementation of steps 204 and 205 shown;
[0070] Figure 5 A schematic diagram of the structure of an embodiment of the programming code automated control and testing device according to this application;
[0071] Figure 6 A schematic diagram of the structure of an embodiment of the computer device according to this application. Detailed Implementation
[0072] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains; the terminology used herein in the specification of the application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application; the terms "comprising" and "having," and any variations thereof, in the specification, claims, and foregoing drawings of this application, are intended to cover non-exclusive inclusion. The terms "first," "second," etc., in the specification, claims, or foregoing drawings of this application are used to distinguish different objects, not to describe a particular order.
[0073] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.
[0074] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings.
[0075] like Figure 1 As shown, system architecture 100 may include terminal devices 101, 102, and 103, a network 104, and a server 105. Network 104 serves as the medium for providing communication links between terminal devices 101, 102, and 103 and server 105. Network 104 may include various connection types, such as wired or wireless communication links, or fiber optic cables, etc.
[0076] Users can use terminal devices 101, 102, and 103 to interact with server 105 via network 104 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 101, 102, and 103, such as web browser applications, shopping applications, search applications, instant messaging tools, email clients, social media platform software, etc.
[0077] Terminal devices 101, 102, and 103 can be various electronic devices with displays and support web browsing, including but not limited to smartphones, tablets, e-book readers, MP3 players (Moving Picture Experts Group Audio Layer III), MP4 players (Moving Picture Experts Group Audio Layer IV), laptops, and desktop computers, etc.
[0078] Server 105 can be a server that provides various services, such as a backend server that supports the pages displayed on terminal devices 101, 102, and 103.
[0079] It should be noted that the automated control and testing method for programming code provided in this application is generally executed by a server / terminal device, and correspondingly, the automated control and testing device for programming code is generally installed in the server / terminal device.
[0080] It should be understood that Figure 1 The number of terminal devices, networks, and servers shown is merely illustrative. Depending on implementation needs, any number of terminal devices, networks, and servers can be included.
[0081] Continue to refer to Figure 2 A flowchart of an embodiment of the automated control testing method for programming code according to this application is shown. The automated control testing method for programming code includes the following steps:
[0082] Step 201: Obtain primary control rules, intermediate control rules, and advanced control rules from the control test rule base.
[0083] In this embodiment, the primary control rules include: detecting unused ref references, unused components, unused variables, unused functions, and unused configuration files in the source code and integrated source code.
[0084] The basic control rules make it easier for developers to find unused refs, unused components, unused variables, unused functions, and unused configuration files in the source code during the code development phase, thereby deleting useless content in the source code and ensuring the conciseness of the source code.
[0085] In this embodiment, the intermediate control rules include: detecting size restrictions on transmitted files, displayed images, and font icons in the target code, as well as unused image data.
[0086] Intermediate control rules facilitate the detection of data size related to file transfer and image display functions during code development, enabling adjustments to the transfer process. On the other hand, unused image resources can be identified, and data reduction can be performed on the project's image library to reduce the memory pressure on the image resource storage server.
[0087] In this embodiment, the transmission adjustment is mainly handled from two aspects. One aspect is that if the size of the transmitted file, displayed image, and font icon in the executable program code does not meet the corresponding data volume threshold, the size of the transmitted file, displayed image, and font icon is adjusted by data compression so that the size of the transmitted file, displayed image, and font icon meets the corresponding data volume threshold. The other aspect is that if the size of the transmitted file, displayed image, and font icon in the executable program code does not meet the corresponding data volume threshold, the upper limit threshold of the transmitted data volume of the transmission interface is adjusted so that the size of the transmitted file, displayed image, and font icon meets the corresponding data volume threshold.
[0088] In this embodiment, the advanced control rules include: detecting the execution time of functions in the target code, the execution time of file resource loading, and the lazy loading time of components.
[0089] By using advanced management rules, the execution time of functions, file resource loading, and component lazy loading in the target code are detected. This ensures quality control over the program's execution time, avoids writing too many functions with excessively long execution times during development, and improves code quality. Lazy loading, which means loading not during initialization but on demand during program execution, avoids loading too many resources during initialization, reducing server load. At the same time, loading on demand reduces the amount of data loaded at the same time, thus improving the program's loading time and reducing the chance of downtime.
[0090] Step 202: According to the primary control rules, detect the source code that the project development team members have developed but not compiled on each development branch server.
[0091] Step 203: Based on the detection results of the source code, determine whether the source code meets the integration requirements. If it does, transfer the source code to the source code integration server and combine them into integrated source code.
[0092] Continue to refer to Figure 3 , Figure 3 yes Figure 2 A flowchart of a specific implementation of steps 202 and 203 shown includes:
[0093] Step 301: Perform line-by-line inspection of the source code to filter out all ref references, components, variables, functions, and configuration files contained in the source code during the development phase;
[0094] Step 302: Calculate the frequency of each ref reference, component, variable, function, and configuration file appearing in the source code.
[0095] Step 303: Based on the frequency values of the ref references, components, variables, functions, and configuration files appearing in the source code and the frequency thresholds corresponding to the ref references, components, variables, functions, and configuration files, determine whether the frequency values meet their corresponding frequency thresholds.
[0096] Step 304: If the frequency value meets the corresponding frequency threshold, then the source code meets the integration requirements.
[0097] Step 305: If the frequency value does not conform to its corresponding frequency threshold, then the source code does not meet the integration requirements.
[0098] By detecting uncompiled code source code developed by project development team members on each development branch server, branch control is implemented before the code source code is uploaded to the Git repository. This avoids the presence of useless refs, components, variables, functions, and configuration files when development team members upload their code source code to the Git repository, ensuring that the code source code uploaded to the Git repository does not contain useless refs, components, variables, functions, and configuration files, thus guaranteeing the reliability of the code source code uploaded to the Git repository.
[0099] In this embodiment, after performing the step of determining whether the source code meets the integration requirements based on the detection results of the source code, the method further includes: if the integration requirements are not met, issuing a modification notice to the first target development team member based on the detection results, and providing modification instructions and optimization tips for the source code that needs to be modified.
[0100] In this embodiment, the first target development team member refers to the developer who needs to modify the code after performing integration requirement detection on the source code.
[0101] Based on the detection results, a modification notification is issued to the first target development team member, and modification instructions and optimization methods are provided when the notification is issued. The modification instructions specifically refer to, for example, if there is a useless variable in the source code written by the first target development team member, the line where the variable is located and optimization methods, such as deleting the variable.
[0102] Step 204: Detect the integrated source code on the source code integration server according to the primary control rules.
[0103] Step 205: Based on the detection results of the integrated source code, determine whether the integrated source code meets the compilation requirements. If it meets the compilation requirements, compile the integrated source code to generate executable program code.
[0104] Continue to refer to Figure 4 , Figure 4 yes Figure 2 A flowchart of a specific implementation of steps 204 and 205 shown includes:
[0105] Step 401: Perform line-by-line inspection on the integrated source code to filter out all ref references, components, variables, functions, and configuration files contained in the integrated source code during the integration phase;
[0106] Step 402: Identify whether the same indicator object appears with different names in the ref reference, component, variable, function, and configuration file respectively;
[0107] Step 403: If there are no cases where the same indicator object has different names, then the integrated source code meets the compilation requirements;
[0108] Step 404: If the same indicator object has different names, then the integrated source code does not meet the compilation requirements.
[0109] By performing line-by-line inspection of the integrated source code—that is, inspecting the integrated source code of the entire development team in the Git repository—it is determined whether there are cases where the same indicator object has different names. This avoids different developers manually setting various names when processing the same indicator object, which would lead to the creation of too many objects during subsequent program execution. It ensures the uniqueness of object naming when integrating code for the same indicator object and reduces the waste of resources when generating objects.
[0110] In this embodiment, after performing the step of determining whether the integrated source code meets the compilation requirements based on the detection results of the integrated source code, the method further includes: if the compilation requirements are not met, issuing a modification notice to the second target development team member based on the detection results, and providing modification instructions and optimization tips for the integrated code that needs to be modified.
[0111] In this embodiment, the second target development team member refers to the developer who needs to modify the code after performing compilation requirement detection on the integrated source code.
[0112] Step 206: Run the executable program code and obtain the execution log.
[0113] Step 207: Based on the execution log, the intermediate control rules, and the advanced control rules, determine whether the executable code meets the delivery requirements. If the delivery requirements are met, send a delivery prompt to the delivery contact person.
[0114] By testing the compiled executable program according to the execution program, intermediate control rules, and advanced control rules after code compilation, and identifying whether it meets the delivery requirements, a process-oriented control and testing of programming code is achieved from the source code development stage, source code integration stage, code compilation stage, and compilation execution stage, ensuring that high-quality programming code is provided to customers.
[0115] Currently, the basic delivery requirement is that the project is executable, and the code quality requirements are not high. However, the purpose of this application is not only to fulfill the basic delivery requirements, but also to optimize the processing of the requirements to fulfill the basic delivery requirements, so as to obtain code that meets the delivery requirements and has higher quality.
[0116] Specifically, the step of determining whether the executable code meets the delivery requirements based on the execution log, the intermediate control rules, and the advanced control rules includes: detecting whether the executable code needs optimization based on the execution log and the intermediate control rules; if optimization is required, optimizing the executable code based on the detection results; obtaining the optimized executable code as the latest target code; and detecting whether the latest target code meets the delivery requirements based on the execution log and the advanced control rules.
[0117] In this embodiment, the step of detecting whether the executable code needs optimization based on the execution log and the intermediate control rules specifically includes: obtaining the sizes of the transmitted files, displayed images, and font icons in the executable code recorded in the execution log; obtaining the identification information of the images used in the executable code recorded in the execution log; determining whether the sizes of the transmitted files, displayed images, and font icons in the executable code meet the corresponding data volume threshold; if the sizes of the transmitted files, displayed images, and font icons in the executable code do not meet the corresponding data volume threshold, then adjusting the sizes of the transmitted files, displayed images, and font icons through data compression so that the sizes of the transmitted files, displayed images, and font icons meet the corresponding data volume threshold; if the sizes of the transmitted files, displayed images, and font icons in the executable code meet the corresponding data volume threshold, then identifying whether there is unused image data in the executable code based on a preset image library and the identification information of the images used in the executable code; if there is unused image data in the executable code, then deleting the unused image data from the image library based on the identification result, thus completing the optimization of the executable code.
[0118] In this embodiment, the step of detecting whether the latest target code meets the delivery requirements based on the execution log and the advanced control rules specifically includes: obtaining the execution time of functions, file resource loading execution time, and component lazy loading time of the latest target code recorded in the execution log; determining whether the execution time of functions, file resource loading execution time, and component lazy loading time of the target code meet the corresponding time thresholds; if the execution time of functions, file resource loading execution time, and component lazy loading time of the target code meet the corresponding time thresholds, then the executable code meets the delivery requirements; if any of the comparison items among the execution time of functions, file resource loading execution time, and component lazy loading time of the target code does not meet the corresponding time thresholds, then the executable code does not meet the delivery requirements.
[0119] In this embodiment, after performing the step of determining whether the executable code meets the delivery requirements based on the execution log, the intermediate control rules, and the advanced control rules, the method further includes: if the delivery requirements are not met, issuing a modification notice and a performance optimization strategy document to the third target development team member based on the determination result; if the delivery requirements are met, sending a delivery reminder to the delivery liaison and sending the project's later maintenance design document to them at the same time.
[0120] This application, based on basic control rules, detects uncompiled source code developed by project development team members on each development branch server; determines whether the source code meets integration requirements; if so, it transfers the source code to the source code integration server for integration; detects the integrated source code; determines whether the integrated source code meets compilation requirements; if so, it compiles the integrated source code to generate executable code; runs the executable code and obtains execution logs; based on the execution logs, intermediate control rules, and advanced control rules, it determines whether the executable code meets delivery requirements; if so, it sends a delivery notification to the delivery coordinator. This achieves process-oriented control and detection of programming code from the source code development stage, source code integration stage, code compilation stage, and compilation execution stage, allowing project developers to obtain detection information immediately for timely project optimization, rapid identification, and ensuring efficient and high-quality development.
[0121] The embodiments of this application can acquire and process relevant data based on artificial intelligence technology. Artificial intelligence (AI) is the theory, method, technology, and application system that uses digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use that knowledge to obtain optimal results.
[0122] Foundational technologies for artificial intelligence generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing, operating / interactive systems, and mechatronics. AI software technologies mainly encompass computer vision, robotics, biometrics, speech processing, natural language processing, and machine learning / deep learning.
[0123] In this embodiment, the programming code can be automatically controlled and inspected in a process-oriented manner from the source code development stage, source code integration stage, code compilation stage, and compilation execution stage through the timed control of artificial intelligence model. This allows project developers to obtain inspection information as soon as possible, optimize the project in a timely manner, quickly locate problems, ensure efficient and high-quality development, and facilitate automated project management.
[0124] Further reference Figure 5 As a response to the above Figure 2 The implementation of the method shown in this application provides an embodiment of a programming code automated management and testing device, which is similar to... Figure 2 Corresponding to the method embodiments shown, this device can be specifically applied to various electronic devices.
[0125] like Figure 5 As shown, the automated programming code management and testing device 500 described in this embodiment includes: a management rule acquisition module 501, a development source code detection module 502, a source code integration judgment module 503, an integrated source code detection module 504, a source code compilation judgment module 505, an execution log acquisition module 506, and a program delivery judgment module 507. Wherein:
[0126] The control rule acquisition module 501 is used to acquire primary control rules, intermediate control rules, and advanced control rules from the control test rule library;
[0127] The source code detection module 502 is used to detect uncompiled source code developed by project development team members on each development branch server according to the primary control rules.
[0128] The source code integration judgment module 503 is used to determine whether the source code meets the integration requirements based on the detection results of the source code. If the integration requirements are met, the source code is transmitted to the source code integration server and combined into integrated source code.
[0129] An integrated source code detection module 504 is used to detect the integrated source code on the source code integration server according to the primary control rules.
[0130] The source code compilation judgment module 505 is used to determine whether the integrated source code meets the compilation requirements based on the detection results of the integrated source code. If the compilation requirements are met, the integrated source code is compiled to generate executable program code.
[0131] The execution log acquisition module 506 is used to run the executable program code and acquire the execution log.
[0132] The program delivery judgment module 507 is used to determine whether the executable program code meets the delivery requirements based on the execution log, the intermediate control rules and the advanced control rules. If the delivery requirements are met, a delivery prompt is sent to the delivery liaison personnel.
[0133] This application, based on basic control rules, detects uncompiled source code developed by project development team members on each development branch server; determines whether the source code meets integration requirements; if so, it transfers the source code to the source code integration server for integration; detects the integrated source code; determines whether the integrated source code meets compilation requirements; if so, it compiles the integrated source code to generate executable code; runs the executable code and obtains execution logs; based on the execution logs, intermediate control rules, and advanced control rules, it determines whether the executable code meets delivery requirements; if so, it sends a delivery notification to the delivery coordinator. This achieves process-oriented control and detection of programming code from the source code development stage, source code integration stage, code compilation stage, and compilation execution stage, allowing project developers to obtain detection information immediately for timely project optimization, rapid identification, and ensuring efficient and high-quality development.
[0134] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by instructing related hardware through computer-readable instructions. These computer-readable instructions can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the methods described above. The aforementioned storage medium can be a non-volatile storage medium such as a magnetic disk, optical disk, or read-only memory (ROM), or random access memory (RAM).
[0135] It should be understood that although the steps in the flowcharts of the accompanying figures are shown sequentially as indicated by the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the accompanying figures may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the sub-steps or stages of other steps.
[0136] To address the aforementioned technical problems, embodiments of this application also provide a computer device. Please refer to [link / reference needed]. Figure 6 , Figure 6 This is a basic structural block diagram of the computer device in this embodiment.
[0137] The computer device 6 includes a memory 6a, a processor 6b, and a network interface 6c that are interconnected via a system bus. It should be noted that only the computer device 6 with components 6a-6c is shown in the figure; however, it should be understood that it is not required to implement all the shown components, and more or fewer components can be implemented alternatively. Those skilled in the art will understand that the computer device described here is a device capable of automatically performing numerical calculations and / or information processing according to pre-set or stored instructions, and its hardware includes, but is not limited to, microprocessors, application-specific integrated circuits (ASICs), programmable gate arrays (FPGAs), digital signal processors (DSPs), embedded devices, etc.
[0138] The computer device can be a desktop computer, laptop, handheld computer, or cloud server, etc. The computer device can interact with the user via a keyboard, mouse, remote control, touchpad, or voice control.
[0139] The memory 6a includes at least one type of readable storage medium, including flash memory, hard disk, multimedia card, card-type memory (e.g., SD or DX memory), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, disk, optical disk, etc. In some embodiments, the memory 6a may be an internal storage unit of the computer device 6, such as the hard disk or memory of the computer device 6. In other embodiments, the memory 6a may also be an external storage device of the computer device 6, such as a plug-in hard disk, smart memory card (SMC), secure digital card (SD) card, flash card, etc. of the computer device 6. Of course, the memory 6a may include both the internal storage unit and the external storage device of the computer device 6. In this embodiment, the memory 6a is typically used to store the operating system and various application software installed on the computer device 6, such as computer-readable instructions for automated control and testing methods of programming code. In addition, the memory 6a can also be used to temporarily store various types of data that have been output or will be output.
[0140] In some embodiments, the processor 6b may be a central processing unit (CPU), controller, microcontroller, microprocessor, or other data processing chip. The processor 6b is typically used to control the overall operation of the computer device 6. In this embodiment, the processor 6b is used to execute computer-readable instructions stored in the memory 6a or to process data, for example, to execute computer-readable instructions of the automated control testing method for programming code.
[0141] The network interface 6c may include a wireless network interface or a wired network interface, which is typically used to establish communication connections between the computer device 6 and other electronic devices.
[0142] The computer equipment proposed in this embodiment belongs to the field of R&D management technology. This application detects uncompiled source code developed by project development team members on each development branch server according to primary control rules; determines whether the source code meets integration requirements; if it does, the source code is transferred to the source code integration server and combined into integrated source code; detects the integrated source code; determines whether the integrated source code meets compilation requirements; if it does, it is compiled to generate executable code; runs the executable code and obtains execution logs; based on the execution logs, intermediate control rules, and advanced control rules, determines whether the executable code meets delivery requirements; if it does, a delivery notification is sent to the delivery contact person. This achieves process-oriented control and detection of programming code from the source code development stage, source code integration stage, code compilation stage, and compilation execution stage, facilitating project developers to obtain detection information immediately for timely project optimization, rapid identification, and ensuring efficient and high-quality development.
[0143] This application also provides another embodiment, namely, providing a computer-readable storage medium storing computer-readable instructions that can be executed by a processor to cause the processor to perform the steps of the programming code automated control test method described above.
[0144] The computer-readable storage medium proposed in this embodiment belongs to the field of R&D management technology. This application detects uncompiled source code developed by project development team members on each development branch server according to primary control rules; determines whether the source code meets integration requirements; if it does, the source code is transferred to the source code integration server and combined into integrated source code; detects the integrated source code; determines whether the integrated source code meets compilation requirements; if it does, it is compiled to generate executable code; runs the executable code and obtains execution logs; based on the execution logs, intermediate control rules, and advanced control rules, determines whether the executable code meets delivery requirements; if it does, a delivery notification is sent to the delivery contact person. This achieves process-oriented control and detection of programming code from the source code development stage, source code integration stage, code compilation stage, and compilation execution stage, facilitating project developers to obtain detection information immediately for timely project optimization, rapid identification, and ensuring efficient and high-quality development.
[0145] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in the various embodiments of this application.
[0146] Obviously, the embodiments described above are only some embodiments of this application, not all embodiments. The accompanying drawings show preferred embodiments of this application, but do not limit the patent scope of this application. This application can be implemented in many different forms; rather, the purpose of providing these embodiments is to provide a more thorough and comprehensive understanding of the disclosure of this application. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions described in the foregoing specific embodiments, or make equivalent substitutions for some of the technical features. Any equivalent structures made using the content of this application's specification and drawings, directly or indirectly applied to other related technical fields, are similarly within the scope of patent protection of this application.
Claims
1. A method for programming code automated governance test, characterized in that, Includes the following steps: Obtain basic, intermediate, and advanced control rules from the control test rule base; Based on the aforementioned primary control rules, detect the source code that has been developed but not compiled by project development team members on each development branch server; Based on the detection results of the source code, it is determined whether the source code meets the integration requirements. If it does, the source code is transferred to the source code integration server and combined into integrated source code. The integrated source code is detected on the source code integration server according to the aforementioned primary control rules; Based on the detection results of the integrated source code, it is determined whether the integrated source code meets the compilation requirements. If it meets the compilation requirements, the integrated source code is compiled to generate executable program code. Run the executable code and obtain the execution log; Based on the execution log, the intermediate control rules, and the advanced control rules, it is determined whether the executable code meets the delivery requirements. If the delivery requirements are met, a delivery prompt is sent to the delivery contact person. The intermediate control rules include detecting size restrictions on transmitted files, displayed images, and font icons in the target code, as well as unused image data. The advanced control rules include detecting the execution time of functions, file resource loading execution time, and component lazy loading time in the target code. The step of determining whether the executable code meets the delivery requirements based on the execution log, the intermediate control rules, and the advanced control rules specifically includes: Based on the execution log and the intermediate control rules, the system detects whether the executable code needs optimization. Specifically, this includes: obtaining the sizes of transferred files, displayed images, and font icons recorded in the execution log; obtaining the identification information of the images used in the executable code recorded in the execution log; determining whether the sizes of transferred files, displayed images, and font icons in the executable code meet the corresponding data volume threshold; if the sizes of transferred files, displayed images, and font icons in the executable code do not meet the corresponding data volume threshold, adjusting the sizes of the transferred files, displayed images, and font icons through data compression to make them meet the corresponding data volume threshold; if the sizes of transferred files, displayed images, and font icons in the executable code meet the corresponding data volume threshold, identifying whether there is unused image data in the executable code based on a preset image library and the identification information of the images used in the executable code; if there is unused image data in the executable code, deleting the unused image data from the image library based on the identification result, thus completing the optimization of the executable code. If optimization is required, the executable code will be optimized based on the test results. Obtain the optimized executable code as the latest target code; Based on the execution logs and the advanced control rules, check whether the latest target code meets the delivery requirements.
2. The programmed code automation pipeline test method of claim 1, wherein, The primary control rules include detecting unused ref references, unused components, unused variables, unused functions, and unused configuration files in the source code and integrated source code. The steps for detecting uncompiled code source code developed by project development team members on each development branch server according to the primary control rules specifically include: The source code is examined line by line to identify all refs, components, variables, functions, and configuration files contained in the source code during the development phase. Calculate the frequency of each of the aforementioned ref references, components, variables, functions, and configuration files in the source code. The step of determining whether the source code meets the integration requirements based on the detection results of the source code specifically includes: Based on the frequency values of the ref references, components, variables, functions, and configuration files appearing in the source code and the frequency thresholds corresponding to the ref references, components, variables, functions, and configuration files, it is determined whether the frequency values meet their corresponding frequency thresholds. If the frequency value meets the corresponding frequency threshold, then the source code satisfies the integration requirements; If the frequency value does not conform to its corresponding frequency threshold, then the source code does not meet the integration requirements.
3. The automated control and testing method for programming code according to claim 2, characterized in that, The step of detecting the integrated source code on the source code integration server according to the primary control rules specifically includes: The integrated source code is inspected line by line to identify all ref references, components, variables, functions, and configuration files contained in the integrated source code during the integration phase. The step of determining whether the integrated source code meets the compilation requirements specifically includes: The system identifies whether the same indicator object appears with different names in the ref references, components, variables, functions, and configuration files; if the same indicator object does not appear with different names, the integrated source code meets the compilation requirements. If the same pointer object has different names, then the integrated source code does not meet the compilation requirements.
4. The programmed code automation pipeline test method of claim 1, wherein, After executing the step of determining whether the source code meets the integration requirements based on the detection results of the source code, the method further includes: If the integration requirements are not met, a modification notice will be issued to the first target development team member based on the detection results of the source code, and instructions and optimization methods will be provided for the source code that needs to be modified.
5. The programmed code automation pipeline test method of claim 1, wherein, After executing the step of determining whether the integrated source code meets the compilation requirements based on the detection results of the integrated source code, the method further includes: If the compilation requirements are not met, a modification notice will be issued to the second target development team members based on the detection results of the integrated source code, and instructions and optimization methods will be provided for the integrated code that needs to be modified.
6. The programmed code automation pipeline test method of claim 1, wherein, The step of detecting whether the latest target code meets the delivery requirements based on the execution log and the advanced control rules specifically includes: Obtain the execution time of functions, file resource loading execution time, and component lazy loading time recorded in the latest target code in the execution log; Determine whether the execution time of functions, file resource loading execution time, and component lazy loading time in the target code meet the corresponding time thresholds; If the execution time of functions, the file resource loading execution time, and the component lazy loading time in the target code meet the corresponding time thresholds, then the executable code meets the delivery requirements. If any of the comparison items in the target code—function execution time, file resource loading execution time, or component lazy loading time—does not meet the corresponding time threshold, then the executable code does not meet the delivery requirements.
7. The programmed code automation pipeline test method of claim 1, wherein, After performing the step of determining whether the executable code meets the delivery requirements based on the execution log, the intermediate control rules, and the advanced control rules, the method further includes: If the delivery requirements are not met, a modification notice and performance optimization strategy document will be issued to the third target development team members based on the judgment results. If the delivery requirements are met, the project's post-maintenance design documents will be sent to the delivery coordinator along with a delivery notification.
8. A device for automatically managing and controlling testing of programmed code, characterized by The automated programming code management and testing device implements the steps of the automated programming code management and testing method as described in any one of claims 1 to 7, and the automated programming code management and testing device includes: The control rule acquisition module is used to acquire primary control rules, intermediate control rules, and advanced control rules from the control test rule library; A source code detection module is developed to detect uncompiled source code developed by project development team members on each development branch server according to the aforementioned primary control rules. The source code integration judgment module is used to determine whether the source code meets the integration requirements based on the detection results of the source code. If the integration requirements are met, the source code is transmitted to the source code integration server and combined into integrated source code. An integrated source code detection module is used to detect the integrated source code on the source code integration server according to the primary control rules. The source code compilation judgment module is used to determine whether the integrated source code meets the compilation requirements based on the detection results of the integrated source code. If the compilation requirements are met, the integrated source code is compiled to generate executable program code. The execution log acquisition module is used to run the executable program code and acquire the execution log. The program delivery judgment module is used to determine whether the executable program code meets the delivery requirements based on the execution log, the intermediate control rules, and the advanced control rules. If the delivery requirements are met, a delivery prompt is sent to the delivery liaison personnel.
9. A computer device, comprising a memory and a processor, wherein the memory stores computer-readable instructions, and the processor, when executing the computer-readable instructions, implements the steps of the automated control and testing method for programming code as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-readable instructions, which, when executed by a processor, implement the steps of the automated control and testing method for programming code as described in any one of claims 1 to 7.