Automated testing methods, apparatus, devices, and computer program products
By generating routing keywords on the test terminal through a proxy service, matching and consuming software test cases, the problem of low testing efficiency in the software ecosystem during the localization of servers is solved. This achieves asynchronous decoupling and efficient resource utilization, thereby improving testing efficiency.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- CHINA MOBILE GROUP ZHEJIANG
- Filing Date
- 2021-06-04
- Publication Date
- 2026-04-21
AI Technical Summary
In the existing technology, during the process of localization of servers, mobile operators use different domestically produced server chips and operating systems to test the software ecosystem, which is inefficient. Moreover, during the testing process, terminal errors can easily cause test scripts to fail to execute, affecting the test results.
The test terminal generates routing keywords through its proxy service, matches the message queue to be tested based on the message queue middleware, obtains software test cases, and sends an ACK signal to the middleware when consumption is complete, generating a test report. This achieves asynchronous decoupling and hot-plugging, avoiding the test terminal from occupying system resources.
It improves the efficiency of software ecosystem testing, avoids the impact of test script execution failures on results, and achieves asynchronous decoupling of test terminals and efficient utilization of resources.
Smart Images

Figure CN115437907B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of automated testing technology, and in particular to an automated testing method, apparatus, equipment, and computer program product. Background Technology
[0002] During the localization process of mobile operators' servers, different domestically produced server chips are often used, such as the Kunpeng and Phytium series chips based on the ARM architecture, and the Loongson chip based on the MIPS architecture. Furthermore, corresponding operating systems have been launched for both ARM-based and MIPS-based chips.
[0003] Currently, testing of chips and operating system software ecosystems from various manufacturers is often conducted manually, which consumes a lot of manpower and resources. Furthermore, it is impossible to add or remove test terminals during the testing process. Unexpected errors in test terminals can cause a large number of test scripts to fail, affecting test results and resulting in low efficiency in software ecosystem testing.
[0004] The above content is only used to help understand the technical solution of the present invention and does not represent an admission that the above content is prior art. Summary of the Invention
[0005] The main objective of this invention is to provide an automated testing method, apparatus, equipment, and computer program product, aiming to solve the technical problem of low efficiency in software ecosystem testing.
[0006] To achieve the above objectives, the present invention provides an automated testing method, which includes the following steps:
[0007] The proxy service of the test terminal generates the first routing keyword based on the chip information and operating system information of the test terminal;
[0008] The proxy service determines the message queue to be tested that matches the first routing keyword based on the message queue middleware, obtains the software test cases in the message queue to be tested, and feeds back locking information so that the message queue middleware locks the software test cases in the message queue to be tested, wherein the second routing keyword corresponding to the message queue to be tested matches the first routing keyword.
[0009] The proxy service consumes the software test cases and, upon completion of consumption, sends an ACK signal to the message queue middleware and sends the test results to the test system, enabling the test system to generate a test report based on the test results. If no ACK signal is received from the proxy service when the expiration time of the software test case is reached, the message queue middleware releases the software test case from the message queue so that it can be consumed by other proxy services.
[0010] Furthermore, the step of the proxy service consuming the software test cases includes:
[0011] The proxy service obtains the software ecosystem score of the software under test based on the software environment in the test terminal.
[0012] The proxy service obtains the test scripts corresponding to the software test cases, runs the test scripts to obtain the running results, and determines the test results based on the software ecosystem score and the running results.
[0013] Furthermore, the step of obtaining the software ecosystem score of the software under test based on the software environment in the test terminal by the proxy service includes:
[0014] If it is determined based on the software environment that the test terminal has installed the software to be tested and that the software to be tested is available, then the proxy service determines the software ecosystem score as the first score.
[0015] If the test terminal does not have the software under test installed or the software under test is unavailable, the proxy service installs the software under test based on the package management tool of the operating system. When the software under test is installed and available, the software ecosystem score is determined to be the second score.
[0016] If the installation of the software under test based on the package management tool fails, or if the software under test is installed but unusable, then the proxy service installs the source code of the software under test based on the package management tool. When the source code is installed and usable, the software ecosystem score is determined to be the third score.
[0017] If the source code installation fails or the source code installation is completed but unavailable, the proxy service installs the source code of the software dependency package corresponding to the software to be tested based on the source code repository. When the source code of the software dependency package is completed and available, the software ecosystem score is determined to be the fourth score.
[0018] Among them, the first score, the second score, the third score, and the fourth score decrease in that order.
[0019] Furthermore, the step of running the test script to obtain the results includes:
[0020] The proxy service obtains the test results of each step during the execution of the test script, and generates the execution result based on the test results of each step when the test script is completed.
[0021] If the test script fails to run, the proxy service updates the failure count and continues to run the test script if the failure count is less than a preset number.
[0022] If the number of failures reaches a preset number, the proxy service sends a test failure message to the test system.
[0023] Furthermore, to achieve the above objectives, the present invention also provides an automated testing method applied to a testing system, the automated testing method comprising the following steps:
[0024] Upon receiving a test request for a software test case, obtain the required chip information and operating system information corresponding to the software test case.
[0025] Based on the required chip information and required operating system, a second routing keyword is generated, and the second routing keyword and software test cases are pushed to the message queue middleware, so that the message queue middleware pushes the software test cases to the message queue to be tested corresponding to the second routing keyword.
[0026] Furthermore, before the step of obtaining the required chip information and operating system requirements corresponding to the software test case when receiving a test request for a software test case, the method further includes:
[0027] When a request to add a test case is received, the new test case corresponding to the request is obtained. The new test case includes the test case category, test case title, software to be tested, and version information of the software to be tested.
[0028] Based on the newly added test cases, generate corresponding new test scripts and upload the new test scripts to the script library.
[0029] Furthermore, after the step of generating a second routing keyword based on the required chip information and the required operating system, and pushing the second routing keyword and software test cases to the message queue middleware, the method further includes:
[0030] Upon receiving the test results, the test results are parsed to obtain a test report, and the test report is sent to the preset terminal corresponding to the test request.
[0031] Furthermore, to achieve the above objectives, the present invention also provides an automated testing device, the automated testing device comprising:
[0032] The generation module is used to generate the first routing keyword based on the chip information and operating system of the test terminal;
[0033] The determination module is used to determine the message queue to be tested that matches the first routing keyword based on the message queue middleware, obtain the software test cases in the message queue to be tested, and feed back locking information to make the message queue middleware lock the software test cases in the message queue to be tested, wherein the second routing keyword corresponding to the message queue to be tested matches the first routing keyword.
[0034] The consumption module is used to consume the software test cases and, upon completion of consumption, to send an ACK signal to the message queue middleware and send the test results to the test system, so that the test system can generate a test report based on the test results. If no ACK signal is received from the test terminal when the expiration time of the software test case is reached, the message queue middleware releases the software test case from the message queue so that the software test case can be consumed by other proxy services.
[0035] In addition, to achieve the above objectives, the present invention also provides an automated testing device, which includes: a memory, a processor, and an automated testing program stored in the memory and executable on the processor. When the automated testing program is executed by the processor, it implements the steps of the aforementioned automated testing method.
[0036] In addition, to achieve the above objectives, the present invention also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the aforementioned automated testing method.
[0037] This invention generates a first routing keyword based on the chip information and operating system of the test terminal through a proxy service. The proxy service then determines a test message queue matching the first routing keyword using a message queue middleware, retrieves software test cases from the message queue, and sends a locking signal to the message queue middleware to lock the software test cases in the queue. The proxy service then consumes the software test cases and, upon completion, sends an ACK signal to the message queue middleware and sends the test results to the test system, enabling the test system to generate a test report based on the results. If no ACK signal is received from the proxy service when the software test case expires, the message queue middleware releases the software test case from the message queue, allowing it to be consumed by other proxy services. This achieves automated testing of the software ecosystem, thereby improving the efficiency of server systems in software ecosystem testing. Simultaneously, it achieves asynchronous decoupling between the test terminal and the test system, ensuring that the test terminal does not consume test system resources during testing, thus improving the performance of the test system.
[0038] By locking software test cases and setting an expiration time for the locked state, other test terminals can consume the test cases via proxy services when they are not consumed in time. This enables "hot-plugging" of test terminals, allowing other test terminals to be temporarily added for distributed testing or temporarily removed from testing for other uses. Regardless of the test results of the test terminal, the software test case can be consumed by other proxy services when the locked state expires, thus preventing test script execution failures from affecting the test results and improving testing efficiency. Attached Figure Description
[0039] Figure 1 This is a schematic diagram of the structure of the automated testing equipment in the hardware operating environment involved in the embodiments of the present invention;
[0040] Figure 2 This is a flowchart illustrating an embodiment of the automated testing method of the present invention;
[0041] Figure 3 This is a flowchart illustrating another embodiment of the automated testing method of the present invention;
[0042] Figure 4 This is a functional module flowchart of an embodiment of the automated testing device of the present invention.
[0043] The realization of the objective, functional features and advantages of the present invention will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation
[0044] It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
[0045] like Figure 1 As shown, Figure 1 This is a schematic diagram of the structure of an automated testing device in the hardware operating environment involved in the embodiments of the present invention.
[0046] The automated testing equipment in this embodiment of the invention can be a PC. For example... Figure 1As shown, the automated testing equipment may include: a processor 1001, such as a CPU; a network interface 1004; a user interface 1003; a memory 1005; and a communication bus 1002. The communication bus 1002 is used to enable communication between these components. The user interface 1003 may include a display screen and an input unit such as a keyboard; optionally, the user interface 1003 may also include a standard wired interface or a wireless interface. The network interface 1004 may optionally include a standard wired interface or a wireless interface (such as a Wi-Fi interface). The memory 1005 may be high-speed RAM or non-volatile memory, such as a disk drive. Optionally, the memory 1005 may also be a storage device independent of the aforementioned processor 1001.
[0047] Optionally, automated testing equipment may also include cameras, RF (Radio Frequency) circuits, sensors, audio circuits, WiFi modules, and so on. Of course, automated testing equipment can also be configured with other sensors such as gyroscopes, barometers, hygrometers, thermometers, and infrared sensors, which will not be elaborated upon here.
[0048] Those skilled in the art will understand that Figure 1 The terminal structure shown does not constitute a limitation on automated test equipment and may include more or fewer components than shown, or combine certain components, or have different component arrangements.
[0049] like Figure 1 As shown, the memory 1005, which serves as a computer storage medium, may include an operating system, a network communication module, a user interface module, and an automated testing program.
[0050] exist Figure 1 In the automated testing equipment shown, the network interface 1004 is mainly used to connect to the backend server and communicate data with the backend server; the user interface 1003 is mainly used to connect to the client (user end) and communicate data with the client; and the processor 1001 can be used to call the automated testing program stored in the memory 1005.
[0051] In this embodiment, the automated testing device includes: a memory 1005, a processor 1001, and an automated testing program stored in the memory 1005 and executable on the processor 1001. When the processor 1001 calls the automated testing program stored in the memory 1005, it executes the steps of the automated testing methods in the following embodiments.
[0052] This invention also provides an automated testing method, referring to... Figure 2 , Figure 2 This is a flowchart illustrating an embodiment of the automated testing method of the present invention.
[0053] This automated testing method includes the following steps:
[0054] Step S101: The proxy service of the test terminal generates a first routing keyword based on the chip information and operating system of the test terminal.
[0055] In this embodiment, there are multiple test terminals, each corresponding to chips and operating systems from different manufacturers. That is, each test terminal is equipped with chips and operating systems from different manufacturers. The chips may include Phytium, Kunpeng, Loongson, Hygon, and other series of chips. The operating systems may include UnionTech OS, Kylin OS, and NeoKylin OS. Each test terminal may also interface with multiple operating systems. For example, there may be a test terminal suitable for testing all chips and all operating systems, a test terminal suitable for Phytium chips and UnionTech OS, a test terminal suitable for Phytium chips and all operating systems, a test terminal suitable for all chips and Kylin OS, etc. This embodiment does not impose any limitations.
[0056] In this embodiment, the automated testing method is applied to the test terminal, specifically executed by the agent service running on the test terminal. Specifically, the agent first obtains the chip information and operating system information of the test terminal, and generates a first routing key based on the chip information and operating system information according to preset rules.
[0057] In step S102, the proxy service determines the message queue to be tested that matches the first routing keyword based on the message queue middleware, obtains the software test cases in the message queue to be tested, and feeds back locking information so that the message queue middleware locks the software test cases in the message queue to be tested, wherein the second routing keyword corresponding to the message queue to be tested matches the first routing keyword.
[0058] In this embodiment, after generating the first routing keyword, the proxy service interfaces with the message queue middleware to determine the message queue to be tested that matches the first routing keyword. Specifically, the message queue middleware determines the message queue to be tested that matches the first routing keyword among multiple message queues. That is, the second routing keyword corresponding to the message queue to be tested matches the first routing keyword, or the second routing keyword corresponding to the first software test case in the message queue to be tested matches the first routing keyword.
[0059] Then, the proxy service obtains the software test cases in the message queue to be tested, and after obtaining them, it sends out locking information to make the message queue middleware lock the software test cases in the queue to be tested. When the message queue middleware locks the software test cases, it generates the expiration time corresponding to the current locking state, so that when the proxy service consumes the software test cases, the software test cases in the queue to be tested are in a locked state.
[0060] Step S103: The proxy service consumes the software test case and, upon completion of consumption, sends an ACK signal to the message queue middleware and sends the test results to the test system, so that the test system generates a test report based on the test results. If no ACK signal is received from the proxy service when the expiration time of the software test case is reached, the message queue middleware releases the software test case from the message queue so that the software test case can be consumed by other proxy services.
[0061] In this embodiment, after obtaining the software test case, the proxy service consumes the software test case, that is, it obtains the test script corresponding to the software test case through the script library and runs the obtained test script to perform software testing. After the test is completed, the proxy service sends an ACK signal to the message queue middleware and sends the test results to the test system. Specifically, the test terminal saves the test results of each step sent by the test script. When it receives the test completion signal, it summarizes the test results of each step according to the execution order to obtain the test result and determines that the execution result of the test script is SUCCESS.
[0062] In this embodiment, upon receiving test results, the testing system generates a test report based on the test results. When a proxy service consumes a software test case, the message queue middleware determines in real time whether the expiration time of the software test case has been reached. If no ACK signal is received from the proxy service when the expiration time of the software test case is reached, the message queue middleware releases the software test case from the message queue so that it can be consumed by other proxy services.
[0063] The Agent runs on the test terminal and is mainly responsible for communicating with the control center and reporting center of the test system, monitoring the test process, and handling errors, including message queue middleware integration, test script acquisition, test script control, test process monitoring, and test result aggregation and forwarding.
[0064] Message queue middleware integration refers to the Agent connecting to the message queue middleware and the exchange of the report feedback channel, respectively receiving, consuming, and sending messages.
[0065] Test script retrieval refers to the Agent retrieving the corresponding script from the script library and storing it on the local server based on the software test cases.
[0066] Test script control includes starting and stopping the script. After the Agent retrieves a test script from the script library and runs it locally, it starts a new process to execute the script. When the script has run a certain number of times, or exceeds the preset number, the Agent stops running the script. If a script is detected to be suspended, the Agent terminates the test process for that script, starts a new process, and reruns the test script for retesting.
[0067] Test script monitoring refers to the Agent periodically sending query messages to the test script through an inter-process message queue and obtaining feedback messages from the test script to monitor the script's running status. If the test script does not respond after the waiting time, the Agent determines that the script is in a suspended state.
[0068] The Agent receives test results sent back from the script from the inter-process message queue, processes them, and forwards them to the test report center.
[0069] The automated testing method proposed in this embodiment generates a first routing keyword based on the chip information and operating system of the test terminal through a proxy service. Then, the proxy service determines the message queue to be tested that matches the first routing keyword based on a message queue middleware, obtains the software test cases in the message queue, and sends a locking message to the message queue middleware to lock the software test cases in the message queue. The proxy service then consumes the software test cases and, upon completion, sends an ACK signal to the message queue middleware and sends the test results to the test system, enabling the test system to generate a test report based on the test results. If no ACK signal is received from the proxy service when the software test case expires, the message queue middleware releases the software test case from the message queue so that it can be consumed by other proxy services. This achieves automated testing of the software ecosystem, thereby improving the efficiency of the server system in conducting software ecosystem testing. Simultaneously, it achieves asynchronous decoupling between the test terminal and the test system, ensuring that the test terminal does not consume test system resources during testing, thus improving the performance of the test system.
[0070] By locking software test cases and setting an expiration time for the locked state, other test terminals can consume the test cases via proxy services when they are not consumed in time. This enables "hot-plugging" of test terminals, allowing other test terminals to be temporarily added for distributed testing or temporarily removed from testing for other uses. Regardless of the test results of the test terminal, the software test case can be consumed by other proxy services when the locked state expires, thus preventing test script execution failures from affecting the test results and improving testing efficiency.
[0071] Based on the first embodiment, a second embodiment of the automated testing method of the present invention is proposed. In this embodiment, step S103 includes:
[0072] Step S201: The proxy service obtains the software ecosystem score of the software to be tested based on the software environment in the test terminal.
[0073] In step S202, the proxy service obtains the test script corresponding to the software test case, runs the test script to obtain the running result, and determines the test result based on the software ecosystem score and the running result.
[0074] In this embodiment, the testing of software test cases includes software ecosystem scoring and test script testing. Specifically, the proxy service first obtains the software ecosystem score of the software to be tested based on the software environment in the test terminal, and then obtains the test script corresponding to the software test case. That is, the proxy service obtains the test script in the script library and runs the test script in the test terminal to obtain the running result. When the test is completed, the test result is determined based on the software ecosystem score and the running result.
[0075] The automated testing method proposed in this embodiment obtains the software ecosystem score of the software under test based on the software environment in the test terminal through the proxy service; then, the proxy service obtains the test script corresponding to the software test case, runs the test script to obtain the running result, and determines the test result based on the software ecosystem score and the running result. The test script realizes the testing of the software test case, and the software ecosystem score realizes the test evaluation of the software environment corresponding to the software test case, thereby realizing the automated testing of the software ecosystem.
[0076] Based on the second embodiment, a third embodiment of the automated testing method of the present invention is proposed. In this embodiment, step S201 includes:
[0077] Step S301: If it is determined based on the software environment that the test terminal has installed the software to be tested and the software to be tested is available, then the proxy service determines the software ecosystem score as the first score.
[0078] Step S302: If the test terminal does not have the software to be tested installed or the software to be tested is unavailable, the proxy service installs the software to be tested based on the package management tool of the operating system. When the software to be tested is installed and available, the software ecosystem score is determined to be the second score.
[0079] Step S302: If the installation of the software to be tested based on the package management tool fails, or the software to be tested is installed but unusable, then the proxy service installs the source code of the software to be tested based on the package management tool. When the source code is installed and usable, the software ecosystem score is determined to be the third score.
[0080] Step S304: If the source code installation fails or the source code installation is completed but unavailable, the proxy service installs the source code of the software dependency package corresponding to the software to be tested based on the source code repository. When the source code of the software dependency package is completed and available, the software ecosystem score is determined to be the fourth score.
[0081] Among them, the first score, the second score, the third score, and the fourth score decrease in that order.
[0082] In this embodiment, the system first checks whether the operating system has the software pre-installed. That is, it determines whether the test terminal has the software to be tested installed based on the software environment. If the test terminal has the software to be tested installed, the availability of the software to be tested is tested. If the software to be tested is available, the software ecosystem score is determined to be the first score.
[0083] If the test terminal does not have the software under test installed or the software under test is unavailable, the agent service will install the software under test based on the operating system's package management tool, that is, through the operating system's built-in package management tool apt or yum to install the software under test. After installation, the availability of the software under test will be tested. If the software under test is available, the software ecosystem score will be determined as the second score.
[0084] If the installation of the software under test fails using the package management tool, or if the software under test is installed but unusable, the proxy service will install the source code of the software under test using the package management tool. After the source code is installed, the availability of the software under test will be tested. If the software under test is usable, the software ecosystem score will be determined as the third score.
[0085] If the source code installation fails or the source code installation is completed but unusable, the proxy service installs the source code of the software dependency package corresponding to the software under test based on the source code repository. After the source code of the software dependency package is completed, the availability of the software under test is tested. If the software under test is usable, the software ecosystem score is determined to be the fourth score.
[0086] The first, second, third, and fourth scores decrease sequentially. For example, the first, second, third, and fourth scores are 5, 4, 2, and 1, respectively.
[0087] It should be noted that if the source code installation of the software dependency package fails, or if the source code installation of the software dependency package succeeds but the software under test is unusable, then the software ecosystem score is determined to be 0 points. In this case, the test can be terminated.
[0088] The automated testing method proposed in this embodiment determines the software ecosystem score as a first score if the test terminal has the software under test installed and the software under test is available, based on the software environment. Then, if the test terminal does not have the software under test installed or the software under test is unavailable, the proxy service installs the software under test using the operating system's package management tool. When the software under test is successfully installed and available, the software ecosystem score is determined as a second score. Subsequently, if the installation of the software under test using the package management tool fails, or if the software under test is successfully installed but unavailable, the proxy service... The software package management tool installs the source code of the software under test. When the source code installation is complete and available, the software ecosystem score is determined as the third score. Finally, if the source code installation fails or is completed but unavailable, the proxy service installs the source code of the software dependency packages corresponding to the software under test based on the source code repository. When the source code of the software dependency packages is complete and available, the software ecosystem score is determined as the fourth score. This achieves the goal of evaluating the software ecosystem of the operating system of the test terminal by using the installation and running information of the software under test, thereby improving the efficiency of software ecosystem testing.
[0089] Based on the second embodiment, a fourth embodiment of the automated testing method of the present invention is proposed. In this embodiment, step S202 includes:
[0090] Step S401: The proxy service obtains the test results of each step during the execution of the test script, and generates the execution result based on the test results of each step when the test script is completed.
[0091] Step S402: If the test script fails to run, the proxy service updates the failure count and continues to run the test script when the failure count is less than a preset number.
[0092] Step S403: If the number of failures reaches a preset number, the proxy service sends test failure information to the test system.
[0093] In this embodiment, the execution result of each step of the test script is sent to the test terminal through inter-process communication. The proxy service obtains the test results of each step during the execution of the test script, and generates the execution result based on the test results of each step when the test script is completed.
[0094] Furthermore, if the test script fails to run, for example, if the test script is unresponsive, the proxy service updates the failure count and continues to run the test script if the failure count is less than a preset number. If the failure count reaches the preset number, the proxy service sends test failure information to the test system.
[0095] The preset number of times can be set appropriately; for example, the preset number of times can be set to 3, 5, etc.
[0096] The automated testing method proposed in this embodiment obtains the test results of each step during the execution of the test script through the proxy service. When the test script completes execution, the execution result is generated based on the test results of each step. Then, if the test script fails to run, the proxy service updates the failure count and continues to run the test script if the failure count is less than a preset number. If the failure count reaches the preset number, the proxy service sends test failure information to the testing system. By setting the preset number of failures, an automatic retesting mechanism for the test script is implemented, thereby eliminating unexpected test failures caused by environmental problems of the test terminal, making the test results more realistic, and further improving the testing efficiency of the software ecosystem.
[0097] In addition, the present invention also provides an automated testing method, referring to Figure 3 , Figure 3 This is a flowchart illustrating another embodiment of the automated testing method of the present invention.
[0098] This automated testing method includes the following steps:
[0099] Step S501: Upon receiving a test request for a software test case, obtain the required chip information and operating system information corresponding to the software test case.
[0100] Step S502: Generate a second routing keyword based on the required chip information and the required operating system, and push the second routing keyword and software test cases to the message queue middleware, so that the message queue middleware pushes the software test cases to the message queue to be tested corresponding to the second routing keyword.
[0101] The automated testing method in this embodiment is applied to a testing system, which includes a management center, a control center, and a reporting center.
[0102] The management center uses a B / S architecture, primarily consisting of a front-end web page and back-end services. The front-end web page serves as a communication bridge with users, while the back-end services provide the data needed by the front-end page via HTTP interfaces. Functions include test case maintenance, test plan creation, continuous integration, test report viewing, and report distribution channel maintenance.
[0103] In test case maintenance, the management center is divided into test case writing and test case display. When writing test cases, the management center provides a window for adding new test cases, allowing users to enter fields including ID, test case category, test case title, software and version to be tested, operation steps, expected results, etc. These fields are then written to the database after user submission. When displaying test cases, the management center reads the entered test cases from the database and displays them in a list format on the webpage.
[0104] Test plan creation: The management center provides a window for creating new test plans. Users can fill in details such as project description, test objectives, and test scope. After submission, the information is written to the database. The management center displays the entered test cases in a list format. Test cases can be linked to test plans using a batch selection function and written to the database; the test plan status is then "New". The management center test plan allows users to select the chip platform and operating system to run on.
[0105] Continuous Integration: Once the test plan is completed, users can choose an execution strategy, including immediate execution, scheduled execution, and periodic execution. After selection, the management center updates the test plan's status in the database to "in execution" and submits the plan to the test control center via an HTTP interface, where the test control center schedules the completion of the test plan.
[0106] Viewing the test report includes a list of test plan completion status and a detailed test report.
[0107] In the test plan completion list, the management center displays execution reports for each completed test plan in a list format, including: total number of test scripts, number of passed test scripts, number of failed test scripts, and pass percentage. In the detailed test report, after the user clicks on a test report, the management center displays a detailed report for each test, including: the platform software ecosystem score for this test, the included chips, operating systems, scoring information, the execution status of each test script, and the execution status of each test step within the test script, etc.
[0108] The report distribution channel maintenance involves the management center maintaining information such as the mail server address and port, sender email addresses and passwords, and recipient email addresses, and writing this information to the database. The management center primarily maintains information such as the company ID, application ID, and msgId of the personnel to be notified, and writes this information to the database.
[0109] After receiving the submitted test plan, the control center parses the request content and generates different test case messages and routing keys in batches according to the test case ID, selected chip platform, and operating system in the plan. Then, according to the test strategy, the control center sends them to the test case distribution channel exchange of the message queue middleware.
[0110] The reporting center is responsible for processing the test results from the report feedback channel and generating test reports in HTML format. Based on the configuration information, these reports are then distributed via email or other channels.
[0111] The reporting center connects to the message middleware to generate a message queue. It interfaces with the Agent in the test via configured Exchange information. After receiving messages regarding script execution status and test results, the reporting center parses them and extracts relevant data, writing it to the database. After parsing the script execution status and test results, the reporting center generates an HTML report according to the HTML template for the test report. The reporting center distributes the report via email and WeChat Work channels; later, DevOps tools can be added to push test reports. Specifically, the reporting center reads the email configuration information from the database and, based on this information, sends a detailed test report in HTML format to the relevant email addresses. This report includes: the platform software ecosystem score for this test, the included chips, operating systems, scoring, the execution status of each test script, and the execution status of each test step within the test script. The reporting center also reads the WeChat Work configuration information from the database and sends an execution report of the test plan to the relevant WeChat Work personnel, including: the total number of test scripts, the number of passed test scripts, the number of failed test scripts, and the pass percentage.
[0112] In this embodiment, when a test request for a software test case is received, the test system obtains the required chip information and operating system information corresponding to the software test case.
[0113] Based on the required chip information and required operating system, a second routing keyword is generated, and the second routing keyword and software test cases are pushed to the message queue middleware. Specifically, the test cases are pushed to the exchange of the test case distribution channel of the message queue middleware, so that the message queue middleware pushes the software test cases to the message queue to be tested corresponding to the second routing keyword.
[0114] Furthermore, in one embodiment, prior to step S501, the automated testing method further includes:
[0115] Step a: When a new test case request is received, the new test case corresponding to the new request is obtained. The new test case includes test case category, test case title, software to be tested, and version information of the software to be tested.
[0116] Step b: Generate corresponding new test scripts based on the newly added test cases, and upload the new test scripts to the script library.
[0117] In this embodiment, when a user needs new test cases, the testing system displays a new window through the management center, allowing the user to input the test case category, test case title, software to be tested, and version information of the software to be tested in the new window. After the user submits confirmation, the testing system receives the request to add a test case, obtains the new test case, and then generates a corresponding new test script based on the new test case and uploads the new test script to the script library, thereby realizing the addition of test cases and the generation of corresponding test scripts, further improving the efficiency of software ecosystem testing.
[0118] Furthermore, in another embodiment, after step S502, the automated testing method further includes:
[0119] Step c: Upon receiving the test results, parse the test results to obtain a test report, and send the test report to the preset terminal corresponding to the test request.
[0120] In this embodiment, upon receiving the test results, the testing system parses the test results through the report center to obtain a test report, which is an HTML report. The testing system then sends the report to the preset terminal corresponding to the test request, so that the user can view the current software ecosystem test status based on the test report.
[0121] The automated testing method proposed in this embodiment obtains the required chip information and operating system information corresponding to the software test case when a test request for the software test case is received. Then, the testing system generates a second routing keyword based on the required chip information and operating system information, and pushes the second routing keyword and the software test case to the message queue middleware. This facilitates the proxy service of the test terminal to obtain the software test case, thereby further improving the efficiency of software ecosystem testing.
[0122] The present invention also provides an automated testing device, with reference to Figure 4 The automated testing device includes:
[0123] The generation module 10 is used to generate the first routing keyword based on the chip information and operating system of the test terminal;
[0124] The determination module 20 is used to determine the message queue to be tested that matches the first routing keyword based on the message queue middleware, obtain the software test cases in the message queue to be tested, and feed back locking information to make the message queue middleware lock the software test cases in the message queue to be tested, wherein the second routing keyword corresponding to the message queue to be tested matches the first routing keyword.
[0125] The consumption module 30 is used to consume the software test cases and, upon completion of consumption, to send an ACK signal to the message queue middleware and send the test results to the test system, so that the test system can generate a test report based on the test results. If no ACK signal is received from the test terminal when the expiration time of the software test case is reached, the message queue middleware releases the software test case in the message queue so that the software test case can be consumed by other proxy services.
[0126] The methods executed by the above-mentioned program units can be referred to in the various embodiments of the automated testing method of the present invention, and will not be repeated here.
[0127] The present invention also provides a computer-readable storage medium.
[0128] The present invention provides an automated test program stored on a computer-readable storage medium, which, when executed by a processor, implements the steps of the automated test method described above.
[0129] The method implemented when the automated test program running on the processor is executed can be referred to in various embodiments of the automated test method of the present invention, and will not be repeated here.
[0130] Furthermore, this invention also proposes a computer program product that includes an automated test program, which, when executed by a processor, implements the steps of the automated test method described above.
[0131] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or system. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or system that includes that element.
[0132] The sequence numbers of the above embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0133] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) as described above, and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in the various embodiments of the present invention.
[0134] The above are merely preferred embodiments of the present invention and do not limit the scope of the patent. Any equivalent structural or procedural transformations made based on the description and drawings of the present invention, or direct or indirect applications in other related technical fields, are similarly included within the scope of patent protection of the present invention.
Claims
1. An automated testing method, characterized by, The automated testing method includes the following steps: The proxy service of the test terminal generates the first routing keyword based on the chip information and operating system information of the test terminal; The proxy service determines the message queue to be tested that matches the first routing keyword based on the message queue middleware, obtains the software test cases in the message queue to be tested, and feeds back locking information so that the message queue middleware locks the software test cases in the message queue to be tested, wherein the second routing keyword corresponding to the message queue to be tested matches the first routing keyword. The proxy service consumes the software test cases and, upon completion of consumption, sends an ACK signal to the message queue middleware and sends the test results to the test system, enabling the test system to generate a test report based on the test results. If no ACK signal is received from the proxy service when the expiration time of the software test case is reached, the message queue middleware releases the software test case from the message queue so that it can be consumed by other proxy services. The steps of the proxy service consuming the software test cases include: The proxy service obtains the software ecosystem score of the software under test based on the software environment in the test terminal. The steps by which the proxy service obtains the software ecosystem score of the software under test based on the software environment in the test terminal include: If it is determined based on the software environment that the test terminal has installed the software to be tested and that the software to be tested is available, then the proxy service determines the software ecosystem score as the first score. If the test terminal does not have the software under test installed or the software under test is unavailable, the proxy service installs the software under test based on the package management tool of the operating system. When the software under test is installed and available, the software ecosystem score is determined to be the second score. If the installation of the software under test based on the package management tool fails, or if the software under test is installed but unusable, then the proxy service installs the source code of the software under test based on the package management tool. When the source code is installed and usable, the software ecosystem score is determined to be the third score. If the source code installation fails or the source code installation is completed but unavailable, the proxy service installs the source code of the software dependency package corresponding to the software to be tested based on the source code repository. When the source code of the software dependency package is completed and available, the software ecosystem score is determined to be the fourth score. Among them, the first score, the second score, the third score, and the fourth score decrease in that order; The proxy service obtains the test scripts corresponding to the software test cases, runs the test scripts to obtain the running results, and determines the test results based on the software ecosystem score and the running results.
2. The automated testing method of claim 1, wherein, The steps of running the test script to obtain the results include: The proxy service obtains the test results of each step during the execution of the test script, and generates the execution result based on the test results of each step when the test script is completed. If the test script fails to run, the proxy service updates the failure count and continues to run the test script if the failure count is less than a preset number. If the number of failures reaches a preset number, the proxy service sends a test failure message to the test system.
3. The automated testing method of claim 1, wherein, The automated testing method is applied to the testing system, and the automated testing method includes the following steps: Upon receiving a test request for a software test case, obtain the required chip information and operating system information corresponding to the software test case. Based on the required chip information and required operating system, a second routing keyword is generated, and the second routing keyword and software test cases are pushed to the message queue middleware, so that the message queue middleware pushes the software test cases to the message queue to be tested corresponding to the second routing keyword.
4. The automated testing method of claim 3, wherein, Before the step of obtaining the required chip information and operating system requirements corresponding to the software test case when receiving a test request for a software test case, the method further includes: When a request to add a test case is received, the new test case corresponding to the request is obtained. The new test case includes the test case category, test case title, software to be tested, and version information of the software to be tested. Based on the newly added test cases, generate corresponding new test scripts and upload the new test scripts to the script library.
5. The automated testing method of claim 3, wherein, After the step of generating a second routing keyword based on the required chip information and the required operating system, and pushing the second routing keyword and software test cases to the message queue middleware, the method further includes: Upon receiving the test results, the test results are parsed to obtain a test report, and the test report is sent to the preset terminal corresponding to the test request.
6. An automated test device characterized by, The automated testing device includes: The generation module is used to generate the first routing keyword based on the chip information and operating system of the test terminal; The determination module is used to determine the message queue to be tested that matches the first routing keyword based on the message queue middleware, obtain the software test cases in the message queue to be tested, and feed back locking information to make the message queue middleware lock the software test cases in the message queue to be tested, wherein the second routing keyword corresponding to the message queue to be tested matches the first routing keyword. The consumption module is used to consume the software test cases and, upon completion of consumption, send an ACK signal to the message queue middleware and transmit the test results to the test system, enabling the test system to generate a test report based on the test results. If no ACK signal is received from the test terminal when the software test case expires, the message queue middleware releases the software test case from the message queue, allowing it to be consumed by other proxy services. The consumption module is also used by the agent service to obtain the software ecosystem score of the software under test based on the software environment in the test terminal. If it is determined based on the software environment that the test terminal has installed the software to be tested and that the software to be tested is available, then the proxy service determines the software ecosystem score as the first score. If the test terminal does not have the software under test installed or the software under test is unavailable, the proxy service installs the software under test based on the package management tool of the operating system. When the software under test is installed and available, the software ecosystem score is determined to be the second score. If the installation of the software under test based on the package management tool fails, or if the software under test is installed but unusable, then the proxy service installs the source code of the software under test based on the package management tool. When the source code is installed and usable, the software ecosystem score is determined to be the third score. If the source code installation fails or the source code installation is completed but unavailable, the proxy service installs the source code of the software dependency package corresponding to the software to be tested based on the source code repository. When the source code of the software dependency package is completed and available, the software ecosystem score is determined to be the fourth score. Among them, the first score, the second score, the third score, and the fourth score decrease in that order; The proxy service obtains the test scripts corresponding to the software test cases, runs the test scripts to obtain the running results, and determines the test results based on the software ecosystem score and the running results.
7. An automated test equipment, characterized by, The automated testing device includes: a memory, a processor, and an automated testing program stored in the memory and executable on the processor. When the automated testing program is executed by the processor, it implements the steps of the automated testing method as described in any one of claims 1 to 2 or 4-5.
8. A computer program product comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the automated testing method as described in any one of claims 1 to 2 or 4-5.
Citation Information
Patent Citations
Test method and test system
CN111444097A
Software testing method, device and equipment and storage medium
CN112650676A