Software testing method, system and equipment, storage medium and program product

By configuring the Post-Commit script in SVN, the Jenkins task is automatically triggered, and the MIL model in-loop testing of the automotive software is carried out, which solves the delivery delay and resource waste caused by existing manual testing methods, and realizes automated testing, improving efficiency and reliability.

CN120144472APending Publication Date: 2025-06-13CHERY AUTOMOBILE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510320910.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-18
Publication Date
2025-06-13

AI Technical Summary

Technical Problem

Existing automotive software testing methods rely on manual testing, which makes it difficult to coordinate between development and testing, which can easily lead to delayed delivery time, and manual testing is difficult to maintain and waste resources.

Method used

By configuring the Post-Commit script in SVN, the Jenkins task is automatically triggered, the uploaded model source code is carried out in-ring tests, and a test report is generated, reducing manual operations of the test engineer.

Benefits of technology

The automated software testing process is realized, which reduces the workload of test engineers, improves testing efficiency, reduces testing costs, and enhances testing reliability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120144472A_ABST
    Figure CN120144472A_ABST
Patent Text Reader

Abstract

The invention discloses a software testing method, system and device, a storage medium and a program product, and the method comprises the steps: carrying out the deployment of an SVN, and uploading a model source code, a corresponding test case and a corresponding test project to the SVN; and a Post-Commit script configured in the SVN is utilized to trigger a Jenkins task, the Jenkins task performs an MIL model in-loop test on the uploaded model source code according to the corresponding test case and the test project, and a test report is generated. According to the method, the Jenkins task is triggered by utilizing the Post-Commit script, so that the automatic test of the model source code is realized, the test quality is improved, the test reliability is enhanced, meanwhile, the cost of the test task can be reduced, and human resources are saved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of software testing, and in particular to software testing methods, systems, devices, storage media, and program products. Background Art

[0002] Existing automotive software testing generally relies on manual testing by test engineers. After the development engineer uploads the code, the test engineer needs to manually pull the code and manually test the code. Often, the development engineer has updated the code, but the test engineer fails to detect and start the testing work in a timely manner, resulting in a delay in the delivery time, affecting the overall efficiency. At the same time, manual testing is difficult to maintain and wastes resources.

[0003] Therefore, there is an urgent need for a software testing method that can improve the testing quality and increase the testing reliability. Summary of the Invention

[0004] The object of the present invention is to provide automotive software testing methods, systems, devices, storage media, and program products, which can solve the problems of the existing technology, improve the testing quality, enhance the testing reliability, and at the same time reduce the cost of testing tasks and save human resources.

[0005] To achieve the above object, the present invention provides the following technical solutions:

[0006] In a first aspect, an embodiment of the present invention provides a software testing method, the method comprising:

[0007] Deploy SVN, and upload the model source code, corresponding test cases, and test projects to SVN;

[0008] Trigger a Jenkins task using the Post-Commit script configured in SVN, and the Jenkins task performs a MIL model-in-the-loop test on the uploaded model source code according to the corresponding test cases and test projects, and generates a test report.

[0009] In a second aspect, an embodiment of the present invention provides a software testing system, the system comprising:

[0010] A deployment unit for deploying SVN and uploading the model source code, corresponding test cases, and test projects to SVN;

[0011] A testing unit for triggering a Jenkins task using the Post-Commit script configured in SVN, and the Jenkins task performs a MIL model-in-the-loop test on the uploaded model source code according to the corresponding test cases and test projects, and generates a test report.

[0012] In a third aspect, an embodiment of the present invention further provides an electronic device, including a memory, a processor, and a computer program stored on the memory. The processor executes the computer program or instructions to implement the foregoing software testing method.

[0013] In a fourth aspect, an embodiment of the present invention further provides a computer storage medium, in which a computer program or instructions are stored. When the computer program or instructions are executed by a processor, the foregoing software testing method is implemented.

[0014] In a fifth aspect, an embodiment of the present invention further provides a computer program product, including a computer program or instructions. When the computer program or instructions are executed by a processor, the foregoing software testing method is implemented.

[0015] Technical effects and advantages of the present invention: By configuring a post-commit script file in SVN and writing corresponding code in the post-commit script file to trigger a configured Jenkins task; when a staff member uploads model source code to the SVN source code repository, the post-commit script file will automatically trigger the Jenkins task to perform a MIL model-in-the-loop test on the model source code and generate a corresponding test report and send it to the test engineer, reducing the workload of the test engineer for manually pulling the model and manually testing the model, greatly saving resources, and improving the test efficiency.

[0016] Other features and advantages of the present invention will be described in the following specification, and, in part, will be obvious from the specification, or will be understood by implementing the present invention. The objectives and other advantages of the present invention can be realized and obtained through the structures pointed out in the specification, claims, and drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the following drawings are only some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.

[0018] Figure 1 It is a flowchart of a software testing method according to an embodiment of the present invention;

[0019] Figure 2 It is a detailed flowchart of SVN deployment in an embodiment of the present invention;

[0020] Figure 3 It is a flowchart of Jenkins pipeline deployment in an embodiment of the present invention;

[0021] Figure 4 It is the overall flowchart of the software testing method in the embodiments of the present invention;

[0022] Figure 5 It is the structural schematic diagram of a software testing system in the embodiments of the present invention;

[0023] Figure 6 It is the structural schematic diagram of an electronic device in the embodiments of the present invention. Detailed implementation manners

[0024] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.

[0025] To solve the deficiencies of the prior art, the embodiments of the present invention disclose a software testing method based on a CICD platform, as Figure 1 shown, which includes the following steps:

[0026] Step S1: Deploy SVN, and upload the model source code, as well as the corresponding test cases and test projects, to SVN;

[0027] Step S2: Use the Post-Commit script configured in SVN to trigger a Jenkins task, perform a MIL model-in-the-loop test on the uploaded model source code, and generate a test report.

[0028] In some specific embodiments, Step S1: Deploy SVN, and upload the model source code, as well as the corresponding test cases and test projects, to SVN, including the following content:

[0029] Step S11: Deploy SVN on CentOS, as Figure 2 shown, specifically including:

[0030] Build an SVN server, install the SVN server and the SVN client, and configure SVN so that subsequent submission of the model source code on the client can automatically trigger a Jenkins task. Among them, building the SVN server includes establishing an SVN repository; the SVN repository includes an SVN test repository and an SVN source code repository.

[0031] In some specific embodiments, configuring SVN includes the following content:

[0032] (1) Install Jenkins (referring to the Jenkins integration tool) on CentOS and complete the deployment of the Jenkins pipeline: Install and configure Jenkins to ensure that Jenkins is installed and can run normally; then use the Jenkins integration tool to create a Jenkins task and configure SVN source code management.

[0033] <1> Install Jenkins and complete the deployment of the Jenkins pipeline. As Figure 3 shown, it specifically includes: setting up the Jenkins server, configuring the Jenkins environment, configuring the Windows machine node, and deploying the Jenkins pipeline task.

[0034] Among them, configuring the Jenkins environment includes: downloading the Jenkins installation package and uploading it to the Jenkins server, installing Jenkins, Java, and Jenkins-related plugins; after installing and deploying Jenkins, operate Jenkins through the web interface provided by Jenkins, and for special scenarios, operate Jenkins through the command line. Among them, Jenkins-related plugins include the SVN plugin and the MATLAB Plugin plugin.

[0035] <2> After configuring the Windows machine node, you can start the agent by using jenkins-agent.jnlp to start the node, then determine the working directory of Jenkins on Windows through the configuration of the Windows machine node, and then create a Jenkins pipeline task.

[0036] Among them, starting the agent by using jenkins-agent.jnlp to start the node means starting and connecting to the Jenkins agent node through the JNLP (Java Network Launch Protocol) protocol. This method allows the Jenkins master node to communicate with the agent node on the Windows machine in order to execute builds, tests, or other tasks in the Windows environment. Among them, the Jenkins master node usually runs on the server and is responsible for managing and scheduling build tasks; the agent node (or slave node) can run on different operating systems (such as Windows) and is used to execute tasks assigned from the master node.

[0037] The creation of the Jenkins pipeline task includes three parts: creating a new pipeline project, defining the pipeline script, and building and testing.

[0038] Among them, the file jenkins-agent.jnlp contains all the necessary information required to connect to the Jenkins master node (such as the URL of the Jenkins master node, node name, working directory, etc.);

[0039] The startup of jenkins-agent.jnlp includes the following process: find the agent configuration item in the system settings of Jenkins and check the option to allow the agent to connect to the computer; then use the Java command-line tool to start.

[0040] Determine the working directory of Jenkins on Windows through the configuration of the Windows machine node, specifically including: enter the node management page of Jenkins, then create a new node or edit the node for node configuration, and specify the working directory of the node through the remote working directory field in the node configuration (for example, it can be set to C:\jenkins_home or any other path).

[0041] <3>Deploy Jenkins pipeline tasks, including: create a new pipeline project in Jenkins and configure the basic information of the pipeline project, then create a pipeline script to define the deployment process of the entire Jenkins pipeline, and define the build of the pipeline tasks in the pipeline script (including code compilation, automated MIL testing, automatically sending test results to engineers, etc.).

[0042] Among them, creating Jenkins pipeline tasks includes two types (creating freestyle tasks and creating pipeline tasks); among them, freestyle tasks respectively implement the pulling of the SVN model source code and the invocation of the MATLAB tool Run MATLABTests to perform MIL model-in-the-loop testing on the model. In the pipeline task, scripts are written to organize and orchestrate multiple activities such as pulling the model source code, invoking the MATLAB tool, generating test reports, and sending emails to engineers.

[0043] (2) Configure the SVN receive hook: log in to the SVN server to find the root directory of the SVN repository, configure the post-commit script file in the root directory of the SVN repository, and add the trigger path of the Jenkins task in the post-commit script file; among them, the post-commit script file is the hook program, which is to modify the SVN server software configuration file and can synchronize the test cases and model source code uploaded by the SVN client to the specified directory in the SVN server.

[0044] Among them, configuring the post-commit script file in the root directory of the SVN repository specifically includes:

[0045] Log in to the SVN server and find the hooks directory of the SVN repository. The hooks directory is usually located under the root directory of the SVN repository. Find a file named post-commit.tmpl (this file is a template file) under the hooks directory of the SVN repository. Then, based on this template file, use a text editor to copy the post-commit.tmpl template file, save the copied file as post-commit, and ensure that it is executable.

[0046] And add the trigger path of the Jenkins task to the post-commit script file, specifically including:

[0047] Download the executable file for calling the remote access interface API or command-line interface API of Jenkins (for example, download the jenkins-cli.jar file), so that the post-commit script can interact with the Jenkins server through the remote access interface API or command-line interface API, complete the addition of the trigger path of the Jenkins task, and implement the triggering of the Jenkins task by the post-commit script.

[0048] (3) Test configuration:

[0049] Submit some changes in the SVN client to SVN for test run, check whether Jenkins has triggered the corresponding task to verify whether the Jenkins task can be triggered normally, and at the same time, the build history can be viewed on the task page of Jenkins.

[0050] Step S12: Establish two repositories (i.e., the test repository and the source code repository) on the SVN server to obtain the SVN test repository and the SVN source code repository. Then, the tester uploads the written MIL test cases and the configured test project to the test repository through the SVN client, and the developer uploads the model source code to the source code repository through the SVN client.

[0051] In some specific embodiments, Step S2: Use the Post-Commit script configured in SVN to trigger the Jenkins task, perform the MIL model-in-the-loop test on the uploaded model source code, and generate a test report, including the following content:

[0052] When developers upload the model source code to the SVN source code repository, the SVN source code repository automatically executes the Post-Commit script; during the execution of the Post-Commit script, the corresponding code written in the Post-Commit script triggers the Jenkins task configured in the Post-Commit script, enabling the Jenkins task to automatically pull the newly uploaded model source code for in-loop testing of the MIL model and generate a test report to be sent to the test engineer.

[0053] Among them, the principle that the Jenkins task automatically pulls the newly uploaded model source code in SVN mainly relies on the plugin system of Jenkins and the SVN client.

[0054] In some specific embodiments, enabling the Jenkins task to automatically pull the newly uploaded model source code for in-loop testing of the MIL model and generate a test report to be sent to the test engineer includes the following:

[0055] (1) The Jenkins task automatically pulls the newly uploaded model source code, specifically including:

[0056] Jenkins interacts with the SVN server through a dedicated plugin (Subversion Plugin, i.e., SVN plugin); when the Jenkins build task is executed, the SVN plugin connects Jenkins to the SVN server according to the Jenkins configuration information and verifies the user identity on the SVN server side; the Jenkins task pulls the newly uploaded model source code through the SVN server according to the configured trigger path and stores the newly uploaded model source code in the Jenkins workspace.

[0057] Among them, verifying the user identity includes:

[0058] (1) Set user credential information: Find the global credentials in the credential management of Jenkins, then add credentials on the global credentials page, select the credential type of username and password (for example, select "SVN" as the credential type of username and password), then fill in the credential information (i.e., enter the user name, password, ID, etc. of the SVN repository) and save it. When configuring the Jenkins project, use the saved credential information where the SVN repository address is required.

[0059] (2) Use the SVN plugin to verify the user identity: Enter the SVN username and password when user identity verification is required.

[0060] (2) The Jenkins task conducts in-loop testing of the MIL model on the pulled model source code and generates a test report to be sent to the test engineer, specifically including:

[0061] After being triggered, the Jenkins task will build the Run MATLAB Tests task. The Jenkins task interacts with MATLAB based on the installed MATLAB Plugin to call the Matlab tool to perform the MIL model-in-the-loop test on the pulled model source code, and generate a test report which is sent to the test engineer by email.

[0062] After viewing the test report, the test engineer can promptly modify the problematic model source code, and then upload the modified model source code to the SVN source code repository through the SVN client. Then the SVN source code repository will automatically execute the Post-Commit script again, triggering the Jenkins task configured in the Post-Commit script, causing the Jenkins task to automatically pull the newly uploaded model source code for the MIL model-in-the-loop test and generate a test report again and send it to the test engineer, thus forming a closed loop and effectively avoiding errors.

[0063] The core of the CICD platform is continuous integration and continuous deployment. Through continuous integration, developers can frequently integrate their code into the common code repository, and immediately build a test task to test the code after submitting new code, which can improve the iteration efficiency and software quality, facilitate deployment, and enable quick delivery for easy management. Continuous deployment means that the code passing the test can be automatically deployed to the production environment for users to use.

[0064] The commonly used tool for building the CICD platform is Jenkins. Jenkins is a continuous integration tool developed based on Java with a user-friendly operation interface. It can monitor errors in the integration in real time, provide detailed log files and reminder functions. Jenkins is mainly used to automate various tasks, such as software building, testing, and deployment, etc.; Jenkins can monitor continuously repetitive work, enabling continuous integration and continuous deployment of software projects.

[0065] Therefore, as Figure 4 shown, the present invention configures a post-commit script file in SVN and writes corresponding code in the post-commit script file to trigger the configured Jenkins task; when the staff uploads the model source code to the SVN source code repository, the Jenkins task will be automatically triggered by the post-commit script file to perform the MIL model-in-the-loop test on the model source code and generate a corresponding test report which is sent to the test engineer, realizing automatic pulling and testing of the code, replacing and reducing the workload of the test engineer for manually pulling the model source code and manually testing the model, greatly saving resources and improving the test efficiency.

[0066] Based on the same inventive concept, an embodiment of the present invention discloses a software testing system, as Figure 5 shown, including:

[0067] A deployment unit, configured to deploy SVN and upload model source code, corresponding test cases, and test projects to SVN;

[0068] A testing unit, configured to trigger a Jenkins task by using a Post-Commit script configured in SVN, and the Jenkins task performs a MIL model-in-the-loop test on the uploaded model source code according to the corresponding test cases and test projects, and generates a test report.

[0069] Regarding the system in the above embodiments, the specific manners in which each unit module performs operations have been described in detail in the embodiments related to the method, and will not be elaborated herein.

[0070] Based on the same inventive concept, an embodiment of the present invention further provides an electronic device, the structure of which is as Figure 6 shown, including a memory, a processor, and a computer program stored on the memory, and the processor executes the computer program or instruction to implement the foregoing software testing method.

[0071] Based on the same inventive concept, an embodiment of the present invention further provides a computer storage medium, in which a computer program or instruction is stored, and when the computer program or instruction is executed by a processor, the foregoing software testing method is implemented.

[0072] Based on the same inventive concept, an embodiment of the present invention further provides a computer program product, including a computer program or instruction, and when the computer program or instruction is executed by a processor, the foregoing software testing method is implemented.

[0073] Finally, it should be noted that the above are only preferred embodiments of the present invention and are not used to limit the present invention. Although the present invention has been described in detail with reference to the foregoing embodiments, for those skilled in the art, they can still modify the technical solutions recorded in the foregoing embodiments, or perform equivalent replacements on some of the technical features. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A software testing method, characterized in that: The method comprises: Deploy SVN and upload the model source code, corresponding test cases and test projects to SVN; The Post-Commit script configured in SVN is used to trigger the Jenkins task, which performs MIL model-in-the-loop testing on the uploaded model source code according to the corresponding test cases and test projects, and generates a test report.

2. A software testing method according to claim 1, characterized in that: Deploy SVN, including: Build SVN server, install SVN server and SVN client, and configure SVN; Among them, building an SVN server includes establishing an SVN warehouse; the SVN warehouse includes an SVN test warehouse and an SVN source code warehouse.

3. A software testing method according to claim 2, characterized in that: The configuration of SVN includes: Install Jenkins and complete the deployment of the Jenkins pipeline; Log in to the SVN server and find the root directory of the SVN repository. Configure the post-commit script file in the root directory of the SVN repository and add the trigger path of the Jenkins task in the post-commit script file. Perform a test run on the SVN client to verify whether the Jenkins task can be triggered normally; Among them, add the trigger path of the Jenkins task in the post-commit script file, including: Download the executable file that calls the remote access interface API or command line interface API of Jenkins, so that the post-commit script can interact with the Jenkins server through the remote access interface API or command line interface API, and trigger the Jenkins task through the post-commit script.

4. A software testing method according to claim 3, characterized in that: Install Jenkins and complete the deployment of the Jenkins pipeline, including: Build Jenkins server, configure Jenkins environment, configure Windows machine nodes, and deploy Jenkins pipeline tasks; Among them, configuring the Jenkins environment includes: Download the Jenkins installation package and upload it to the Jenkins server, and install Jenkins, Java, and Jenkins-related plug-ins. Jenkins-related plug-ins include the SVN plug-in and executable files that call Jenkins' remote access interface API or command line interface API.

5. A software testing method according to claim 2, characterized in that: Upload the model source code, corresponding test cases and test projects to SVN, including: Create a test repository and source code repository in SVN, and obtain the SVN test repository and SVN source code repository; Manually upload the MIL test cases and test projects to the SVN test repository, and upload the model source code to the SVN source code repository.

6. A software testing method according to claim 1 or 5, characterized in that: Use the Post-Commit script configured in SVN to trigger the Jenkins task to perform MIL model-in-the-loop testing on the uploaded model source code, including: When the model source code is uploaded to the SVN source code repository, the SVN source code repository automatically executes the Post-Commit script; During the execution of the Post-Commit script, the corresponding code written in the Post-Commit script triggers the Jenkins task configured in the Post-Commit script, so that the Jenkins task automatically pulls the latest uploaded model source code for MIL model-in-the-loop testing; Among them, the Jenkins task automatically pulls the latest uploaded model source code, including: Use the SVN plugin to enable Jenkins to interact with the SVN server; When Jenkins builds a task, the SVN plug-in connects Jenkins to the SVN server according to the Jenkins configuration information and verifies the user identity on the SVN server. The Jenkins task pulls the latest uploaded model source code through the SVN server according to the configured trigger path, and stores the latest uploaded model source code in the Jenkins workspace.

7. A software testing system, characterized in that: The system comprises: The deployment unit is used to deploy the SVN and upload the model source code, the corresponding test cases and the test project to the SVN; The test unit is used to trigger the Jenkins task by using the Post-Commit script configured in SVN to perform MIL model-in-the-loop testing on the uploaded model source code and generate a test report.

8. An electronic device, characterized in that: It comprises a memory, a processor and a computer program stored in the memory, wherein the processor executes the computer program or instructions to implement a software testing method as described in any one of claims 1-6.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program or instruction, and when the computer program or instruction is executed by a processor, a software testing method according to any one of claims 1 to 6 is implemented.

10. A computer program product comprising a computer program or instructions, characterized in that When the computer program or instruction is executed by a processor, a software testing method as described in any one of claims 1 to 6 is implemented.