Configuration interface automatic testing method, device, electronic equipment and storage medium
By abstracting and grouping the interfaces of commercial banks, the problem of difficulty in realizing large-scale and multi-type interface automation testing in the existing technology is solved, and the flexibility and scalability of testing are improved to meet the diverse interface needs of commercial banks. Efficient organization-level automated testing is achieved.
Patent Information
- Application Number
- CN202210118280.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-02-08
- Publication Date
- 2024-11-12
- Estimated Expiration
- 2042-02-08
AI Technical Summary
The existing technology is difficult to realize large-scale and various interface automated testing in commercial banks, especially in the agile R&D model. The testing work requires efficient completion of iterative product quality confirmation and system regression testing. The existing method test script writing is costly. , Maintenance costs are high and difficult to meet organizational automation testing needs.
By abstracting the interface of the target system under test, the basic feature model of the interface is determined, including communication components, message components and message formats, grouping and unified configuration according to the model, four levels of optional configuration items are designed, and transaction types are realized , transaction and data levels flexible configurations, support rapid automated testing of large-scale and various types of interfaces.
It realizes modeling and unified packaging of interface automation tests, reduces the repetition and maintenance costs of configuration items, improves the flexibility and scalability of testing, adapts to the diversified interface needs of commercial banks, and supports organization-level automated testing.
Smart Images

Figure CN114461525B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to the technical field of interface automation testing, and in particular to a configuration-based interface automation testing method, device, electronic device and storage medium. Background Art
[0002] Commercial banks generally start informatization construction early, especially large state-owned commercial banks, which are advancing in an orderly and steady manner. Due to technical limitations during construction and the influence of related third parties, new and old technology stacks coexist, interface communication methods are diverse, and there are many types of messages. There are also various communication messages that do not conform to common message specifications. These make it difficult to fully roll out interface automation testing on a large scale.
[0003] The rise of the Internet, especially the popularization of mobile Internet, has made commercial banks' demand iteration faster and faster, and the agile R&D model has become an irreversible trend. In the increasingly shorter iteration cycle, testing work must not only efficiently complete the iterative product quality confirmation, but also simultaneously accumulate automated test case sets for system regression, which is time-sensitive and heavy.
[0004] Therefore, how to improve the automated testing capability of the configurable interface is a technical problem that needs to be solved urgently by those skilled in the art. Summary of the invention
[0005] The embodiments of the present invention provide a configuration-based interface automatic testing method, device, electronic device and storage medium, which enable the configuration-based interface to be flexibly configured and improve the configuration-based interface automatic testing capability.
[0006] In a first aspect, an embodiment of the present invention provides a configuration-based interface automated testing method, comprising:
[0007] Abstracting the target system under test interface and determining a basic characteristic model of the target system under test interface; the target system under test interface characteristic model includes a communication component, a message component and a message format;
[0008] Determine the target system under test interface grouping result according to the target system under test interface basic characteristic model;
[0009] According to the target system under test interface grouping result, the target system under test interfaces in the same group are uniformly configured by selecting the same target configuration item.
[0010] In a second aspect, an embodiment of the present invention further provides a configurable interface automatic testing device, comprising:
[0011] The target system under test interface basic characteristic model determination module is used to abstract the target system under test interface and determine the target system under test interface basic characteristic model; the target system under test interface characteristic model includes communication components, message components and message formats;
[0012] The target system under test interface grouping result determination module is used to determine the target system under test interface grouping result according to the target system under test interface basic characteristic model;
[0013] The target configuration item configuration module is used to select the same target configuration item for the target tested system interfaces in the same group to perform unified configuration according to the target tested system interface grouping result.
[0014] In a third aspect, an embodiment of the present invention further provides an electronic device, the electronic device comprising:
[0015] one or more processors;
[0016] A storage device for storing one or more programs;
[0017] When the one or more programs are executed by the one or more processors, the one or more processors implement the configuration-based interface automatic testing method described in any embodiment of the present invention.
[0018] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the configuration-based interface automatic testing method described in any embodiment of the present invention.
[0019] The embodiment of the present invention provides a configuration-based interface automation test method, device, electronic device and storage medium, which abstracts the target system interface to determine the basic feature model of the target system interface; the target system interface feature model includes communication components, message components and message formats; the target system interface grouping result is determined according to the target system interface basic feature model; the target system interface in the same group is uniformly configured by selecting the same target configuration item according to the target system interface grouping result. The technical solution of the embodiment of the present invention is adopted to realize unified encapsulation of the interface automation test model, classify the interface by technology, design four levels of optional configuration items, realize flexible configuration of transaction type, transaction and data level, and can quickly realize the automation test requirements of large-scale and multi-type interfaces. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] Other features, objects and advantages of the present invention will become more apparent by reading the detailed description of non-limiting embodiments made with reference to the following drawings. The drawings are only for the purpose of illustrating preferred embodiments and are not to be considered as limiting the present invention. Also, the same reference symbols are used throughout the drawings to represent the same parts. In the drawings:
[0021] Figure 1A This is a flow chart of a configuration-based interface automation testing method provided in Embodiment 1 of the present invention;
[0022] Figure 1B This is a schematic diagram of the structure of an interface automation test provided by the first embodiment of the present invention;
[0023] Figure 1C A schematic diagram of a basic characteristic model of a system under test interface provided in the first embodiment of the present invention;
[0024] Figure 2A A flowchart of a configuration-based interface automation testing method provided in Embodiment 2 of the present invention;
[0025] Figure 2B This is a schematic diagram of a plug-in hierarchical configuration structure provided by Embodiment 2 of the present invention;
[0026] Figure 3 It is a structural diagram of a configurable interface automation test device provided in Embodiment 3 of the present invention;
[0027] Figure 4 It is a structural schematic diagram of an electronic device provided in Embodiment 4 of the present invention. DETAILED DESCRIPTION
[0028] The present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the present invention, rather than to limit the present invention. It should also be noted that, for ease of description, only parts related to the present invention, rather than all structures, are shown in the accompanying drawings.
[0029] Before discussing the exemplary embodiments in more detail, it should be mentioned that some exemplary embodiments are described as processes or methods depicted as flow charts. Although the flow charts describe the operations (or steps) as sequential processes, many of the operations (or steps) therein can be implemented in parallel, concurrently or simultaneously. In addition, the order of the operations can be rearranged. The process can be terminated when its operation is completed, but can also have additional steps not included in the accompanying drawings. The process can correspond to a method, function, procedure, subroutine, subprogram, etc.
[0030] With the rise of the Internet, especially mobile Internet, the speed of commercial bank product iteration has continued to increase, but the requirements for stability and reliability have not decreased. The importance of automated testing has become increasingly prominent, and interface automated testing has received much attention because it is easy to carry out and has low maintenance costs. Commercial banks have a large number of running, important, stable systems that require regression testing, and they are in urgent need of building core automated testing assets. Under the agile model, automated testing construction and regression work in each iteration cycle are also imminent, which places extremely high demands on organizational-level automated testing support capabilities. For methods of implementing interface automated testing, there are currently two main technical solutions:
[0031] Solution 1: Testers use testing tools such as Postman, Apache JMeter, and SoapUI to simulate the client sending message requests to the server, parse the response information returned by the server, and verify whether the interface of the system under test meets the requirements. This solution writes scripts for a single test scenario. Most scenarios only involve a single interface. The test scripts are expensive to write and maintain, and are difficult to carry out on a large scale. They cannot support organizational-level automated testing tasks.
[0032] Solution 2: A unified interface testing platform, a unified test management and execution entry, generally provides a commonly used communication method (for example, http communication), and the specific test case\script adopts the method of user-written scripts (including jar packages) to implement the assembly, parsing and judgment logic of the message, and its execution is provided by the platform with a uniformly orchestrated execution process. Using the technology of this solution, the writing of test cases\scripts is still left to the testers to implement, which has high technical requirements for personnel. A large number of independent test cases\scripts have high maintenance costs in the later stage and poor readability. The particularities of the tested interfaces are all included in the test cases\scripts in a black box manner, which cannot be reused and cannot form organizational-level assets. It is difficult to adapt to the commercial bank organizational level to carry out interface automation testing. Therefore, an embodiment of the present invention proposes a configuration-based interface automation testing method.
[0033] Embodiment 1
[0034] Figure 1A This is a flow chart of a configuration interface automation test method provided by the first embodiment of the present invention. This embodiment is applicable to the case of performing automation test on the configuration interface. The method of this embodiment can be executed by a configuration interface automation test device, which can be implemented in hardware and / or software. The device can be configured in a server for configuration interface automation test. The method specifically includes the following steps:
[0035] S110: Abstract the target system under test interface and determine a basic characteristic model of the target system under test interface.
[0036] Figure 1B This is a schematic diagram of the structure of an interface automation test provided by the first embodiment of the present invention, see Figure 1B The system under test (SUT) may refer to the system being tested, and the purpose is to test whether the system can operate correctly. For example, the message is assembled according to the test requirements, and the test case is sent to the system under test through the test platform. The system under test receives and parses the message, and returns the message to the test platform to determine whether the test is successful.
[0037] The basic feature model of the tested system interface may refer to abstracting the tested system interface test process, extracting the basic features of the tested system interface, and making a unified package to form the basic feature model of the tested system interface. The target tested system interface feature model includes but is not limited to communication components, message components, and message formats.
[0038] In an optional solution of the embodiment of the present invention, the testing of the target system under test interface to determine the target system under test interface basic characteristic model includes:
[0039] Abstract each interface of the system under test, extract the basic feature model of each interface of the system under test, and obtain the basic feature model library of the interface of the system under test;
[0040] The target system under test interface basic feature model is determined from a pre-acquired system under test interface basic feature model library.
[0041] Among them, each system interface test process contains a corresponding system interface basic feature model, each system interface is abstracted to form a system interface basic feature model library; the system interface basic feature model of the target system interface is queried in the system interface basic feature model library.
[0042] In an optional solution of the embodiment of the present invention, optionally, abstracting each interface of the system under test and extracting a basic feature model of each interface of the system under test includes:
[0043] Abstracting the communication process of the interface test of the system under test into a communication component; the communication component includes a communication protocol, a communication time and a timeout time;
[0044] Abstracting the tested system interface test message assembly and message parsing content into message components; the message components include message protocols, character encodings, and correctness judgment conditions;
[0045] The specific interface interaction information of the interface test of the system under test is abstracted into a message format; the message format includes an input message and an output message.
[0046] Among them, the interface test process of the system under test is modeled and uniformly encapsulated. The communication process is the sending and receiving of messages, and its related content is abstracted as communication components. The message is the interactive information agreed upon by the system under test and its client or caller for a specific interface, among which the message assembly and parsing related content are abstracted as message components, and the specific interface interaction information is abstracted as message formats. The message sent to the system under test is called an input message, and the message returned by the system under test is called an output message. Figure 1C This is a schematic diagram of a basic characteristic model of a system under test interface provided by the first embodiment of the present invention. Figure 1C , the message includes the message format and the message components; the message format includes the input message and the output message, and the input message and the output message include the public domain and the private domain; the message components include but are not limited to the message protocol, character encoding and correctness judgment conditions; the communication components include but are not limited to the communication protocol, communication address and timeout. Among them, the public domain can refer to the public part of the transaction, for example, each transaction of the bank contains public fields, such as the teller and the basic information such as the counter number. The private domain can refer to the unique content in each transaction, for example, each interface has its own function, and the corresponding message is private, such as adding, deleting, modifying and checking the corresponding fields.
[0047] The basic feature test of the tested system interface provided by the embodiment of the present invention unifies and abstracts the interface test process, and extracts the basic feature model of the interface test. This structured model is the basis of flexible plug-in configuration.
[0048] S120: Determine the target system under test interface grouping result according to the target system under test interface basic characteristic model.
[0049] Among them, for the same system under test, grouping is performed according to the message protocol and communication protocol in the basic characteristic model of the target system under test interface. On this basis, if the communication addresses are different, further grouping is performed to determine the target system under test interface grouping result.
[0050] In an optional solution of the embodiment of the present invention, optionally, determining the target system under test interface grouping result according to the target system under test interface basic feature model includes:
[0051] Grouping according to the communication protocol in the interface communication component of the target system under test and the message protocol in the message component;
[0052] If the communication addresses in the communication components of the target system under test interface are different, further grouping is performed to determine the group to which the target system under test interface belongs, and the target system under test interface grouping result is obtained.
[0053] Among them, the tested system interfaces are classified by technical nature on the basis of management nature classification (such as the system and module to which they belong). The same communication protocol and message protocol used in the same tested system or module are grouped together; on this basis, if the communication addresses are different, they are further grouped. After grouping, a class of tested system interfaces with the same mandatory configuration items such as message protocol and communication protocol is called a transaction type. Among them, in a group of tested system interfaces with the same communication protocol and message protocol, the message formats are different but there are great similarities in execution. Such tested system interfaces can be divided into the same group.
[0054] The embodiment of the present invention groups the tested system interfaces of different systems, different communication modes and different message protocols from a technical level on the basis of the traditional management property classification, and extracts the common configuration items required for testing the tested system interfaces. Combining the management property classification method with the technical property classification method, the embodiment of the present invention has the basic ability to support the automated testing of the tested system interfaces at the organizational level.
[0055] S130 , selecting the same target configuration item for the target system under test interfaces in the same group according to the target system under test interface grouping result, and performing unified configuration.
[0056] Wherein, the target system under test interface includes but is not limited to the system under test interface, the message parent node and the message field. The target configuration items include but are not limited to transaction type level configuration items, transaction level configuration items, non-leaf node configuration items and leaf node configuration items. Wherein, for the target system under test interfaces of the same group, the same configuration item is selected for the target system under test interfaces of the same group for unified configuration according to the target system under test interface requirements; for example, each level of the target system under test interfaces of the same group is uniformly configured; for example, the message parent node of the target system under test interface of the same group is configured using a non-leaf node configuration item. Wherein, optional configuration items of different levels are selected for configuration according to the requirements of different levels of the same group; for example, transaction type level configuration items are selected for configuration according to the requirements of the system under test in the same group, and transaction type level configuration items are selected for configuration according to the requirements of the system under test interface in the same group.
[0057] The embodiment of the present invention uses transaction type level, transaction level, non-leaf node level and leaf node level configuration items to flexibly configure the target system under test, so that the interface test model of the system under test of the present invention is highly scalable and can fully and flexibly adapt to the specific special needs of the interface test of the commercial bank system under test at all levels. The reusable design of the configuration items avoids the repeated implementation of the configuration item functions and reduces the cost of adding and maintaining configuration items. Special configuration items not included in the embodiment of the present invention can be adapted through plug-in development to fill the deficiencies of the model. Testers and plug-in developers can work concurrently to reduce time costs.
[0058] The embodiment of the present invention provides a configuration-based interface automation testing method, which abstracts the target system interface under test and determines the basic feature model of the target system interface under test; the target system interface feature model includes communication components, message components and message formats; the target system interface grouping result is determined according to the target system interface basic feature model; and the target system interface under test in the same group is uniformly configured by selecting the same target configuration item according to the target system interface grouping result. By adopting the technical solution of the embodiment of the present invention, the test process of the system interface under test is uniformly abstracted, and the basic feature model of the system interface under test is extracted, providing a basis for the flexible configuration of the system interface under test; the system interfaces under test are grouped according to the basic feature model of the system interface under test, and the same group of system interfaces under test are uniformly configured according to the grouping results, and are flexibly configured according to the requirements of each level in the same group, thereby improving the configuration-based interface automation testing capability.
[0059] Embodiment 2
[0060] Figure 2A The flowchart of a configuration-based interface automatic testing method provided by the second embodiment of the present invention is as follows. The embodiment of the present invention further optimizes the above embodiment on the basis of the above embodiment, and the embodiment of the present invention can be combined with various optional solutions in one or more of the above embodiments.
[0061] With the rise of the Internet, especially mobile Internet, the speed of commercial bank product iteration has continued to increase, but the requirements for stability and reliability have not decreased. The importance of automated testing has become increasingly prominent, and interface automated testing has received much attention due to its ease of implementation and low maintenance costs. Commercial banks have a large number of running, important, stable systems that require regression testing, and they are in urgent need of building core automated testing assets. Under the agile model, automated testing construction and regression work in each iteration cycle are also imminent, which places extremely high demands on organizational-level automated testing support capabilities. Figure 2A As shown, the configuration interface automatic testing method provided in the embodiment of the present invention may include the following steps:
[0062] S210: Abstract the target system under test interface and determine a basic characteristic model of the target system under test interface.
[0063] S220: Determine the target system under test interface grouping result according to the target system under test interface basic characteristic model.
[0064] S230 , selecting target configuration items according to the test requirements of the target system under test to configure the target system under test.
[0065] Figure 2BThis is a schematic diagram of a plug-in hierarchical configuration structure provided by the second embodiment of the present invention. The embodiment of the present invention adopts a hierarchical configuration method to solve the differences in specific transaction types and specific transaction levels. The organizational structure of each level and the configuration plug-in method are shown in Figure 2B .
[0066] Among them, the target system under test is configured by selecting transaction type level configuration items according to the test requirements of the target system under test. Transaction type level configuration items include but are not limited to communication timeout, character encoding configuration items, and correctness judgment condition configuration items. Typical transaction type level configuration items are transaction type correctness judgment condition configuration items. For a transaction, in most cases, the return message will be designed with a flag to indicate whether the transaction is correct or not. This configuration item is set in the method of determining the flag after receiving the return message and judging whether it is consistent with the expected return, including the flag positioning method, the flag name, and the expected flag value, where:
[0067] The flag bit positioning method includes but is not limited to the node full path method and the node name method, wherein the node full path method can be used to judge structured messages such as JSON and XML, and the node name method is mainly used for streaming messages;
[0068] The flag bit name may refer to finding a flag bit that matches the flag bit name according to the set positioning method, and obtaining the value of the flag bit;
[0069] The expected flag value may be compared with the obtained flag value to determine whether the transaction is correct.
[0070] In addition, in the specific code implementation of the embodiment of the present invention, there are default settings, but the requirements of specific transaction types may be different from the default settings and need to be flexibly configured. For example, the timeout period of the http communication method defaults to 30s. If the system performance is good, the communication timeout period can be configured to 10s to save execution time.
[0071] S240 , selecting target configuration items according to requirements of each level in the target tested system interfaces of the same group to uniformly configure the target tested system interfaces.
[0072] Among them, the transaction-level configuration items are selected to configure the system interface under test according to the requirements of the system interface under test in the target system interface under the same group. Under the same transaction type, specific transactions also have particularities and need to be flexibly configured. The transaction-level configuration items include but are not limited to character encoding configuration, communication timeout, session acquisition configuration, whether to include CDATA configuration, whether to upload and download transaction configuration, and whether to return HTML page configuration. Among them, typical transaction-level configuration items are:
[0073] Whether XML contains CDATA configuration item can mean that in some XML format messages, there is a special format containing CDATA. After setting, the data inside CDATA can be correctly parsed;
[0074] The communication timeout configuration item may mean that some transactions may have a longer communication time than other transactions due to network characteristics, etc. The communication time can be configured to avoid communication interruption caused by communication timeout;
[0075] The configuration item of obtaining the login transaction session can mean that some transactions need to carry the session returned by the login transaction to communicate normally. This configuration item can ensure that such transactions can communicate normally.
[0076] The configuration item of whether the returned result is an HTML page can mean that the returned result of some transaction communications is sometimes an HTML page. By setting this configuration item, you can directly display the content of the HTML page without judging the returned result;
[0077] Whether to upload or download a transaction configuration item may mean that some transactions require uploading or downloading files. By setting this configuration item, uploading or downloading of files can be achieved.
[0078] Similarly, some configurations of specific transactions may be different from the default configurations, and the configurations of the same transaction type may also be different, so they need to be configured flexibly.
[0079] Among them, non-leaf node level configuration items are selected to configure the message parent node according to the requirements of the message parent node in the target system under test interface of the same group. The non-leaf node level configuration items include but are not limited to JSON object to string conversion and node name replacement configuration items. Structured messages such as JSON and XML can be parsed into the form of root node-non-leaf node-leaf node. The middle non-leaf node is used to locate the leaf node. The particularity of this level requires flexible configuration. Typical non-leaf node level configuration items include:
[0080] The node name replacement configuration item may refer to the existence of some special interfaces whose input messages are similar to structured messages such as JSON or XML, but there are some special paths that are consistent and cannot be distinguished. Such interfaces can change the special non-leaf nodes to another non-repeated name to make them conform to structured message protocols such as JSON or XML, and then set this configuration item on the non-leaf nodes so that the actually sent messages meet the interface requirements;
[0081] JSON object to string conversion can refer to the existence of some special interfaces whose input messages conform to the JSON message protocol, but the JSON object under a certain node of the message needs to be converted to a string when it is sent. This scenario can be solved by setting this configuration item in this node.
[0082] Among them, according to the requirements of the message fields in the target system under test interface of the same group, the leaf node level configuration items are selected to configure the message fields. The leaf node level configuration items include but are not limited to the random serial number configuration item, the current time configuration item, BASE64 transcoding, SM4 encryption, whether the message header configuration and the node name replacement configuration. The leaf node level configuration items configure the processing of the data input in the message at this level. Typical leaf node level configuration items include:
[0083] The random serial number configuration item may refer to the serial number field of some banking business transactions that must be guaranteed to be non-repeated each time it is sent. This configuration item can generate a unique and non-repeating serial number according to customized rules;
[0084] The configuration item for obtaining server time may refer to that the date field of some banking business transactions needs to be sent each time to ensure the timeliness of the time. This configuration item ensures that the value of the date field is the current time each time the transaction is sent;
[0085] BASE64 transcoding can mean that the specific data of a field in the message needs to be BASE64 transcoded. After setting this configuration item in the leaf node, the user only needs to enter the string before transcoding;
[0086] SM4 encryption may mean that specific data in a certain field in the message needs to be encrypted by SM4. After setting this configuration item in the leaf node, the user only needs to enter the plain text. Among them, other encryption algorithms that can meet the encryption conditions can be selected when encrypting specific data in a certain field in the message, and no specific restrictions are made in the embodiments of the present invention.
[0087] In addition, for structured messages such as JSON and XML, the bottom leaf nodes represent each individual data domain, and the node name replacement configuration item is applicable to scenarios where the leaf node names are repeated. Specific configuration items may apply to more than one of the four configuration levels, so the association between configuration items and configuration levels is also flexibly configured, so that the specific implementation of configuration items can be reused across levels.
[0088] In an optional solution of the embodiment of the present invention, optionally, the method further includes:
[0089] If the same target configuration item is selected for transaction-level configuration, transaction type-level configuration, and default settings, the configuration operation will be performed in the order of transaction-level configuration, transaction type-level configuration, and default settings.
[0090] Among them, some transaction type-level configurations and transaction-level configurations are mutually exclusive, and there are also cases where they are mutually exclusive with the default settings. In the actual execution process, the following priority strategy is followed: transaction level > transaction type level > default value. Taking the communication timeout as an example, the default HTTP communication timeout is t1. If a transaction type has a transaction type-level timeout configuration t2, t2 overrides t1; if a transaction has a transaction-level timeout configuration t3, t3 overrides t1 and t2.
[0091] The embodiment of the present invention provides a configuration-based interface automation testing method, which abstracts the target system under test interface to determine the target system under test interface basic feature model; determines the target system under test interface grouping result according to the target system under test interface basic feature model; selects the target configuration item according to the target system under test test requirements to configure the target system under test; selects the target configuration item according to the requirements of each level in the target system under test interface of the same group to uniformly configure the target system under test interface. The highly structured system under test interface basic feature model of the embodiment of the present invention is adopted, which is transparent and friendly to users after unified encapsulation, and reduces the skill requirements of testers. The implemented configuration items in the basic feature model of the system under test interface are organizational-level assets that can be flexibly reused. The special configuration items not included in the implementation of the present invention can be adapted and fill the deficiencies of the model through plug-in development. Testers and plug-in developers can work concurrently to reduce time costs. The priority strategy of the same configuration items in the embodiment of the present invention solves the conflict between individual transaction types and default settings, solves the conflict between individual transactions and transaction types, and ensures the certainty and consistency of the results of the interface test model of the embodiment of the present invention during the actual execution process.
[0092] Embodiment 3
[0093] Figure 3 3 is a schematic diagram of the structure of a configuration interface automatic test device provided in the third embodiment of the present invention. This embodiment is applicable to the case of automatic testing of configuration interfaces. The device includes: a target system under test interface basic feature model determination module 310, a target system under test interface grouping result determination module 320 and a target configuration item configuration module 330. Among them:
[0094] The target system under test interface basic characteristic model determination module 310 is used to abstract the target system under test interface and determine the target system under test interface basic characteristic model; the target system under test interface characteristic model includes communication components, message components and message formats;
[0095] The target system under test interface grouping result determination module 320 is used to determine the target system under test interface grouping result according to the target system under test interface basic characteristic model;
[0096] The target configuration item configuration module 330 is used to select the same target configuration item for the target tested system interfaces in the same group to perform unified configuration according to the target tested system interface grouping result.
[0097] Based on the above embodiment, optionally, the target system under test interface basic feature model determination module includes:
[0098] Abstract each interface of the system under test, extract the basic feature model of each interface of the system under test, and obtain the basic feature model library of the interface of the system under test;
[0099] The target system under test interface basic feature model is determined from a pre-acquired system under test interface basic feature model library.
[0100] Based on the above embodiment, optionally, the target measured system interface basic feature model determination module further includes:
[0101] Abstracting the communication process of the interface test of the system under test into a communication component; the communication component includes a communication protocol, a communication time and a timeout time;
[0102] Abstracting the tested system interface test message assembly and message parsing content into message components; the message components include message protocols, character encodings, and correctness judgment conditions;
[0103] The specific interface interaction information of the interface test of the system under test is abstracted into a message format; the message format includes an input message and an output message.
[0104] Based on the above embodiment, optionally, the target measured system interface basic feature model determination module includes:
[0105] Grouping according to the communication protocol in the interface communication component of the target system under test and the message protocol in the message component;
[0106] If the communication addresses in the communication components of the target system under test interface are different, further grouping is performed to determine the group to which the target system under test interface belongs, and the target system under test interface grouping result is obtained.
[0107] Based on the above embodiment, optionally, the target configuration item configuration module includes:
[0108] Select target configuration items according to the test requirements of the target system under test to configure the target system under test;
[0109] Select target configuration items according to the requirements of each level in the target system under test interface of the same group to uniformly configure the target system under test interface;
[0110] Among them, the target configuration items include transaction type level configuration items, transaction level configuration items, non-leaf node configuration items and leaf node configuration items; the target system under test interface includes the system under test interface, message parent node and message field.
[0111] Based on the above embodiment, optionally, the target configuration item configuration module further includes:
[0112] Select transaction type level configuration items to configure the target system under test according to the test requirements of the target system under test;
[0113] Select transaction-level configuration items to configure the system under test interface according to the requirements of the system under test interface in the target system under test interface of the same group;
[0114] According to the requirements of the message parent node in the target system under test interface of the same group, non-leaf node level configuration items are selected to configure the message parent node;
[0115] According to the requirements of the message fields in the target tested system interface of the same group, the leaf node level configuration items are selected to configure the message fields.
[0116] Based on the above embodiment, optionally, the configurable interface automatic testing device further includes:
[0117] If the same target configuration item is selected for transaction-level configuration, transaction type-level configuration, and default settings, the configuration operation will be performed in the order of transaction-level configuration, transaction type-level configuration, and default settings.
[0118] The above-mentioned device can execute the configuration-based interface automation testing method provided by any embodiment of the present invention, and has the corresponding functional modules and beneficial effects for executing the configuration-based interface automation testing method.
[0119] Embodiment 4
[0120] Figure 4 Schematic diagram of the structure of an electronic device provided by the fourth embodiment of the present invention. The present application embodiment provides an electronic device, in which the interactive device for the configuration interface automatic test provided by the present application embodiment can be integrated. Figure 4 As shown, this embodiment provides an electronic device 400, which includes: one or more processors 420; a storage device 410, which is used to store one or more programs. When the one or more programs are executed by the one or more processors 420, the one or more processors 420 implement the configuration interface automatic testing method provided in the embodiment of the present application, and the method includes:
[0121] Abstracting the target system under test interface and determining a basic characteristic model of the target system under test interface; the target system under test interface characteristic model includes a communication component, a message component and a message format;
[0122] Determine the target system under test interface grouping result according to the target system under test interface basic characteristic model;
[0123] According to the target system under test interface grouping result, the target system under test interfaces in the same group are uniformly configured by selecting the same target configuration item.
[0124] Of course, those skilled in the art can understand that the processor 420 also implements the technical solution of the configuration-based interface automatic testing method provided in any embodiment of the present application.
[0125] Figure 4 The electronic device 400 shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0126] like Figure 4 As shown, the electronic device 400 includes a processor 420, a storage device 410, an input device 430, and an output device 440; the number of the processor 420 in the electronic device can be one or more. Figure 4 A processor 420 is taken as an example; the processor 420, the storage device 410, the input device 430 and the output device 440 in the electronic device can be connected via a bus or other means. Figure 4 The connection via bus 450 is taken as an example.
[0127] The storage device 410 is a computer-readable storage medium that can be used to store software programs, computer executable programs, and module units, such as program instructions corresponding to the configuration-based interface automation testing method in the embodiment of the present application.
[0128] The storage device 410 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system and at least one application required for a function; the data storage area may store data created according to the use of the terminal, etc. In addition, the storage device 410 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some instances, the storage device 410 may further include a memory remotely arranged relative to the processor 420, and these remote memories may be connected via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0129] The input device 430 may be used to receive input numbers, character information or voice information, and generate key signal input related to user settings and function control of the electronic device. The output device 440 may include electronic devices such as a display screen and a speaker.
[0130] The electronic device provided in the embodiment of the present application can achieve the technical effect of effectively improving the automatic testing capability of the configurable interface.
[0131] Embodiment 5
[0132] Embodiment 5 of the present invention further provides a storage medium containing computer executable instructions, wherein the computer executable instructions are used to execute a configuration interface automatic testing method when executed by a computer processor, the method comprising:
[0133] Abstracting the target system under test interface and determining a basic characteristic model of the target system under test interface; the target system under test interface characteristic model includes a communication component, a message component and a message format;
[0134] Determine the target system under test interface grouping result according to the target system under test interface basic characteristic model;
[0135] According to the target system under test interface grouping result, the target system under test interfaces in the same group are uniformly configured by selecting the same target configuration item.
[0136] The computer storage medium of the embodiment of the present invention may adopt any combination of one or more computer-readable media. The computer-readable medium may be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples (non-exhaustive list) of computer-readable storage media include: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable CD-ROM, an optical storage device, a magnetic storage device, or any suitable combination of the above. The computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system, device or device.
[0137] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, which carry computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to: electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0138] The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, radio frequency (RF), etc., or any suitable combination of the above.
[0139] Computer program code for performing the operations of the present invention may be written in one or more programming languages or a combination thereof, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0140] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "examples", "specific examples", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.
[0141] Note that the above are only preferred embodiments of the present invention and the technical principles used. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in more detail through the above embodiments, the present invention is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present invention, and the scope of the present invention is determined by the scope of the appended claims.
Claims
1. A configuration interface automated testing method, characterized in that: The method comprises: Abstracting the target system under test interface and determining a basic characteristic model of the target system under test interface; the target system under test interface characteristic model includes a communication component, a message component and a message format; Determine the target system under test interface grouping result according to the target system under test interface basic characteristic model; According to the target system under test interface grouping result, the target system under test interfaces in the same group are selected to perform unified configuration on the same target configuration item; wherein the target configuration item includes transaction type level configuration item, transaction level configuration item, non-leaf node configuration item and leaf node configuration item; The step of determining the target system under test interface grouping result according to the target system under test interface basic characteristic model includes: Grouping according to the communication protocol in the interface communication component of the target system under test and the message protocol in the message component; If the communication addresses in the communication components of the target system under test interface are different, further grouping is performed to determine the group to which the target system under test interface belongs, and the target system under test interface grouping result is obtained.
2. The method according to claim 1, characterized in that The step of testing the target system under test interface and determining the basic characteristic model of the target system under test interface includes: Abstract each interface of the system under test, extract the basic feature model of each interface of the system under test, and obtain the basic feature model library of the interface of the system under test; The target system under test interface basic feature model is determined from a pre-acquired system under test interface basic feature model library.
3. The method according to claim 2, characterized in that The abstraction of each tested system interface and the extraction of the basic characteristic model of each tested system interface include: Abstracting the communication process of the interface test of the system under test into a communication component; the communication component includes a communication protocol, a communication time and a timeout time; Abstracting the tested system interface test message assembly and message parsing content into message components; the message components include message protocols, character encodings, and correctness judgment conditions; The specific interface interaction information of the interface test of the system under test is abstracted into a message format; the message format includes an input message and an output message.
4. The method according to claim 1, characterized in that: The selecting the same target configuration item for the target system under test interfaces in the same group for unified configuration according to the target system under test interface grouping result includes: Select target configuration items according to the test requirements of the target system under test to configure the target system under test; Select target configuration items according to the requirements of each level in the target system under test interface of the same group to uniformly configure the target system under test interface; Among them, the target configuration items include transaction type level configuration items, transaction level configuration items, non-leaf node configuration items and leaf node configuration items; the target system under test interface includes the system under test interface, message parent node and message field.
5. The method according to claim 1, characterized in that The selecting the same target configuration item for the target tested system interfaces in the same group to perform unified configuration according to the target tested system interface grouping result also includes: Select transaction type level configuration items to configure the target system under test according to the test requirements of the target system under test; Select transaction-level configuration items to configure the system under test interface according to the requirements of the system under test interface in the target system under test interface of the same group; According to the requirements of the message parent node in the target system under test interface of the same group, non-leaf node level configuration items are selected to configure the message parent node; According to the requirements of the message fields in the target tested system interface of the same group, the leaf node level configuration items are selected to configure the message fields.
6. The method according to claim 1, characterized in that The method further comprises: If the same target configuration item is selected for transaction-level configuration, transaction type-level configuration, and default settings, the configuration operation will be performed in the order of transaction-level configuration, transaction type-level configuration, and default settings.
7. A configurable interface automated testing device, characterized in that: The device comprises: The target system under test interface basic characteristic model determination module is used to abstract the target system under test interface and determine the target system under test interface basic characteristic model; the target system under test interface characteristic model includes communication components, message components and message formats; The target system under test interface grouping result determination module is used to determine the target system under test interface grouping result according to the target system under test interface basic characteristic model; A target configuration item configuration module is used to select the same target configuration item for the target system under test interfaces of the same group to perform unified configuration according to the target system under test interface grouping result; wherein the target configuration item includes transaction type level configuration item, transaction level configuration item, non-leaf node configuration item and leaf node configuration item; Wherein, the target system under test interface grouping result determination module is specifically used for: Grouping according to the communication protocol in the interface communication component of the target system under test and the message protocol in the message component; If the communication addresses in the communication components of the target system under test interface are different, further grouping is performed to determine the group to which the target system under test interface belongs, and the target system under test interface grouping result is obtained.
8. An electronic device, characterized in that: include: one or more processors; A storage device for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the configuration interface automatic testing method described in any one of claims 1-6.
9. A storage medium containing computer executable instructions, characterized in that: The computer executable instructions are used to execute the configuration interface automatic testing method as claimed in any one of claims 1 to 6 when executed by a computer processor.
Citation Information
Patent Citations
Automatic testing method and device, storage medium and electronic equipment
CN108280026A
Interface testing method and mock baffle
CN113157598A
Automatic testing method and device, equipment and storage medium
CN113220594A
Automatic test method and device for automatic train monitoring system (ATS) interface
CN113590468A
Test method and device, training method and device, equipment, medium and program product
CN113609018A
