Automatic testing method and device based on SOC, equipment and storage medium

By generating initial test reports in Linux systems and optimizing test priorities and order, combined with virtual environment performance testing, the problems of long test cycles and insufficient resource utilization in traditional automated testing methods are solved, and an efficient testing process is achieved.

CN119271557APending Publication Date: 2025-01-07DONGFENG MOTOR GRP
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411367666.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-29
Publication Date
2025-01-07

AI Technical Summary

Technical Problem

Traditional automated testing methods can easily lead to long test cycles and system lag when executing complex test cases, and it is difficult to make full use of system resources, which cannot meet the diverse and highly customized test needs of Linux systems.

Method used

By generating an initial test report when receiving the test case sent by the server through serial communication, it performs test optimization based on the report, determines the test priority of the test case and the test order of the subtasks, and uses the target simulation tool to create a virtual environment for performance testing. Optimize the test process to improve efficiency.

Benefits of technology

It effectively avoids the problems of long test cycles and system lags, improves testing efficiency, ensures full utilization of system resources, and meets the diverse and highly customized testing needs of Linux systems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119271557A_ABST
    Figure CN119271557A_ABST
Patent Text Reader

Abstract

The invention discloses an SOC-based automatic test method, device and equipment and a storage medium, and relates to the technical field of tests.The SOC-based automatic test method comprises the steps that when a test case sent by a server through serial port communication is received and a system is in a safe environment, all subtasks in the test case are executed, and the test case is sent to the server through serial port communication; generating an initial test report; performing test optimization according to the initial test report, and determining the test priority of the test case and the test sequence of each subtask in the test case; executing each subtask in the test case according to the test priority and the test sequence, and generating a case test report; creating a virtual environment according to the target simulation tool, and performing a performance test according to the virtual environment to generate a performance test report; and obtaining a target test result according to the performance test report and the case test report. The test efficiency is improved by changing the priorities of part of tests, reordering task queues and the like.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of testing technology, and in particular to an automated testing method, device, equipment and storage medium based on SOC. Background Art

[0002] As an open source operating system kernel, the complexity and diversity of the Linux operating system make traditional manual testing methods inefficient and difficult to cover comprehensively. Most of the current automated testing technologies rely on a single testing framework, which is difficult to meet the diverse and highly customized testing requirements of the Linux system. At present, most automated testing methods for SOCs still achieve their goals by traversing test cases. This technical solution is mature and stable. It is usually tested according to the type of test cases. The testing process is not optimized too much, resulting in system delays and freezes as the number of test cases increases and the complexity of the test cases increases. System resources are not fully utilized, and the test cycle is prolonged. Therefore, how to avoid long test cycles and system freezes when executing complex test cases has become an urgent problem to be solved. Summary of the invention

[0003] The main purpose of this application is to provide a SOC-based automated testing method, device, equipment and storage medium, aiming to solve technical problems such as long test cycles and system freezes when executing complex test cases.

[0004] To achieve the above objectives, the present application proposes an automated testing method based on SOC, and the automated testing method based on SOC includes: When a test case sent by the server via serial port communication is received and the system is in a safe environment, each subtask in the test case is executed and an initial test report is generated; Performing test optimization according to the initial test report to determine the test priority of the test case and the test order of each subtask in the test case; Execute each subtask in the test case according to the test priority and the test sequence, and generate a test case test report; Creating a virtual environment according to the target simulation tool, performing performance testing according to the virtual environment, and generating a performance testing report; The target test result is obtained according to the performance test report and the use case test report.

[0005] In one embodiment, the step of performing test optimization according to the initial test report and determining the test priority of the test case and the test order of each subtask in the test case includes: Analyze the initial test report to determine the execution status and task duration corresponding to each subtask in the test case; Test optimization is performed according to a preset priority function and the execution status and task duration corresponding to each subtask in the test case, and the test priority of the test case and the test order of each subtask in the test case are determined.

[0006] In one embodiment, the step of performing test optimization according to a preset priority function and the execution status and task duration corresponding to each subtask in the test case, and determining the test priority of the test case and the test order of each subtask in the test case comprises: Determine the execution status and duration of the test case corresponding to the test case according to the execution status and task duration corresponding to each subtask in the test case; Determine the test priority of the test case according to a preset priority function, the test case execution status corresponding to the test case, and the test case time consumption; The test order of each subtask in the test case is obtained by sorting the subtasks according to the execution status and the task time consumption.

[0007] In one embodiment, the step of determining the test priority of the test case according to a preset priority function, a test case execution status corresponding to the test case, and the test case time consumption includes: Compare the test case execution status and the test case duration corresponding to the test case with the test case execution status and the test case duration corresponding to the target case to obtain a test case comparison result; The test priority of the test case is determined according to the use case comparison result and a preset priority function.

[0008] In one embodiment, the step of sorting the tasks according to the execution status and the task duration to obtain the test order of each subtask in the test case includes: Determine the dependent subtasks corresponding to each subtask according to the execution status and the task duration; Adjusting the priority of the dependent subtask according to a preset priority function to obtain a dependent priority; The test order of each subtask in the test case is obtained by sorting according to the execution status, the task time consumption and the dependency priority.

[0009] In one embodiment, the step of executing each subtask in the test case according to the test priority and the test sequence to generate a test case test report includes: When executing each subtask in the test case according to the test priority and the test order of each subtask in the test case, obtaining an initial timestamp, a target timestamp and an execution status of each subtask; A use case test report is generated according to the initial timestamp, the target timestamp and the execution status of each subtask.

[0010] In one embodiment, before the steps of creating a virtual environment according to the target simulation tool, performing a performance test according to the virtual environment, and generating a performance test report, the steps further include: Compare the test efficiency of the initial test report with the test efficiency of the use case test report; When the test efficiency of the use case test report is greater than the test efficiency of the initial test report and the test efficiency of the use case test report meets the preset test efficiency requirement, a virtual environment is created according to the target simulation tool.

[0011] In addition, to achieve the above purpose, the present application also proposes an automatic test device based on SOC, and the automatic test device based on SOC includes: A generation module, for executing each subtask in the test case and generating an initial test report when the test case is received from the server through serial port communication and the system is in a safe environment; An optimization module, used to perform test optimization according to the initial test report, and determine the test priority of the test case and the test order of each subtask in the test case; The generating module is further used to execute each subtask in the test case according to the test priority and the test sequence, and generate a test case test report; The creation module is used to create a virtual environment according to the target simulation tool, and perform performance testing according to the virtual environment to generate a performance test report; the testing module is used to obtain the target test result according to the performance test report and the use case test report.

[0012] In addition, to achieve the above-mentioned objectives, the present application also proposes a SOC-based automated testing device, the device comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, the computer program being configured to implement the steps of the SOC-based automated testing method as described above.

[0013] In addition, to achieve the above-mentioned purpose, the present application also proposes a storage medium, which is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by the processor, the steps of the SOC-based automated testing method as described above are implemented.

[0014] In addition, to achieve the above-mentioned purpose, the present application also provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, the steps of the SOC-based automated testing method as described above are implemented.

[0015] This application executes each subtask in the test case and generates an initial test report when the test case sent by the server through serial communication is received and the system is in a safe environment; performs test optimization according to the initial test report, determines the test priority of the test case and the test order of each subtask in the test case; executes each subtask in the test case according to the test priority and test order, and generates a test case test report; creates a virtual environment according to the target simulation tool, performs performance testing according to the virtual environment, and generates a performance test report; obtains the target test result according to the performance test report and the test case test report. The test efficiency is improved by changing the priority of some tests and reordering the task queue. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0017] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0018] Figure 1 A flowchart of the first embodiment of the automated testing method based on SOC of the present application is provided; Figure 2 A schematic diagram of the connection relationship of the test hardware provided in Example 1 of the SOC-based automated test method of the present application; Figure 3 A schematic diagram of the implementation flow of the test optimization module provided in the first embodiment of the automated test method based on SOC of the present application; Figure 4 A flow chart of the second embodiment of the SOC-based automated testing method provided by the present application; Figure 5 A schematic diagram of a test task optimization process provided in Example 2 of the SOC-based automated test method of this application; Figure 6 A brief flow chart of the SOC-based automated testing method provided in Example 1 of the present application; Figure 7This is a schematic diagram of the module structure of an automatic test device based on SOC according to an embodiment of the present application; Figure 8 This is a schematic diagram of the device structure of the hardware operating environment involved in the SOC-based automated testing method in the embodiment of the present application.

[0019] The purpose, features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0020] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not used to limit the present application.

[0021] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.

[0022] The main solution of the embodiment of the present application is: when a test case sent by a server through serial port communication is received and the system is in a safe environment, each subtask in the test case is executed and an initial test report is generated; test optimization is performed according to the initial test report to determine the test priority of the test case and the test order of each subtask in the test case; each subtask in the test case is executed according to the test priority and the test order, and a case test report is generated; a virtual environment is created according to a target simulation tool, and performance testing is performed according to the virtual environment to generate a performance test report; and a target test result is obtained according to the performance test report and the case test report.

[0023] As an open source operating system kernel, the complexity and diversity of the Linux operating system make traditional manual testing methods inefficient and difficult to cover comprehensively. Most of the current automated testing technologies rely on a single testing framework, which is difficult to meet the diverse and highly customized testing requirements of the Linux system. At present, most automated testing methods for SOCs still achieve their goals by traversing test cases. This technical solution is mature and stable. It is usually tested according to the type of test cases. The testing process is not optimized too much, resulting in system delays and freezes as the number of test cases increases and the complexity of the test cases increases. System resources are not fully utilized, and the test cycle is prolonged. Therefore, how to avoid long test cycles and system freezes when executing complex test cases has become an urgent problem to be solved.

[0024] This application executes each subtask in the test case and generates an initial test report when the test case sent by the server through serial communication is received and the system is in a safe environment; performs test optimization according to the initial test report, determines the test priority of the test case and the test order of each subtask in the test case; executes each subtask in the test case according to the test priority and test order, and generates a test case test report; creates a virtual environment according to the target simulation tool, performs performance testing according to the virtual environment, and generates a performance test report; obtains the target test result according to the performance test report and the test case test report. The test efficiency is improved by changing the priority of some tests and reordering the task queue.

[0025] It should be noted that the execution subject of this embodiment may be a computing service device with data processing, network communication and program running functions, such as a tablet computer, a personal computer, a mobile phone, etc., or a SOC-based automated testing device that can realize the above functions, etc. The following takes the SOC-based automated testing device as the execution subject as an example to illustrate this embodiment and the following embodiments.

[0026] Based on this, the present application embodiment provides an automated testing method based on SOC, referring to Figure 1 , Figure 1 This is a flow chart of the first embodiment of the SOC-based automated testing method of the present application.

[0027] In this embodiment, the SOC-based automated testing method includes steps S10 to S50: Step S10, when a test case sent by the server via serial port communication is received and the system is in a safe environment, each subtask in the test case is executed and an initial test report is generated; It should be noted that the connection of the test hardware in this embodiment is as follows Figure 2 As shown, there is a serial port connection between the server and the controller, and the network connection is achieved through a network switch, and the user connects to the server through the SSH service. Usually, some test cases, test scripts, test tools, etc. can be transmitted during the network connection. In the test phase, the serial port is usually used to communicate with the single board to observe the execution status of the test case. The benefit of this test environment is that it reduces the direct contact between the tester and the SOC controller, which can avoid the uncertainty caused by human factors. Secondly, it can also realize the improvement of the test method by multiple users, realize collaborative development and testing, and improve the test efficiency.

[0028] It can be understood that a test case refers to a specific set of operation steps defined in the software testing process to verify whether a specific function or behavior works as expected. A safe environment refers to the absence of potential code defects and security risks in the Linux system. An initial test report refers to the test report generated by the first automatic execution of a test case.

[0029] In the specific implementation, the user connects to the server through the SSH service. Usually, some test cases, test scripts, test tools, etc. can be transmitted during the network connection. Then the server sends the received test cases to the SOC controller through serial port communication. When the Linux system does not have potential code defects and security risks, it automatically executes each subtask in the test case for testing. Finally, a test report generated by the first automatic execution of the test case is obtained, that is, the initial test report.

[0030] Step S20, performing test optimization according to the initial test report, determining the test priority of the test case and the test order of each subtask in the test case; It can be understood that the test priority refers to the level of priority for determining the execution of test cases during the software testing process, and the test sequence refers to the test execution order of each subtask in the test case.

[0031] In the specific implementation, the main function of the test optimization module in this implementation is to change the priority of certain test cases and the order of task queues based on the analysis of test results, so as to optimize the automation process, further improve test efficiency and shorten the test cycle, that is, by analyzing the test report generated by the initial automatic execution of the test case, the priority execution level of the test case and the test execution order of each subtask in the software testing process are determined according to the analysis results.

[0032] It should be noted that the core point of this embodiment is to add a test optimization module during the automated testing of the SOC. A good software version needs to undergo continuous improvement and testing, and each small change will bring different performance and stability to the system, so it is particularly important to test the software. The test optimization module of this embodiment is mainly used to improve the situation of redundant system resources or insufficient utilization of system resources in automated testing.

[0033] Step S30, executing each subtask in the test case according to the test priority and the test sequence, and generating a test case test report; It can be understood that the use case test report refers to the test report generated by executing the optimized test case.

[0034] In a specific implementation, the test cases are re-executed according to the priority execution level of the test cases and the test execution order of each subtask determined during the software testing process, and then a corresponding test case test report is generated.

[0035] In a feasible implementation, step S30 may include steps A31-A32: Step A31, when executing each subtask in the test case according to the test priority and the test order of each subtask in the test case, obtaining an initial timestamp, a target timestamp and an execution status of each subtask; It can be understood that the initial timestamp refers to the time when the test case starts, the target timestamp refers to the time when the test case ends, and the execution status of each subtask includes an abnormal state and a blocked state.

[0036] In the specific implementation, when executing each subtask in the test case according to the priority execution level of the test case and the test execution order of each subtask determined in the software testing process, the start time and the end time of the test case are obtained, and the monitoring tool is used to monitor the system in real time to determine the execution status of each subtask.

[0037] Step A32: Generate a use case test report according to the initial timestamp, the target timestamp and the execution status of each subtask.

[0038] It can be understood that based on the start time of the test case, the end time of the test case and the execution status of each subtask obtained during the execution of the test case, a corresponding test report is generated, that is, a case test report is obtained.

[0039] Step S40, creating a virtual environment according to the target simulation tool, performing performance testing according to the virtual environment, and generating a performance testing report; It can be understood that the performance test report refers to a test report that evaluates system performance.

[0040] In the specific implementation, this embodiment uses simulation tools to simulate different hardware configurations and operating scenarios to verify the compatibility and stability of the SOC system in various environments. That is, a virtual environment is created according to different hardware configurations and operating scenarios through standard simulation tools, and then performance testing is performed based on the created virtual environment. Finally, a test report for evaluating system performance is obtained.

[0041] In a feasible implementation manner, step S40 may include steps A41 to A42: Step A41, comparing the test efficiency of the initial test report with the test efficiency of the use case test report; It can be understood that test efficiency refers to the efficiency of test cases in completing predetermined test objectives within a unit of time.

[0042] In a specific implementation, in order to improve the test efficiency, the test efficiency corresponding to the optimized test report is compared with the test efficiency corresponding to the initial test report, and then it is determined based on the comparison result whether the test efficiency is improved by optimizing the priority of the test cases.

[0043] Step A42, when the test efficiency of the use case test report is greater than the test efficiency of the initial test report and the test efficiency of the use case test report meets the preset test efficiency requirement, create a virtual environment according to the target simulation tool.

[0044] In a specific implementation, the preset test efficiency requirement refers to a pre-set test efficiency condition. When the test efficiency of the use case test report is greater than the test efficiency of the initial test report, it indicates that the test efficiency of the test case has been improved, and then it is determined whether the test efficiency of the use case test report meets the pre-set test efficiency condition. For example, the pre-set test efficiency condition is a test efficiency threshold (used to determine whether the test efficiency of the use case test report meets the required efficiency critical value), and when the test efficiency of the use case test report meets the pre-set test efficiency condition, the performance test phase is carried out, that is, a virtual environment is created through a target simulation tool.

[0045] Step S50, obtaining a target test result according to the performance test report and the use case test report.

[0046] In specific implementation, the target test result refers to the final test conclusion obtained through analysis and summary of performance test reports and use case test reports.

[0047] It should be noted that if Figure 3As shown, step 1: during the automated test, record the initial timestamp of each test task and the timestamp after the task is executed. The difference between the two timestamps is the test time of the task, and the process number of each task will also be recorded; step 2: during the test, the monitoring tool will be used to monitor the system in real time and form a test report; step 3: according to the kernel stack information, analyze the execution process of the process, so as to analyze which processes are in abnormal state and which processes are blocked. Through the test results, it can also be analyzed which tasks have high execution efficiency, few execution tasks, short execution time and other information; step 4: in the optimization module, use the setpriority function to adjust the priority of the process and readjust the task queue. When a task takes a short time and has no dependencies, the priority of the task can be increased and the task can be moved to the front of the work queue; when a task takes a short time but has dependencies, the priority of the task dependency can be increased first, and its dependency can be run before the task, thereby reducing the waiting time of the task and the time of switching back and forth between tasks. When a task takes a long time to run and has dependencies, it can be executed in a multi-core and multi-threaded manner, and the dependencies are also given priority before executing the task. Step 5: In the present invention, bash scripts are used to realize the automated execution of test cases, the test results are output to a specific file, and a test result report is generated. Step 6: According to the test report, it is determined whether the test efficiency is improved after optimization and whether the system delay phenomenon is improved. Steps 3, 4, and 5 can be cycled according to the actual situation.

[0048] This embodiment executes each subtask in the test case and generates an initial test report when the test case sent by the server through serial communication is received and the system is in a safe environment; performs test optimization according to the initial test report, determines the test priority of the test case and the test order of each subtask in the test case; executes each subtask in the test case according to the test priority and the test order, and generates a test case test report; creates a virtual environment according to the target simulation tool, performs performance testing according to the virtual environment, and generates a performance test report; obtains the target test result according to the performance test report and the test case test report. The test efficiency is improved by changing the priority of some tests and reordering the task queue.

[0049] Based on the first embodiment of the present application, in the second embodiment of the present application, the same or similar contents as those in the above-mentioned embodiment 1 can be referred to the above introduction, and will not be repeated in the following. Figure 4 , step S20 in the SOC-based automated testing method further includes steps S21-S22: Step S21, analyzing the initial test report to determine the execution status and task duration corresponding to each subtask in the test case; It can be understood that task time refers to the total time it takes to execute the test case. The execution process of the process is analyzed based on the kernel stack information, so as to analyze which processes are in an abnormal state and which processes are blocked. The test results can also be used to analyze which tasks have high execution efficiency, fewer tasks, and short execution time. To determine the total time it takes to execute the test case, the execution process of the process is analyzed based on the kernel stack information, so as to analyze which processes are in an abnormal state and which processes are blocked, that is, the execution status corresponding to each subtask.

[0050] Step S22, performing test optimization according to a preset priority function and the execution status and task duration corresponding to each subtask in the test case, and determining the test priority of the test case and the test order of each subtask in the test case.

[0051] It is understandable that the preset priority function refers to a preset function for adjusting the process priority, such as a setpriority function.

[0052] In the specific implementation, the setpriority function is used to adjust the priority of the process and readjust the task queue. When a task takes a short time and has no dependencies, the priority of the task can be increased and the task can be moved to the front of the work queue; when a task takes a short time but has dependencies, the priority of the task's dependencies can be increased first, and its dependencies can be run before the current task, thereby reducing the waiting time of the task and the time of switching back and forth between tasks. When a task takes a long time to run and has dependencies, it can be executed in a multi-core and multi-threaded manner, and the dependencies are also given priority before executing the task. Finally, determine the test priority of the test case and the test order of each subtask in the test case.

[0053] In a feasible implementation, step S22 may include steps A221 to A223: Step A221, determining the case execution status and case duration corresponding to the test case according to the execution status and task duration corresponding to each subtask in the test case; It is understandable that the execution status and task duration corresponding to each subtask are summarized and processed, and then the use case execution status and use case duration corresponding to the test case constituted by each subtask are determined.

[0054] Step A222, determining the test priority of the test case according to a preset priority function, the execution status of the test case corresponding to the test case, and the time consumption of the test case; It can be understood that, through the setpriority function, the test case execution status and the test case time consumption corresponding to the test case are analyzed, and then the priority level of the test case is adjusted according to the analysis result, and finally the test priority of the test case is determined.

[0055] In a feasible implementation, step A222 may include steps B2221-B2222: Step B2221, comparing the use case execution status and the use case duration corresponding to the test case with the use case execution status and the use case duration corresponding to the target use case to obtain a use case comparison result; It can be understood that the target test case refers to other test cases, and the test case comparison result refers to the comparison result of the test time consumed by different test cases.

[0056] In the specific implementation, when testing the system, there are multiple test cases. Different test cases correspond to different subtasks, and thus different test cases consume different test times. Therefore, if a task takes a short time and has no dependencies, then the priority of the task can be increased, and the task can be moved to the front of the work queue to achieve the purpose of adjusting the priority level, that is, the test time consumed by different test cases is compared to obtain the case comparison result.

[0057] Step B2222, determining the test priority of the test case according to the use case comparison result and a preset priority function.

[0058] In the specific implementation, the comparison results of the test time of different test cases are identified to determine the test case with the short test time. If the test case has no dependencies, the priority of the test case is adjusted through the setpriority function, that is, the task is moved to the front of the work queue.

[0059] Step A223, sorting the tasks according to the execution status and the time consumption to obtain the test order of each subtask in the test case.

[0060] In the specific implementation, when a task takes a short time and has no dependencies, the priority of the task can be increased and the task can be moved to the front of the work queue; when a task takes a short time but has dependencies, the priority of the task's dependencies can be increased first, and its dependencies can be run before the current task, thereby reducing the waiting time of the task and the time of switching between tasks. When a task takes a long time to run and has dependencies, it can be executed in a multi-core and multi-threaded manner, and the dependencies can also be processed first, and then the current task can be executed, and finally the test order of each subtask can be obtained.

[0061] In a feasible implementation manner, step A223 may include steps B2231 to B2233: Step B2231, determining dependent subtasks corresponding to each subtask according to the execution status and the task duration; It can be understood that the corresponding dependencies are determined according to the task execution status and task consumption time of each subtask. For example, when there is a dependency relationship between subtask 1-2 and subtask 1-3 in test case 1, that is, when the completion of subtask 1-2 requires the completion of subtask 1-3 first, then the dependency of subtask 1-2 is determined to be subtask 1-3.

[0062] Step B2232, adjusting the priority of the dependent subtask according to a preset priority function to obtain a dependent priority; In the specific implementation, the priority of the dependency subtask is adjusted through the setpriority function to obtain the priority level of the dependency. For example, when there is a dependency relationship between subtask 1-2 and subtask 1-3 in test case 1, that is, when the completion of subtask 1-2 requires the completion of subtask 1-3 first, then this automated test script will increase the priority of subtask 1-3, so as to execute subtask 1-3 first, and then execute subtask 1-2, and finally determine the priority level of the dependency.

[0063] Step B2233, sorting according to the execution status, the task duration and the dependency priority to obtain the test order of each subtask in the test case.

[0064] In a specific implementation, the test order of the subtasks is rearranged according to the execution status of each subtask, the task consumption time, and the priority level of the dependency, so as to obtain the test order of each subtask in the test case.

[0065] It should be noted that if Figure 5As shown, when there is a dependency relationship between subtask 1-2 and subtask 1-3 in test case 1, that is, when the completion of subtask 1-2 requires the completion of subtask 1-3 first, when test case 1 is executed sequentially, a waiting delay will be generated when executing subtask 1-2, and at the same time, when subtask 1-3 is completed, it will jump back to subtask 1-2, which will also increase the delay of task switching. Therefore, the automated test script of the present invention will record the waiting delay and the number of task switches after all test cases are executed once. When this script is executed for the second time, this automated test script will adjust the priority of the test task and its subtasks according to the results of the previous test. When the execution of subtask 1-2 requires the execution of subtask 1-3 first, then this automated test script will increase the priority of subtask 1-3, thereby giving priority to executing subtask 1-3 and then executing subtask 1-2, thereby reducing the waiting delay of the system; when the completion time of test case 2 is short and there are few subtasks, then this test script will increase the priority of test case 2, and the system will give priority to executing test case 2, thereby reducing the system turnaround time.

[0066] This embodiment analyzes the initial test report to determine the execution status and task time corresponding to each subtask in the test case; performs test optimization according to the preset priority function and the execution status and task time corresponding to each subtask in the test case, and determines the test priority of the test case and the test order of each subtask in the test case. In the above manner, the automated test process is optimized, that is, the priority of some tests is changed and the task queue is reordered, etc., which further improves the test efficiency.

[0067] For example, in order to help understand the implementation process of the SOC-based automated testing method obtained by combining this embodiment with the above-mentioned embodiment 1, please refer to Figure 6 , Figure 6A brief flow chart of an automated testing method based on SOC is provided. Specifically, the automated testing method based on SOC combines static analysis, automated testing, test task process optimization and simulation technology, and can effectively perform functional testing, performance testing and security testing of Linux systems. The static testing module uses static code analysis tools to review the code of the Linux kernel and key components to find potential code defects and security risks; the main function of the automated testing module is to traverse and execute existing test cases in a certain way to reduce test pressure and shorten the test cycle; the main function of the test optimization module is to change the priority of certain test cases and the order of task queues according to the analysis of test results, thereby optimizing the automated process, further improving test efficiency and shortening the test cycle; the main function of the simulation module is to use simulation tools to simulate different hardware configurations and operation scenarios to verify the compatibility and stability of the SOC system in various environments.

[0068] It should be noted that the above examples are only used to understand the present application and do not constitute a limitation on the SOC-based automated testing method of the present application. More simple transformations based on this technical concept are all within the scope of protection of the present application.

[0069] This application also provides an automated testing device based on SOC, please refer to Figure 7 , the SOC-based automated testing device comprises: A generating module 10 is used to execute each subtask in the test case and generate an initial test report when the test case sent by the server through serial port communication is received and the system is in a safe environment; An optimization module 20, configured to perform test optimization according to the initial test report, and determine the test priority of the test case and the test order of each subtask in the test case; The generating module 10 is further used to execute each subtask in the test case according to the test priority and the test sequence, and generate a test case test report; The creation module 30 is used to create a virtual environment according to the target simulation tool, and perform performance testing according to the virtual environment to generate a performance test report; the test module 40 is used to obtain the target test result according to the performance test report and the use case test report.

[0070] Optionally, the optimization module 20 is further used to: Analyze the initial test report to determine the execution status and task duration corresponding to each subtask in the test case; Test optimization is performed according to a preset priority function and the execution status and task duration corresponding to each subtask in the test case, and the test priority of the test case and the test order of each subtask in the test case are determined.

[0071] Optionally, the optimization module 20 is further used to: Determine the execution status and duration of the test case corresponding to the test case according to the execution status and task duration corresponding to each subtask in the test case; Determine the test priority of the test case according to a preset priority function, the test case execution status corresponding to the test case, and the test case time consumption; The test order of each subtask in the test case is obtained by sorting the subtasks according to the execution status and the task time consumption.

[0072] Optionally, the optimization module 20 is further used to: Compare the test case execution status and the test case duration corresponding to the test case with the test case execution status and the test case duration corresponding to the target case to obtain a test case comparison result; The test priority of the test case is determined according to the use case comparison result and a preset priority function.

[0073] Optionally, the optimization module 20 is further used to: Determine the dependent subtasks corresponding to each subtask according to the execution status and the task duration; Adjusting the priority of the dependent subtask according to a preset priority function to obtain a dependent priority; The test order of each subtask in the test case is obtained by sorting according to the execution status, the task time consumption and the dependency priority.

[0074] Optionally, the generating module 10 is further used for: When executing each subtask in the test case according to the test priority and the test order of each subtask in the test case, obtaining an initial timestamp, a target timestamp and an execution status of each subtask; A use case test report is generated according to the initial timestamp, the target timestamp and the execution status of each subtask.

[0075] Optionally, the creation module 30 is further used to: Compare the test efficiency of the initial test report with the test efficiency of the use case test report; When the test efficiency of the use case test report is greater than the test efficiency of the initial test report and the test efficiency of the use case test report meets the preset test efficiency requirement, a virtual environment is created according to the target simulation tool.

[0076] The SOC-based automated testing device provided by the present application adopts the SOC-based automated testing method in the above-mentioned embodiment, which can solve the technical problems of long test cycles, system freezes, etc. when executing complex test cases. Compared with the prior art, the beneficial effects of the SOC-based automated testing device provided by the present application are the same as the beneficial effects of the SOC-based automated testing method provided by the above-mentioned embodiment, and the other technical features of the SOC-based automated testing device are the same as the features disclosed in the above-mentioned embodiment method, which will not be repeated here.

[0077] The present application provides an automated testing device based on SOC, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the SOC-based automated testing method in the above-mentioned embodiment 1.

[0078] Reference below Figure 8 , which shows a schematic diagram of the structure of an SOC-based automated test device suitable for implementing the embodiment of the present application. The SOC-based automated test device in the embodiment of the present application may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 8 The SOC-based automated testing equipment shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0079] like Figure 8As shown, the SOC-based automated test equipment may include a processing device 1001 (such as a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM: Read Only Memory) 1002 or a program loaded from a storage device 1003 to a random access memory (RAM: Random Access Memory) 1004. Various programs and data required for the operation of the SOC-based automated test equipment are also stored in the RAM 1004. The processing device 1001, the ROM 1002, and the RAM 1004 are connected to each other via a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Typically, the following systems can be connected to the I / O interface 1006: input devices 1007 including, for example, a touch screen, a touchpad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; output devices 1008 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; storage devices 1003 including, for example, a magnetic tape, a hard disk, etc.; and communication devices 1009. The communication device 1009 can allow the SOC-based automated test equipment to communicate wirelessly or wired with other devices to exchange data. Although the SOC-based automated test equipment with various systems is shown in the figure, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems may be implemented or have instead.

[0080] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.

[0081] The SOC-based automated testing equipment provided by the present application adopts the SOC-based automated testing method in the above-mentioned embodiment, which can solve the technical problems of long test cycles and system freezes when executing complex test cases. Compared with the prior art, the beneficial effects of the SOC-based automated testing equipment provided by the present application are the same as the beneficial effects of the SOC-based automated testing method provided in the above-mentioned embodiment, and the other technical features of the SOC-based automated testing equipment are the same as the features disclosed in the method of the previous embodiment, which will not be repeated here.

[0082] It should be understood that the various parts disclosed in this application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.

[0083] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

[0084] The present application provides a computer-readable storage medium having computer-readable program instructions (ie, computer programs) stored thereon, and the computer-readable program instructions are used to execute the SOC-based automated testing method in the above-mentioned embodiment.

[0085] The computer-readable storage medium provided in the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, systems or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM: Random Access Memory), a read-only memory (ROM: Read Only Memory), an erasable programmable read-only memory (EPROM: Erasable Programmable Read Only Memory or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM: CD-Read Only Memory), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system, system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency: Radio Frequency), etc., or any suitable combination of the above.

[0086] The computer-readable storage medium may be included in the SOC-based automated testing device; or may exist independently without being assembled into the SOC-based automated testing device.

[0087] The above-mentioned computer-readable storage medium carries one or more programs. When the above-mentioned one or more programs are executed by the SOC-based automated testing equipment, the SOC-based automated testing equipment: when receiving the test case sent by the server through serial port communication and the system is in a safe environment, execute each subtask in the test case and generate an initial test report; perform test optimization according to the initial test report, determine the test priority of the test case and the test order of each subtask in the test case; execute each subtask in the test case according to the test priority and the test order, and generate a case test report; create a virtual environment according to the target simulation tool, and perform performance testing according to the virtual environment to generate a performance test report; obtain the target test result according to the performance test report and the case test report.

[0088] Computer program code for performing the operations of the present application may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, C++, and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0089] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0090] The modules involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the module does not constitute a limitation on the unit itself in some cases.

[0091] The readable storage medium provided in the present application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned SOC-based automated testing method, and can solve the technical problems of long test cycles, system freezes, etc. when executing complex test cases. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in the present application are the same as the beneficial effects of the SOC-based automated testing method provided in the above-mentioned embodiment, and will not be elaborated here.

[0092] The present application also provides a computer program product, including a computer program, which implements the steps of the above-mentioned SOC-based automated testing method when executed by a processor.

[0093] The computer program product provided by the present application can solve the technical problems of long test cycles, system freezes, etc. when executing complex test cases. Compared with the prior art, the beneficial effects of the computer program product provided by the present application are the same as those of the SOC-based automated testing method provided by the above-mentioned embodiment, and will not be elaborated here.

[0094] The above descriptions are only some embodiments of the present application, and are not intended to limit the patent scope of the present application. All equivalent structural changes made using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect applications in other related technical fields are included in the patent protection scope of the present application.

Claims

1. An automated testing method based on SOC, characterized in that: The SOC-based automated testing method includes: When a test case sent by the server via serial port communication is received and the system is in a safe environment, each subtask in the test case is executed and an initial test report is generated; Performing test optimization according to the initial test report to determine the test priority of the test case and the test order of each subtask in the test case; Execute each subtask in the test case according to the test priority and the test sequence, and generate a test case test report; Creating a virtual environment according to the target simulation tool, performing performance testing according to the virtual environment, and generating a performance testing report; The target test result is obtained according to the performance test report and the use case test report.

2. The method according to claim 1, characterized in that The step of performing test optimization according to the initial test report and determining the test priority of the test case and the test order of each subtask in the test case includes: Analyze the initial test report to determine the execution status and task duration corresponding to each subtask in the test case; Test optimization is performed according to a preset priority function and the execution status and task duration corresponding to each subtask in the test case, and the test priority of the test case and the test order of each subtask in the test case are determined.

3. The method according to claim 2, characterized in that The step of performing test optimization according to a preset priority function and the execution status and task duration corresponding to each subtask in the test case, and determining the test priority of the test case and the test order of each subtask in the test case comprises: Determine the execution status and duration of the test case corresponding to the test case according to the execution status and task duration corresponding to each subtask in the test case; Determine the test priority of the test case according to a preset priority function, the test case execution status corresponding to the test case, and the test case time consumption; The test order of each subtask in the test case is obtained by sorting the subtasks according to the execution status and the task time consumption.

4. The method according to claim 3, characterized in that The step of determining the test priority of the test case according to a preset priority function, the test case execution status corresponding to the test case, and the test case time consumption includes: Compare the test case execution status and the test case duration corresponding to the test case with the test case execution status and the test case duration corresponding to the target case to obtain a test case comparison result; The test priority of the test case is determined according to the use case comparison result and a preset priority function.

5. The method according to claim 3, characterized in that The step of sorting the tasks according to the execution status and the time consumption to obtain the test order of each subtask in the test case includes: Determine the dependent subtasks corresponding to each subtask according to the execution status and the task duration; Adjusting the priority of the dependent subtask according to a preset priority function to obtain a dependent priority; The test order of each subtask in the test case is obtained by sorting according to the execution status, the task time consumption and the dependency priority.

6. The method according to claim 1, characterized in that The step of executing each subtask in the test case according to the test priority and the test sequence to generate a test case test report comprises: When executing each subtask in the test case according to the test priority and the test order of each subtask in the test case, obtaining an initial timestamp, a target timestamp and an execution status of each subtask; A use case test report is generated according to the initial timestamp, the target timestamp and the execution status of each subtask.

7. The method according to claim 1, characterized in that Before the steps of creating a virtual environment according to the target simulation tool, performing performance testing according to the virtual environment, and generating a performance testing report, the method further includes: Compare the test efficiency of the initial test report with the test efficiency of the use case test report; When the test efficiency of the use case test report is greater than the test efficiency of the initial test report and the test efficiency of the use case test report meets the preset test efficiency requirement, a virtual environment is created according to the target simulation tool.

8. An automatic test device based on SOC, characterized in that: The device comprises: A generation module, for executing each subtask in the test case and generating an initial test report when the test case is received from the server through serial port communication and the system is in a safe environment; An optimization module, used to perform test optimization according to the initial test report, and determine the test priority of the test case and the test order of each subtask in the test case; The generating module is further used to execute each subtask in the test case according to the test priority and the test sequence, and generate a test case test report; The creation module is used to create a virtual environment according to the target simulation tool, and perform performance testing according to the virtual environment to generate a performance test report; the testing module is used to obtain the target test result according to the performance test report and the use case test report.

9. An automated test device based on SOC, characterized in that: The device comprises: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the SOC-based automated testing method according to any one of claims 1 to 7.

10. A storage medium, characterized in that: The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the SOC-based automated testing method according to any one of claims 1 to 7 are implemented.