Automated testing methods, devices, equipment, storage media and products for communication systems
By creating test cases and extending the test engine, the problem of low efficiency in automated testing of communication systems is solved, achieving efficient and accurate automated testing, adapting to various communication protocols, and lowering the technical threshold.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-13
- Publication Date
- 2026-04-03
AI Technical Summary
Existing technologies cannot quickly and accurately automate the testing of communication systems, especially in agile development and DevOps environments, where traditional manual testing methods are inefficient and lack coverage.
By creating test cases, parsing communication protocol types, and extending the test engine, a second test engine is generated using a first test engine built with a service layer and a control layer for automated testing, including predefined format configuration data and custom logic processing.
It enables efficient and accurate automated testing under high-demand testing conditions, reduces reliance on professional programming skills, improves testing efficiency and accuracy, and enhances the system's adaptability and maintainability.
Smart Images

Figure CN119299334B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of communication testing technology, and in particular to an automated testing method, apparatus, equipment, storage medium, and product for communication systems. Background Technology
[0002] In today's software development environment, a front-end / back-end separation architecture has become the norm, with the back-end primarily interacting with data via real-time communication protocols such as RESTful APIs or WebSockets. With the widespread adoption of agile development and DevOps, project iteration speeds have accelerated, leading to increased testing demands. Under high-demand testing conditions, traditional manual testing methods are no longer sufficient in terms of efficiency and coverage. Therefore, the industry urgently needs a method for quickly and accurately automating the testing of communication systems. Summary of the Invention
[0003] The main purpose of this application is to provide an automated testing method, apparatus, equipment, storage medium, and product for communication systems, aiming to solve the technical problem that existing technologies cannot quickly and accurately perform automated testing of communication systems.
[0004] To achieve the above objectives, this application provides an automated testing method for a communication system, the method comprising the following steps:
[0005] Test cases are created based on the real-time communication scenario of the communication system under test, and the test cases contain configuration data in a predefined format.
[0006] The test cases are parsed by the first test engine to obtain the communication protocol type corresponding to the communication system under test;
[0007] The first test engine is extended based on the communication protocol type to obtain the second test engine, and the communication system under test is automatically tested through the second test engine.
[0008] The first test engine is built on a service layer and a control layer. The service layer is used to define the service abstraction interface for automated testing, and the control layer is used to define the process control for automated testing.
[0009] In one embodiment, the step of creating test cases based on the real-time communication scenario of the communication system under test includes:
[0010] The test data template corresponding to the communication system under test is determined based on the real-time communication scenario in which the communication system under test is located.
[0011] The test data template is sent to the testers, who are then guided to fill in the predefined format configuration data in the test data template to obtain test cases. The predefined format is JSON format, and the configuration data includes test context information, test data, and expected result configuration.
[0012] In one embodiment, the step of extending the first test engine based on the communication protocol type to obtain the second test engine includes:
[0013] A preset decorator is determined based on the communication protocol type, and a communicator subclass corresponding to the communication protocol type is generated from the communicator factory;
[0014] The first test engine is extended based on the preset decorator and the communicator subclass to obtain the second test engine;
[0015] The preset decorator is used to add custom logic before and after the automated testing of the communication system under test, and the communicator subclass is used to update the communication protocol of the first test engine.
[0016] In one embodiment, the step of automating the testing of the communication system under test using the second testing engine includes:
[0017] Establish a communication connection with the communication system under test, and generate test preparation data through the preset decorator in the second test engine;
[0018] The test preparation data is converted into a test request by the communicator subclass in the second test engine, and the communication system under test is automatically tested based on the test request.
[0019] In one embodiment, the step of converting the test preparation data into a test request through a communicator subclass in the second test engine, and performing automated testing on the communication system under test based on the test request, includes:
[0020] The test preparation data is converted into a test request by the communicator subclass in the second test engine, and the test request is sent to the communication system under test.
[0021] Receive the first response data returned by the communication system under test based on the test request, and process the first response data through the preset decorator to obtain the second response data;
[0022] The automated test results of the communication system under test are determined based on the second response data.
[0023] In one embodiment, the automated testing method for the communication system further includes:
[0024] A custom function is generated based on the test content of the communication system under test. The custom function is used to randomly generate test data that matches the test content.
[0025] When performing automated testing on the communication system under test, the second test engine calls the custom function to generate random test data, and replaces the test data template in the test case with the random test data.
[0026] Furthermore, to achieve the above objectives, this application also proposes an automated testing device for a communication system, the automated testing device for a communication system comprising:
[0027] The test case creation module is used to create test cases based on the real-time communication scenario of the communication system under test. The test cases contain configuration data in a predefined format.
[0028] The test case parsing module is used to parse the test cases through the first test engine to obtain the communication protocol type corresponding to the communication system under test;
[0029] The system testing module is used to extend the first testing engine based on the communication protocol type to obtain a second testing engine, and to perform automated testing on the communication system under test through the second testing engine;
[0030] The first test engine is built on a service layer and a control layer. The service layer is used to define the service abstraction interface for automated testing, and the control layer is used to define the process control for automated testing.
[0031] In addition, to achieve the above objectives, this application also proposes an automated testing device for a communication system, the device comprising: a memory, a processor, and an automated testing program for a communication system stored in the memory and executable on the processor, the automated testing program for a communication system being configured to implement the steps of the automated testing method for a communication system as described above.
[0032] In addition, to achieve the above objectives, this application also proposes a storage medium, which is a computer-readable storage medium, storing an automated testing program for a communication system. When the automated testing program for a communication system is executed by a processor, it implements the steps of the automated testing method for a communication system as described above.
[0033] In addition, to achieve the above objectives, the present invention also provides a computer program product, the computer program product including a communication system automated test program, which, when executed by a processor, implements the steps of the communication system automated test method as described above.
[0034] This application creates test cases based on the real-time communication scenario of the communication system under test. Each test case contains predefined configuration data. A first test engine parses the test cases to obtain the communication protocol type corresponding to the communication system under test. A second test engine is then extended based on the communication protocol type to obtain a second test engine, which is used to perform automated testing on the communication system under test. The first test engine is built on a service layer and a control layer. The service layer defines the service abstract interface for automated testing, and the control layer defines the process control for automated testing. Compared to traditional manual testing methods, this application's method, by extending the first test engine based on the communication protocol type of the communication system under test to obtain the second test engine, and then using this second test engine to perform automated testing on the communication system under test, eliminates the reliance on professional programming skills in manual testing. This allows for efficient and accurate automated testing even when facing high-demand testing scenarios for the communication system. Attached Figure Description
[0035] Figure 1 This is a schematic diagram of the structure of an automated testing device for a communication system in the hardware operating environment involved in the embodiments of this application;
[0036] Figure 2 This is a flowchart illustrating the first embodiment of the automated testing method for a communication system according to this application.
[0037] Figure 3 This is a flowchart illustrating the second embodiment of the automated testing method for communication systems in this application.
[0038] Figure 4 This is a flowchart illustrating the third embodiment of the automated testing method for communication systems in this application;
[0039] Figure 5 This is a structural block diagram of the first embodiment of the automated testing device for the communication system of this application.
[0040] The realization of the purpose, functional features and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation
[0041] It should be understood that the specific embodiments described herein are for illustrative purposes only and are not intended to limit the scope of this application.
[0042] Reference Figure 1 , Figure 1 This is a schematic diagram of the structure of an automated testing device for a communication system in the hardware operating environment involved in the embodiments of this application.
[0043] like Figure 1 As shown, the automated testing equipment for this communication system may include: a processor 1001, such as a central processing unit (CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. 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 Wireless-Fidelity (Wi-Fi) interface). The memory 1005 may be high-speed random access memory (RAM) or stable non-volatile memory (NVM), such as a disk storage device. Optionally, the memory 1005 may also be a storage device independent of the aforementioned processor 1001.
[0044] Those skilled in the art will understand that Figure 1 The structure shown does not constitute a limitation on automated test equipment for communication systems and may include more or fewer components than shown, or combine certain components, or have different component arrangements.
[0045] like Figure 1 As shown, the memory 1005, which serves as a storage medium, may include an operating system, a network communication module, a user interface module, and an automated testing program for the communication system.
[0046] exist Figure 1 In the automated testing equipment for the communication system shown, the network interface 1004 is mainly used for data communication with the network server; the user interface 1003 is mainly used for data interaction with the user; the processor 1001 and the memory 1005 in the automated testing equipment for the communication system of this application can be set in the automated testing equipment for the communication system. The automated testing equipment for the communication system calls the automated testing program for the communication system stored in the memory 1005 through the processor 1001 and executes the automated testing method for the communication system provided in the embodiment of this application.
[0047] This application provides an automated testing method for a communication system, referring to... Figure 2 , Figure 2This is a flowchart illustrating the first embodiment of the automated testing method for the communication system of this application.
[0048] In this embodiment, the automated testing method for the communication system includes the following steps:
[0049] Step S10: Create test cases based on the real-time communication scenario of the communication system under test. The test cases contain configuration data in a predefined format.
[0050] It should be noted that the executing entity of the method in this embodiment can be a terminal device with communication testing, data processing, and program execution functions, such as a smartphone or computer, or an electronic device with the same or similar functions, such as the aforementioned automated testing equipment for communication systems. The following description uses an automated testing equipment for communication systems (hereinafter referred to as the testing equipment) as an example to illustrate this embodiment and the following embodiments.
[0051] Understandably, the aforementioned communication system under test can be a system that transmits information using electrical signals (or optical signals). It can convert information into electromagnetic waves or other forms of signals for transmission, enabling users to communicate and exchange information in the form of voice, images, and data in different locations.
[0052] It should be understood that the above test case refers to a set of test inputs, execution conditions, and expected results designed for a specific purpose.
[0053] In practical implementation, a test case can be created based on a real-time communication scenario (such as an API call). Basic information, including `conf_data`, `test_data`, and `expect_data`, is filled in according to a predefined format. If necessary, `before_op_data` and `after_op_data` can also be added. This data follows the standardized model of this embodiment and matches the framework structure of `base_controller` and `base_service` to ensure correct parsing and execution. For test engineers without programming experience, this step only requires understanding the test case, clarifying the required test environment configuration, test objectives, test data, and expected values, and filling in each field according to the template's format.
[0054] Step S20: The test cases are parsed by the first test engine to obtain the communication protocol type corresponding to the communication system under test.
[0055] It should be noted that the first test engine is built on a service layer and a control layer. The service layer is used to define the service abstraction interface for automated testing, and the control layer is used to define the process control for automated testing.
[0056] It should be understood that the `base_controller` class in the aforementioned controller layer defines the skeleton methods `prepare_data`, `do_operation`, and `compare_results`, while the specific implementations are completed by subclasses. This pattern ensures clean code and extensibility. Furthermore, `execute_test_case` is the overall entry point for test case execution. The aforementioned service layer, as an auxiliary to the controller layer, provides low-level functions such as data processing and communication interface calls. The `base_service` class in the service layer abstracts a series of service methods, which subclasses can inherit and implement for specific scenarios to maintain the framework's flexibility. In particular, the content in `base_controller` and `base_service` is immutable; any subclass must inherit and implement its scenario-specific logic.
[0057] In practical implementation, the steps described above—parsering test cases using the first test engine to obtain the communication protocol type of the communication system under test—can be implemented based on the following: First, use regular expressions to extract key information from the test cases (e.g., searching for communication commands, data formats, specific fields, status codes, etc.). Second, use natural language processing to identify protocol features related to the communication protocol from the key information. Third, establish a feature library of known communication protocols, including common protocol types (such as HTTP, FTP, MQTT, CoAP, WebSocket, etc.) and their keywords, commonly used formats, and behaviors. Fourth, compare the protocol features corresponding to the test cases with the constructed protocol feature library, and determine the communication protocol type based on the comparison results.
[0058] Step S30: Based on the communication protocol type, the first test engine is extended to obtain a second test engine, and the communication system under test is automatically tested through the second test engine.
[0059] It should be understood that since the first test engine contains flexible and scalable interfaces, after confirming the communication protocol type of the communication system under test, the first test engine can be extended according to the communication protocol type to obtain the second test engine. This allows for the implementation of new functions or customized operations without breaking the existing framework of the first test engine, thereby enhancing the adaptability and long-term maintainability of the test system.
[0060] In practical implementation, the process of automating the testing of the communication system under test can be abstracted into a three-step model of "preparing data - operating the object under test - comparing results". This model is implemented through layered design (such as controller, service layer and communicator factory), which solves the problems of complex operation and poor scalability of traditional testing methods and improves code readability and testing efficiency.
[0061] This embodiment creates test cases based on the real-time communication scenario of the communication system under test. Each test case contains predefined configuration data. A first test engine parses the test cases to obtain the communication protocol type corresponding to the communication system under test. Based on the communication protocol type, the first test engine is extended to obtain a second test engine, which is then used to perform automated testing on the communication system under test. The first test engine is built on a service layer and a control layer. The service layer defines the service abstract interface for automated testing, and the control layer defines the process control for automated testing. Compared to traditional manual testing methods, this embodiment eliminates the reliance on professional programming skills in manual testing by extending the first test engine based on the communication protocol type of the communication system under test to obtain the second test engine, and then performing automated testing on the communication system under test based on the second test engine. This allows for efficient and accurate execution of automated testing even when facing high-demand testing scenarios for the communication system.
[0062] refer to Figure 3 , Figure 3 This is a flowchart illustrating the second embodiment of the automated testing method for the communication system of this application.
[0063] In one feasible implementation, step S10 may include:
[0064] Step S101: Determine the test data template corresponding to the communication system under test during the test based on the real-time communication scenario in which the communication system under test is located.
[0065] Step S102: Send the test data template to the tester and guide the tester to fill in the predefined format configuration data in the test data template to obtain test cases. The predefined format is JSON format, and the configuration data includes test context information, test data, and expected result configuration.
[0066] It should be noted that the JSON (JavaScript Object Notation) format described above is a lightweight data interchange format. It can include one or more of the following: numbers, strings, booleans, arrays, objects, and null. This embodiment does not impose any limitations on this. Data in JSON appears in the form of "name / value" pairs, with the name first (enclosed in double quotes) and the value pair second, separated by a colon. Multiple "name / value" pairs are separated by commas in JSON.
[0067] Understandably, the aforementioned test context information (i.e., conf_data) can include the test scenario, target environment, and related configuration parameters, ensuring the reusability and configurability of the test cases. The aforementioned test data (i.e., test_data) can be used to reference predefined data templates and specify the fields to be replaced and their values. This design allows for the dynamic generation of test data to adapt to changes in various interface parameters. The aforementioned expected result configuration (i.e., expect_data) can be used to set expected values such as API responses and database query results, supporting multiple data storage types, including relational databases, ElasticSearch, Redis, etc., simplifying the setting of result verification.
[0068] In practice, the test case design steps outlined above not only lower the technical barrier to writing automated test cases, enabling even novice testers to quickly adapt, but also decouple them from specific business logic through interaction with the service layer interface, enhancing the flexibility and maintainability of the test cases. Furthermore, all test cases, configurations, and execution data are stored in a standard-structured database, facilitating integration with the team's continuous integration tools and other test management platforms, thus improving the standardization and efficiency of the testing process.
[0069] In one feasible implementation, the automated testing method for the communication system may further include:
[0070] Step S40: Generate a custom function based on the test content of the communication system under test. The custom function is used to randomly generate test data that matches the test content.
[0071] Step S50: When performing automated testing on the communication system under test, the second test engine calls the custom function to generate random test data, and replaces the random test data in the test data template of the test case.
[0072] In practical implementation, reflection technology can be used to enable the second test engine to call a custom function to generate random test data. For example, assuming the custom function is "generate_random_card_number" to generate a random credit card number, the second test engine will automatically call this function during test execution, generating data and replacing it in the test data template to ensure the data conforms to business rules. After completing the operation, the system will compare the expected results in the database and check the fields of the "T_WLT_TRAN_CMB" table updated by the "RL_WLT_NRT" interface. Furthermore, this configuration also supports calling the interface configured in "T_RL_WLT_NRT" to complete data preparation before calling the object under test.
[0073] This embodiment determines the test data template corresponding to the communication system under test during testing based on the real-time communication scenario of the system under test. The test data template is sent to the testers, who are then guided to fill in predefined format configuration data to obtain test cases. The predefined format is JSON, and the configuration data includes test context information, test data, and expected result configuration. A custom function is generated based on the test content of the communication system under test. This custom function is used to randomly generate test data matching the test content. When performing automated testing on the communication system under test, the second test engine calls the custom function to generate random test data, which is then used to replace the test data template in the test cases. Compared to traditional manual testing methods, this embodiment lowers the technical threshold for writing automated test cases by guiding testers to fill in predefined format configuration data in the test data template, allowing even novice testers to quickly adapt. Furthermore, through interaction with the service layer interface, decoupling from specific business logic is achieved, enhancing the flexibility and maintainability of the test cases.
[0074] refer to Figure 4 , Figure 4 This is a flowchart illustrating the third embodiment of the automated testing method for communication systems in this application.
[0075] In one feasible implementation, step S30 may include:
[0076] Step S301: Determine the preset decorator according to the communication protocol type, and generate a communicator subclass corresponding to the communication protocol type from the communicator factory.
[0077] It should be noted that the preset decorator is used to add custom logic before and after the process of automating the testing of the communication system under test, and the communicator subclass is used to update the communication protocol of the first test engine.
[0078] Step S302: Extend the first test engine based on the preset decorator and the communicator subclass to obtain the second test engine.
[0079] It should be understood that, to adapt to various real-time communication protocols, this embodiment employs the factory pattern, creating a communicator factory. This factory is responsible for dynamically generating corresponding communicator subclasses based on the protocol type in the test cases. In this way, when adding or updating communication protocols, there is no need to modify existing core code; only the creation of new communicator subclasses is required, ensuring code modularity and extensibility. The communicator class structure defines a generic interface through an abstract base class, while specific protocol implementations (such as HTTP, WebSocket, etc.) are subclasses that override these interfaces, implementing support for different protocols. This design allows testers to specify the protocol type when configuring test cases, without needing to concern themselves with the underlying implementation, maintaining the consistency and compatibility of configuration data. Through the communicator factory, this embodiment provides a better solution, enabling easy addition or updating of real-time communication protocols without disrupting the existing test case configuration format, thereby enhancing the adaptability and flexibility of the test engine.
[0080] In its implementation, to address complex and customized testing needs, this embodiment introduces the decorator pattern to generate the aforementioned preset decorators. Decorators extend the `do_operation` and `compare_results` methods of the service layer, allowing testers to add custom logic before and after test execution, such as data preprocessing or post-processing. The `before_op_data` and `after_op_data` fields in the test case configuration specify the decorator parameters, making the configuration of customized operations simple and intuitive.
[0081] Step S303: Establish a communication connection with the communication system under test, and generate test preparation data through the preset decorator in the second test engine.
[0082] It should be noted that the aforementioned test preparation data not only covers traditional test case input data but also includes the complete test context, such as system configuration, dependent service status, and preprocessing operations. This comprehensive data model ensures the integrity of the test and avoids test errors caused by environmental factors. Compared to traditional methods that only focus on the data sent to the system under test, the "test preparation data" in this embodiment places greater emphasis on simulating the test scenario, making the test closer to the actual operating environment and improving the accuracy and reliability of the test.
[0083] Step S304: Convert the test preparation data into a test request through the communicator subclass in the second test engine, and perform automated testing on the communication system under test based on the test request.
[0084] It should be understood that before sending the aforementioned test request, the second test engine can perform preprocessing operations based on predefined or custom decorators in the configuration application to complete data preparation and pre-processing. After sending the aforementioned test request, the base_controller in the second test engine calls the do_operation method of base_service, which is implemented by the specific service subclass to communicate with the system under test in real time, including building the request, sending the request, and receiving the response.
[0085] In one feasible implementation, step S304 may include:
[0086] Step S3041: Convert the test preparation data into a test request through the communicator subclass in the second test engine, and send the test request to the communication system under test.
[0087] Step S3042: Receive the first response data returned by the communication system under test based on the test request, and process the first response data through the preset decorator to obtain the second response data.
[0088] Step S3043: Determine the automated test result of the communication system under test based on the second response data.
[0089] In the implementation, comparison logic can be defined, and based on this logic, the difference between the second response data and the expected result can be compared to determine the automated test result of the communication system under test, including but not limited to response messages, database status, etc., to ensure test accuracy. For example, reflection can be used to call a custom comparison function in the configuration to compare the response data with the expected result, ensuring the test objective is achieved. After completing the automated testing of the communication system under test, a detailed test report can be generated, including test status, execution time, difference analysis, and other information.
[0090] This embodiment determines a preset decorator based on the communication protocol type and generates a communicator subclass corresponding to the communication protocol type from the communicator factory; it extends the first test engine based on the preset decorator and the communicator subclass to obtain a second test engine; wherein, the preset decorator is used to add custom logic before and after the automated testing process of the communication system under test, and the communicator subclass is used to update the communication protocol of the first test engine; it establishes a communication connection with the communication system under test and generates test preparation data through the preset decorator in the second test engine; it converts the test preparation data into a test request through the communicator subclass in the second test engine and sends the test request to the communication system under test; it receives the first response data returned by the communication system under test based on the test request, and processes the first response data through the preset decorator to obtain second response data; it determines the automated test result of the communication system under test based on the second response data. Compared to traditional testing methods, the method described in this embodiment uses the factory pattern to achieve dynamic support for communication protocols and uses decorators and reflection techniques to achieve customization of test logic. This non-intrusive design allows for the easy addition of new functions or customized operations without breaking the existing framework, enhancing the system's adaptability and long-term maintainability, thereby improving the accuracy and reliability of testing.
[0091] Furthermore, this application also proposes a storage medium storing an automated testing program for a communication system, wherein when the automated testing program for a communication system is executed by a processor, it implements the steps of the automated testing method for a communication system as described above.
[0092] Reference Figure 5 , Figure 5 This is a structural block diagram of the first embodiment of the automated testing device for the communication system of this application.
[0093] like Figure 5 As shown, the automated testing apparatus for communication systems proposed in this application includes:
[0094] The test case creation module 501 is used to create test cases based on the real-time communication scenario of the communication system under test. The test cases contain configuration data in a predefined format.
[0095] The test case parsing module 502 is used to parse the test cases through the first test engine to obtain the communication protocol type corresponding to the communication system under test;
[0096] The system testing module 503 is used to extend the first testing engine based on the communication protocol type to obtain a second testing engine, and to perform automated testing on the communication system under test through the second testing engine;
[0097] The first test engine is built on a service layer and a control layer. The service layer is used to define the service abstraction interface for automated testing, and the control layer is used to define the process control for automated testing.
[0098] This embodiment creates test cases based on the real-time communication scenario of the communication system under test. Each test case contains predefined configuration data. A first test engine parses the test cases to obtain the communication protocol type corresponding to the communication system under test. Based on the communication protocol type, the first test engine is extended to obtain a second test engine, which is then used to perform automated testing on the communication system under test. The first test engine is built on a service layer and a control layer. The service layer defines the service abstract interface for automated testing, and the control layer defines the process control for automated testing. Compared to traditional manual testing methods, this embodiment eliminates the reliance on professional programming skills in manual testing by extending the first test engine based on the communication protocol type of the communication system under test to obtain the second test engine, and then performing automated testing on the communication system under test based on the second test engine. This allows for efficient and accurate execution of automated testing even when facing high-demand testing scenarios for the communication system.
[0099] Based on the first embodiment of the automated testing device for communication systems described in this application, a second embodiment of the automated testing device for communication systems described in this application is proposed.
[0100] In this embodiment, the test case creation module 501 is further configured to determine the test data template corresponding to the communication system under test during testing based on the real-time communication scenario in which the communication system under test is located; send the test data template to the tester, and guide the tester to fill in the predefined format configuration data in the test data template to obtain test cases. The predefined format is JSON format, and the configuration data includes test context information, test data, and expected result configuration.
[0101] Furthermore, the system testing module 503 is also used to determine a preset decorator according to the communication protocol type, and generate a communicator subclass corresponding to the communication protocol type from the communicator factory; based on the preset decorator and the communicator subclass, the first test engine is extended to obtain a second test engine; wherein, the preset decorator is used to add custom logic before and after the process of automating the testing of the communication system under test, and the communicator subclass is used to update the communication protocol of the first test engine.
[0102] Furthermore, the system testing module 503 is also used to establish a communication connection with the communication system under test, and generate test preparation data through a preset decorator in the second test engine; convert the test preparation data into a test request through a communicator subclass in the second test engine, and perform automated testing on the communication system under test based on the test request.
[0103] Furthermore, the system testing module 503 is also used to convert the test preparation data into a test request through the communicator subclass in the second test engine, and send the test request to the communication system under test; receive the first response data returned by the communication system under test based on the test request, and process the first response data through the preset decorator to obtain the second response data; and determine the automated test result of the communication system under test based on the second response data.
[0104] Furthermore, the system testing module 503 is also used to generate a custom function based on the test content of the communication system under test. The custom function is used to randomly generate test data that matches the test content. When the communication system under test is subjected to automated testing, the custom function is called through the second testing engine to generate random test data, and the random test data is used to replace the test data template in the test case.
[0105] Other embodiments or specific implementations of the automated testing device for the communication system in this application can be found in the above-described method embodiments, and will not be repeated here.
[0106] 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.
[0107] The sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0108] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as read-only memory / random access memory, magnetic disk, optical disk) and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of this application.
[0109] The above are merely preferred embodiments of this application and do not limit the patent scope of this application. Any equivalent structural or procedural transformations made using the content of this application's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of this application.
Claims
1. An automated testing method for a communication system, characterized in that, The method includes the following steps: Test cases are created based on the real-time communication scenario of the communication system under test, and the test cases contain configuration data in a predefined format. The test cases are parsed by the first test engine to obtain the communication protocol type corresponding to the communication system under test; The first test engine is extended based on the communication protocol type to obtain the second test engine, and the communication system under test is automatically tested through the second test engine. The first test engine is built on a service layer and a control layer. The service layer is used to define the service abstraction interface for automated testing, and the control layer is used to define the process control for automated testing. The step of extending the first test engine based on the communication protocol type to obtain the second test engine includes: A preset decorator is determined based on the communication protocol type, and a communicator subclass corresponding to the communication protocol type is generated from the communicator factory. The preset decorator is used to add custom logic before and after the process of automating the testing of the communication system under test, and the communicator subclass is used to update the communication protocol of the first test engine. The first test engine is extended based on the preset decorator and the communicator subclass to obtain the second test engine.
2. The automated testing method for a communication system as described in claim 1, characterized in that, The steps for creating test cases based on the real-time communication scenario of the communication system under test include: The test data template corresponding to the communication system under test is determined based on the real-time communication scenario in which the communication system under test is located. The test data template is sent to the testers, who are then guided to fill in the predefined format configuration data in the test data template to obtain test cases. The predefined format is JSON format, and the configuration data includes test context information, test data, and expected result configuration.
3. The automated testing method for a communication system as described in claim 1, characterized in that, The step of automating the testing of the communication system under test using the second testing engine includes: Establish a communication connection with the communication system under test, and generate test preparation data through the preset decorator in the second test engine; The test preparation data is converted into a test request by the communicator subclass in the second test engine, and the communication system under test is automatically tested based on the test request.
4. The automated testing method for a communication system as described in claim 3, characterized in that, The step of converting the test preparation data into a test request using a communicator subclass in the second test engine, and then performing automated testing on the communication system under test based on the test request, includes: The test preparation data is converted into a test request by the communicator subclass in the second test engine, and the test request is sent to the communication system under test. Receive the first response data returned by the communication system under test based on the test request, and process the first response data through the preset decorator to obtain the second response data; The automated test results of the communication system under test are determined based on the second response data.
5. The automated testing method for a communication system as described in claim 1, characterized in that, The method further includes: A custom function is generated based on the test content of the communication system under test. The custom function is used to randomly generate test data that matches the test content. When performing automated testing on the communication system under test, the second test engine calls the custom function to generate random test data, and replaces the test data template in the test case with the random test data.
6. An automated testing device for a communication system, characterized in that, The automated testing device for the communication system includes: The test case creation module is used to create test cases based on the real-time communication scenario of the communication system under test. The test cases contain configuration data in a predefined format. The test case parsing module is used to parse the test cases through the first test engine to obtain the communication protocol type corresponding to the communication system under test; The system testing module is used to extend the first testing engine based on the communication protocol type to obtain a second testing engine, and to perform automated testing on the communication system under test through the second testing engine; The first test engine is built on a service layer and a control layer. The service layer is used to define the service abstraction interface for automated testing, and the control layer is used to define the process control for automated testing. The use case parsing module is also used for: A preset decorator is determined based on the communication protocol type, and a communicator subclass corresponding to the communication protocol type is generated from the communicator factory. The preset decorator is used to add custom logic before and after the process of automating the testing of the communication system under test, and the communicator subclass is used to update the communication protocol of the first test engine. The first test engine is extended based on the preset decorator and the communicator subclass to obtain the second test engine.
7. An automated testing device for a communication system, characterized in that, The device includes: a memory, a processor, and an automated testing program for a communication system stored in the memory and executable on the processor, the automated testing program for a communication system being configured to implement the steps of the automated testing method for a communication system as described in any one of claims 1 to 5.
8. A storage medium, characterized in that, The storage medium is a computer-readable storage medium, and the storage medium stores an automated testing program for a communication system. When the automated testing program for a communication system is executed by a processor, it implements the steps of the automated testing method for a communication system as described in any one of claims 1 to 5.
9. A computer program product, characterized in that, The computer program product includes a communication system automated test program, which, when executed by a processor, implements the steps of the communication system automated test method as described in any one of claims 1 to 5.
Citation Information
Patent Citations
Interface automatic test method, device and equipment and computer readable storage medium
CN111737140A