Customized equipment software test data automatic generation method
By building and instantiating the application layer interface template, configuring field attributes and association relationships, and automatically generating customized test data frame collections, it solves the problem that the existing technology is difficult to fully cover the equipment software interface and application scenarios, and realizes efficient and flexible test data generation, which significantly improves the test quality and efficiency.
Patent Information
- Application Number
- CN202411778579.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-05
- Publication Date
- 2025-05-06
- Estimated Expiration
- 2044-12-05
AI Technical Summary
The existing automatic generation method of test data is difficult to comprehensively and effectively cover the interfaces and application scenarios of equipment software, resulting in insufficient testing depth and breadth. At the same time, the existing configuration mechanism is not flexible enough, making it difficult to adapt to the complexity and diversity of high-reliability software testing.
By building an application layer interface template and instantiating it into an interface instance model, it supports configuration of field attributes and association relationships, and combining data coverage requirements and restrictions, a customized test data frame collection is automatically generated to achieve comprehensive coverage of software interfaces and application scenarios.
The generated test data is more comprehensive, applicable and targeted, which significantly improves the depth and breadth of the test, enhances the flexibility and adaptability of the test, and improves the testing efficiency and quality.
Smart Images

Figure CN119938513A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of software testing technology, and specifically to a customized automatic generation method for equipment software test data. It is suitable for generating software test data for equipment software with a universal interface (such as an RS422 serial port, a CAN bus interface, etc.). The present invention constructs an application layer universal template based on an interface, and generates a model after instantiating the template using a project communication protocol. The model provides a data usage requirement configuration function, a data restriction constraint configuration function, and a test coverage requirement configuration function. The instantiated model automatically extracts basic test data points based on the configuration, and then automatically generates a customized test data frame set in combination with the coverage requirements and restriction constraints, thereby performing comprehensive, complete, and highly reliable equipment software testing. Background Art
[0002] In view of the strict requirements of equipment software for high reliability and high security, its testing work mainly focuses on two core points: one is to ensure the correctness and reliability of software interface implementation, and the other is to verify the reliability and robustness of software function implementation in different application scenarios. These tests are driven by carefully designed test data, so the comprehensiveness and applicability of test data design have become key factors in determining test quality.
[0003] However, the existing methods for automatic test data generation have significant limitations. Some methods only focus on covering software interface protocols to design test data, while others mainly analyze functional scenarios. Both methods fail to effectively achieve comprehensive and effective coverage of software interfaces and application scenarios, thus weakening the depth and breadth of testing to a certain extent.
[0004] In addition, the existing software requirements and test requirements configuration mechanism is not flexible enough to adapt to the complexity and diversity of high-reliability software testing. This rigid configuration not only limits the innovation of test strategies, but also hinders the further improvement of test efficiency and quality. Summary of the invention
[0005] In view of the problems existing in the prior art, the present invention provides a customized method for automatically generating equipment software test data. The test data automatic generation model of the present method formalizes the communication protocol into a displayable and operable field format, supports the configuration of field attributes, and can configure test requirements by field. The interface templates defined by the test data automatic generation model have the characteristics of universality, reusability and flexible matching. The test data automatic generation model is configured in units of fields. After configuring the data coverage requirements and constraints according to the software test requirements during test design, the model automatically generates test data for each field, and concatenates the field test data into a complete data frame in a set manner, finally forming a test data set with a reasonable design method and meeting the test coverage requirements, which can achieve sufficient testing of the correctness, completeness and reliability of the software.
[0006] The technical solution of the present invention is: a customized equipment software test data automatic generation method, the specific steps are as follows:
[0007] Step 1: Build an application layer interface template and instantiate it into an interface instance model;
[0008] Analyze the commonly used interface types of equipment embedded software and the communication characteristics of each interface type, extract common characteristics, and construct a common format template for the application layer of each interface type. The common format template for the application layer of the interface type is referred to as the interface template; the interface template displays the common format of the interface in an interactively editable manner to achieve functions that can be displayed and edited by users; instantiate the interface template according to the communication protocol to form an interface instance model. The interface instance model uses fields as configuration units and configures the basic attributes of each field according to the communication protocol;
[0009] Step 2: Set field associations and change rules;
[0010] According to software testing requirements, set field change rules and restrictions for individual fields and the relationships between fields;
[0011] Step 3: Configure the test coverage strategy for each field data and configure the data extraction method;
[0012] Step 4: Generate test data;
[0013] The interface instance model generates multiple test data for each field and field group according to the configured test coverage strategy and data extraction method, combined with data association and change requirements;
[0014] Step 5: Generate a test data frame set;
[0015] The interface instance model is configured with a field test data serial combination mode. The interface instance model serializes the data of each field or field group into a data frame according to the set data combination mode, and finally forms an interface test data set in units of data frames.
[0016] Furthermore, step one supports interface type extension to support the universality, reusability and scalability of the interface template.
[0017] Furthermore, the basic attributes of each field described in step one include field name, field length, data type, data domain, data resolution, and data calculation method.
[0018] Furthermore, the test coverage strategy for configuring each field data in step three is as follows: the interface instance model has a general normal and abnormal data value coverage strategy built in, and also supports configuring a specific coverage strategy for each field data and a priority coverage strategy for associated fields.
[0019] Furthermore, the configuration data extraction method described in step three includes equivalence class value selection, boundary 5-point value selection method, boundary 7-point value selection method, upper point, inner point and outer point analysis method, special value point coverage, and full value coverage.
[0020] Furthermore, the data combination method in step five includes a Cartesian product algorithm and an orthogonal decomposition table method.
[0021] The beneficial effects of the present invention are:
[0022] 1. This invention patent proposes an innovative test data automatic generation method, which aims to comprehensively and effectively cover the interfaces and application scenarios of equipment software. By comprehensively using interface protocols, application function scenario requirements and test requirements, this invention can generate more comprehensive, applicable and targeted test data, thereby significantly improving the depth and breadth of the test.
[0023] 2. The present invention also introduces a flexible and configurable software requirement and test requirement mechanism, which enables testers to flexibly adjust test strategies and configurations according to actual test requirements to adapt to the complexity and diversity of high-reliability software testing. The introduction of this mechanism not only enhances the flexibility and adaptability of testing, but also lays a solid foundation for the dual improvement of test efficiency and quality.
[0024] 3. The universal interface template designed by the patent of this invention has excellent versatility, high reusability and flexible and convenient configuration characteristics. By injecting the specific application layer interface communication protocol into the template, the instantiation of the interface can be easily realized. More advanced is that we formalize the interface protocol into an intuitive, displayable and easy-to-operate field format. This innovation greatly improves the convenience and efficiency of user operations and meets the user's operation needs in a variety of application scenarios.
[0025] 4. After the interface is instantiated, its smallest constituent unit is refined to the field level. This design allows us to flexibly configure the required fields based on different software requirements, and to fine-tune the test coverage requirements of the fields according to specific test requirements (including but not limited to normal, abnormal, boundary values, extreme values, special value points, etc.). In addition, we also support setting complex associations and restriction relationships between fields, so that customized test data that meets special associations and change requirements can be generated to cope with diverse performance requirements and application scenarios. By adopting advanced data combination strategies, we can automatically concatenate field data into a complete interface test data frame, thereby achieving comprehensive and in-depth testing of the correctness, completeness and reliability of the software interface.
[0026] In summary, the patent of this invention effectively makes up for the deficiencies of the existing test data automatic generation method and configuration mechanism, and provides strong support for high-reliability testing of equipment software. It is widely used to generate test data for various bus and interface types, including but not limited to RS422, RS232, 1553B bus, CAN bus, and other interfaces with a universal protocol structure. It is particularly worth mentioning that this method has demonstrated excellent performance and applicability in terms of testing needs to cover specific complex scenarios, including outlier testing, special value point test coverage requirements, and meeting high safety standards. Through this method, testers can efficiently generate test data that meets various stringent test conditions, thereby ensuring the stability and reliability of the system or interface under test under various extreme conditions. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] Figure 1 Implement a flow chart for the automatic generation of test data for customized equipment software;
[0028] Figure 2 Construction and instantiation of models for interface test data generation;
[0029] Figure 3 This is the process schematic diagram for steps 3 to 5. DETAILED DESCRIPTION
[0030] The present invention will be further described below in conjunction with the accompanying drawings.
[0031] like Figure 1 As shown in the figure, the five-step application principle of the customized equipment software test data automatic generation method is as follows:
[0032] 1. Construct an application layer interface template and instantiate it as a model: Analyze the commonly used interface types of equipment embedded software and the communication characteristics of each interface, extract common features, and construct a general format template for each type of interface application layer. At the same time, support interface type extension to support the universality, reusability and extensibility of the interface template. The interface template displays the general format of the interface in an interactively editable manner to achieve user-displayable and editable functions. The interface template supports the modification, addition, and deletion of each field. The interface template is instantiated according to the communication protocol. The instantiated model uses the field as the configuration unit. The basic attributes of each field are configured according to the communication protocol, including field name, field length, data type, data domain, data resolution, data calculation method and other information (see Figure 2 ). Configure each field attribute to the model.
[0033] 2. Set special rules such as field associations and change requirements: According to the software testing requirements and the specific requirements of the software application interface data, the change rules of individual fields can be set. At the same time, the associations between fields and data restrictions can be set, such as the reset change requirements after a field data reaches a specified value, the three coordinates of the triangular search area are not in a straight line, etc.
[0034]
[0035] 3. Configure field test coverage strategies and methods: The interface instance model has built-in general normal and abnormal data value coverage strategies, and also supports configuring specific coverage strategies for each field data and priority coverage strategies for related fields, and configuring data extraction methods such as equivalence class value selection, boundary 5-point value selection method, boundary 7-point value selection method, upper point, inner point, and outer point analysis method, special value point coverage, and full value coverage.
[0036] 4. Generate test data: The interface instance model generates multiple test data points for each field and field group based on the configured coverage rate and method, combined with data association and change requirements.
[0037] 5. Generate test data framing set: Configure the field test data serial combination mode to the interface instance model. The interface instance model serializes the data of each field or field group into a data frame according to the set data combination mode (such as Cartesian product algorithm, orthogonal decomposition table method). After all the test data points of all fields are framed, an interface test data set in data frames is formed. The process principle diagram of steps 3 to 5 is as follows: Figure 3 shown.
[0038] The patent of this invention effectively makes up for the deficiencies of existing test data automatic generation methods and configuration mechanisms, and provides strong support for high-reliability testing of equipment software. It is widely used to generate test data for various bus and interface types, including but not limited to RS422, RS232, 1553B bus, CAN bus, and other interfaces with a universal protocol structure. It is particularly worth mentioning that this method has demonstrated excellent performance and applicability in terms of testing needs to cover specific complex scenarios, including outlier testing, special value point test coverage requirements, and meeting high safety standards. Through this method, testers can efficiently generate test data that meets various stringent test conditions, thereby ensuring the stability and reliability of the system or interface under test under various extreme conditions.
[0039] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. A customized method for automatically generating equipment software test data, characterized in that: The specific steps are as follows: Step 1: Build an application layer interface template and instantiate it into an interface instance model; Analyze the commonly used interface types of equipment embedded software and the communication characteristics of each interface type, extract common characteristics, and construct a common format template for the application layer of each interface type. The common format template for the application layer of the interface type is referred to as the interface template; the interface template displays the common format of the interface in an interactively editable manner to achieve functions that can be displayed and edited by users; instantiate the interface template according to the communication protocol to form an interface instance model. The interface instance model uses fields as configuration units and configures the basic attributes of each field according to the communication protocol; Step 2: Set field associations and change rules; According to software testing requirements, set field change rules and restrictions for individual fields and the relationships between fields; Step 3: Configure the test coverage strategy for each field data and configure the data extraction method; Step 4: Generate test data; The interface instance model generates multiple test data for each field and field group according to the configured test coverage strategy and data extraction method, combined with data association and change requirements; Step 5: Generate a test data frame set; The interface instance model is configured with a field test data serial combination mode. The interface instance model serializes the data of each field or field group into a data frame according to the set data combination mode, and finally forms an interface test data set in units of data frames.
2. According to claim 1, a customized equipment software test data automatic generation method is characterized by: In step one, interface type extension is supported to support the universality, reusability and scalability of the interface template.
3. The customized automatic generation method of equipment software test data according to claim 1, characterized in that: The basic attributes of each field described in step 1 include field name, field length, data type, data domain, data resolution, and data calculation method.
4. The customized automatic generation method of equipment software test data according to claim 1, characterized in that: The test coverage strategy for configuring each field data in step three is as follows: the interface instance model has a general normal and abnormal data value coverage strategy built in, and also supports configuring a specific coverage strategy for each field data and a priority coverage strategy for associated fields.
5. The customized automatic generation method of equipment software test data according to claim 1, characterized in that: The configuration data extraction methods described in step three include equivalence class value selection, boundary 5-point value selection method, boundary 7-point value selection method, upper point, inner point and outer point analysis method, special value point coverage, and full value coverage.
6. The customized automatic generation method of equipment software test data according to claim 1, characterized in that: The data combination method described in step five includes Cartesian product algorithm and orthogonal decomposition table method.
Citation Information
Patent Citations
Formalized modeling method for warship equipment software interface protocol
CN106326096A
Multi-bus protocol testing and simulation method based on ICD database and platform
CN106980560A
Automation interface testing method for early warning detection system
CN108563569A
Software communication interface general message organizing and sending method
CN110636049A
Interface test case generation method and device
CN111444096A