CN114461525A - Automatic testing method and device for configuration type interface, electronic equipment and storage medium - Google Patents

Automatic testing method and device for configuration type interface, electronic equipment and storage medium Download PDF

Info

Publication number
CN114461525A
CN114461525A CN202210118280.0A CN202210118280A CN114461525A CN 114461525 A CN114461525 A CN 114461525A CN 202210118280 A CN202210118280 A CN 202210118280A CN 114461525 A CN114461525 A CN 114461525A
Authority
CN
China
Prior art keywords
tested
target
system interface
interface
configuration
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210118280.0A
Other languages
Chinese (zh)
Inventor
王唤宇
孙辉
侯健琦
徐志远
程伟静
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Agricultural Bank of China
Original Assignee
Agricultural Bank of China
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Agricultural Bank of China filed Critical Agricultural Bank of China
Priority to CN202210118280.0A priority Critical patent/CN114461525A/en
Publication of CN114461525A publication Critical patent/CN114461525A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3696Methods or tools to render software testable

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The embodiment of the invention provides a method and a device for automatically testing a configuration type interface, electronic equipment and a storage medium, wherein the method comprises the following steps: abstracting a target system interface to be tested, and determining a basic characteristic model of the target system interface to be tested; the target tested system interface characteristic model comprises a communication component, a message component and a message format; determining a target system interface grouping result according to the target system interface basic feature model; and selecting the same target configuration item for the target tested system interface of the same group to carry out uniform configuration according to the grouping result of the target tested system interface. By adopting the technical scheme of the embodiment of the invention, the automatic testing model of the interface is uniformly packaged, the interface is classified, four levels of optional configuration items are designed, the flexible configuration of the configured interface is realized, and the automatic testing requirements of large-scale and various interfaces can be quickly realized.

Description

Automatic testing method and device for configuration type interface, electronic equipment and storage medium
Technical Field
The embodiment of the invention relates to the technical field of automatic interface testing, in particular to a method and a device for automatically testing a configuration type interface, electronic equipment and a storage medium.
Background
The informatization construction of commercial banks generally starts earlier, particularly, large commercial banks in China are more orderly and steadily promoted, and are influenced by technical limit and associated third parties during construction, technology stacks coexist newly and old, interface communication modes are various, messages are various, various communication messages which do not accord with common message specifications exist, and the difficulty is caused for large-scale comprehensive interface spreading automation test.
The rise of internet wave, especially the popularization of mobile internet, makes commercial bank demand iteration more and more, and agile research and development mode has become an irreversible trend. In shorter and shorter iteration periods, the testing work needs to efficiently complete the quality confirmation of iteration products, and also needs to synchronously accumulate an automatic testing case set for system regression, so that the time is tight and the task is heavy.
Therefore, how to improve the automatic testing capability of the configured interface is a technical problem to be solved urgently by those skilled in the art.
Disclosure of Invention
The embodiment of the invention provides a method and a device for automatically testing a configuration type interface, electronic equipment and a storage medium, so that the configuration type interface is flexibly configured, and the automatic testing capability of the configuration type interface is improved.
In a first aspect, an embodiment of the present invention provides a method for automatically testing a configured interface, including:
abstracting a target system interface to be tested, and determining a basic characteristic model of the target system interface to be tested; the target tested system interface characteristic model comprises a communication component, a message component and a message format;
determining a grouping result of the interfaces of the target system to be tested according to the basic characteristic model of the interfaces of the target system to be tested;
and selecting the same target configuration item for the target tested system interface of the same group to carry out uniform configuration according to the grouping result of the target tested system interface.
In a second aspect, an embodiment of the present invention further provides an automatic testing apparatus for a configured interface, including:
the target system interface basic feature model determining module is used for abstracting a target system interface to be tested and determining a target system interface basic feature model to be tested; the target tested system interface characteristic model comprises a communication component, a message component and a message format;
the target tested system interface grouping result determining module is used for determining a target tested system interface grouping result according to the target tested system interface basic feature model;
and the target configuration item configuration module is used for selecting the same target configuration item for the target tested system interface in the same group for uniform configuration according to the grouping result of the target tested system interface.
In a third aspect, an embodiment of the present invention further provides an electronic device, where the electronic device includes:
one or more processors;
storage means for storing one or more programs;
when executed by the one or more processors, cause the one or more processors to implement the method for automated testing of a configured interface according to any embodiment of the invention.
In a fourth aspect, the embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the method for automated testing of a configured interface according to any embodiment of the present invention.
The embodiment of the invention provides a method and a device for automatically testing a configured interface, electronic equipment and a storage medium, wherein a basic characteristic model of a target system interface to be tested is determined by abstracting the target system interface to be tested; the target tested system interface characteristic model comprises a communication component, a message component and a message format; determining a target system interface grouping result according to the target system interface basic feature model; and selecting the same target configuration item for the target tested system interface of the same group to carry out uniform configuration according to the grouping result of the target tested system interface. By adopting the technical scheme of the embodiment of the invention, the automatic test model of the interface is realized to realize uniform packaging, the interface is subjected to technical classification, four levels of optional configuration items are designed, the flexible configuration of transaction types, transactions and data levels is realized, and the automatic test requirements of large-scale and various interfaces can be quickly realized.
Drawings
Other features, objects and advantages of the invention will become more apparent upon reading of the following detailed description of non-limiting embodiments thereof, made with reference to the accompanying drawings. The drawings are only for purposes of illustrating the preferred embodiments and are not to be construed as limiting the invention. Also, like reference numerals are used to refer to like parts throughout the drawings. In the drawings:
fig. 1A is a flowchart of a method for automated testing of a configured interface according to an embodiment of the present invention;
fig. 1B is a schematic structural diagram of an interface automation test according to an embodiment of the present invention;
fig. 1C is a schematic diagram of a basic feature model of an interface of a system under test according to a first embodiment of the present invention;
fig. 2A is a flowchart of a configuration interface automation test method according to a second embodiment of the present invention;
FIG. 2B is a schematic structural diagram of a plug-in hierarchical configuration according to a second embodiment of the present invention;
fig. 3 is a schematic structural diagram of a configuration interface automation test apparatus according to a third embodiment of the present invention;
fig. 4 is a schematic structural diagram of an electronic device according to a fourth embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting of the invention. It should be further noted that, for the convenience of description, only some of the structures related to the present invention are shown in the drawings, not all of the structures.
Before discussing exemplary embodiments in more detail, it should be noted that some exemplary embodiments are described as processes or methods depicted as flowcharts. Although a flowchart may describe the operations (or steps) as a sequential process, many of the operations (or steps) can be performed in parallel, concurrently or simultaneously. In addition, the order of the operations may be re-arranged. The process may be terminated when its operations are completed, but may have additional steps not included in the figure. The processes may correspond to methods, functions, procedures, subroutines, and the like.
With the rise of the internet, especially the mobile internet, the speed of commercial bank product iteration is continuously increased, but the requirements on stability and reliability are not reduced, the importance of automatic testing is more and more prominent, and the importance of interface automatic testing is paid much attention because of easy development and low maintenance cost. Commercial banks have a large number of systems that are operational, important, stable, and have regression testing requirements, creating an urgent need for core automated testing assets. In the agile mode, the automatic test construction and regression work in each iteration period is urgent, which puts extremely high requirements on the support capability of the organization-level automatic test. For the method for realizing the automatic test of the interface, the current existing technical scheme mainly comprises the following two types:
the first scheme is as follows: the method comprises the following steps that a tester uses test tools such as postman, Apache JMeter, SoapUI and the like to simulate a client to send a message request to a server, analyze response information returned by the server and verify whether a tested system interface meets requirements or not; the scheme is oriented to a single test scene to compile scripts, most scenes only relate to a single interface, the compiling cost of the test scripts is high, the maintenance cost is high, large-scale development is difficult, and an organization-level automatic test task cannot be supported.
Scheme II: a unified interface test platform and a unified test management and execution entrance generally provide a common communication mode (for example, http communication), a specific test case/script adopts a mode of writing a script (including a jar packet) by a user to realize the assembly, analysis and judgment logic of a message, and the platform provides a unified arranged execution process to execute the test case/script. By adopting the technology of the scheme, the compiling work of the test cases/scripts is still realized by testers, the technical requirement on the personnel is higher, the later maintenance cost of a large number of independent test cases/scripts is high, the readability is poor, the particularity of the tested interface is contained in the test cases/scripts in a black box mode, the reuse cannot be realized, the organization-level assets cannot be formed, and the interface automation test is difficult to adapt to the organization level of a commercial bank to develop. Therefore, the embodiment of the invention provides an automatic testing method for a configuration type interface.
Example one
Fig. 1A is a flowchart of a method for automatically testing a configured interface according to an embodiment of the present invention, where the embodiment is applicable to a situation where an automated test is performed on a configured interface, and the method of the embodiment may be performed by an apparatus for automatically testing a configured interface, where the apparatus may be implemented in a hardware and/or software manner. The device can be configured in a server for automated testing of the configured interface. The method specifically comprises the following steps:
and S110, abstracting the target system interface to be tested, and determining a basic characteristic model of the target system interface to be tested.
Fig. 1B is a schematic structural diagram of an interface automation Test according to an embodiment of the present invention, and referring to fig. 1B, the System Under Test (SUT) may refer to a System Under Test (dut) that is being tested, so as to Test whether the System can operate correctly. For example, a message is assembled according to the test requirement, a test case is sent to the tested system through the test platform, the tested system receives and analyzes the message, the message is returned to the test platform, and whether the test is successful or not is judged.
The basic feature model of the tested system interface can be obtained by abstracting the testing process of the tested system interface, extracting the basic features of the tested system interface and uniformly packaging to form the basic feature model of the tested system interface. The target system interface feature model includes but is not limited to a communication component, a message component and a message format.
In an alternative of the embodiment of the present invention, the testing the target system-under-test interface to determine the basic feature model of the target system-under-test interface includes:
abstracting each tested system interface, and extracting a basic characteristic model of each tested system interface to obtain a basic characteristic model library of the tested system interface;
and determining a target tested system interface basic feature model from a pre-acquired tested system interface basic feature model library.
The method comprises the following steps that a test process of each tested system interface comprises a corresponding tested system interface basic feature model, and each tested system interface is abstracted to form a tested system interface basic feature model library; and inquiring the basic feature model of the tested system interface of the target tested system interface in the basic feature model library of the tested system interface.
In an alternative of the embodiment of the present invention, optionally, abstracting each interface of the system under test to extract a basic feature model of each interface of the system under test includes:
abstracting a tested system interface test communication process into a communication assembly; the communication component comprises a communication protocol, communication time and overtime time;
abstracting the test message assembly and message analysis contents of the tested system interface into message components; the message component comprises a message protocol, character codes and correctness judgment conditions;
abstracting the interaction information of the interface test concrete interface of the system to be tested into a message format; the message format includes an input message and an output message.
The method comprises the steps that a test process of a system interface to be tested is modeled and packaged uniformly, a message is sent and received in a communication process, and related contents are abstracted into communication components; the message is the interaction information agreed by the tested system and the client or the calling party thereof aiming at the concrete interface, wherein the message assembly and analysis related content is abstracted into a message component, the concrete interface interaction information is abstracted into a message format, the message sent to the tested system is called an input message, and the message returned by the tested system is called an output message. Fig. 1C is a schematic diagram of a basic feature model of an interface of a system under test according to a first embodiment of the present invention. Referring to fig. 1C, the message includes a message format and a message component; the message format comprises an input message and an output message, and the input message and the output message comprise a public domain and a private domain; the message component includes but is not limited to a message protocol, character encoding and correctness judgment conditions; the communication components include, but are not limited to, a communication protocol, a communication address, and a timeout. The public domain may refer to a part commonly contained in transactions, for example, each transaction of a bank contains a public field, such as basic information of a teller, a counter number, and the like. The private domain may refer to a content unique to each transaction, for example, each interface has its own function, and the corresponding message is private, for example, the corresponding fields are added, deleted, modified and checked.
The basic feature test of the tested system interface provided by the embodiment of the invention uniformly abstracts the interface test process and extracts the basic feature model of the interface test, and the structured model is the basis of plug-in flexible configuration.
And S120, determining a target system interface grouping result according to the target system interface basic feature model.
And on the basis, if the communication addresses are different, further grouping is carried out, and the grouping result of the target tested system interface is determined.
In an alternative of the embodiment of the present invention, optionally, the determining the target measured system interface grouping result according to the target measured system interface basic feature model includes:
grouping according to a communication protocol in a target tested system interface communication assembly and a message protocol in a message assembly;
and if the communication addresses in the target system interface to be tested are different, further grouping to determine the group to which the target system interface to be tested belongs, and acquiring the grouping result of the target system interface to be tested.
The system interface under test classifies technical properties based on management property classification (such as belonging system and module), and the same communication protocol and message protocol are used in the same system or module under test and are divided into a group; on the basis, if the communication addresses are different, the packets are further grouped. The tested system interface with the same configuration items such as the grouped message protocol, the communication protocol and the like is called a transaction type. Among a group of tested system interfaces with the same communication protocol and message protocol, the message formats are different but have greater similarity in execution, and the tested system interfaces can be divided into the same group.
The embodiment of the invention groups the tested system interfaces of different systems, different communication modes and different message protocols from the technical level on the basis of the traditional management property classification, and extracts the necessary public configuration items when the tested system interfaces are tested. The management property classification method and the technical property classification method are combined, so that the embodiment of the invention has the basic capability of supporting the automatic test of the organization-level tested system interface.
S130, selecting the same target configuration item for the target system interface to be tested in the same group according to the grouping result of the target system interface to be tested to carry out uniform configuration.
The target system interface under test includes, but is not limited to, a system interface under test, a message parent node, and a 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. Selecting the same configuration item for the target tested system interfaces of the same group for uniform configuration according to the requirements of the target tested system interfaces; for example, the various levels of the target system under test interface in the same group are uniformly configured; for example, the message parent node of the target system under test interface of the same group is configured by adopting a non-leaf node configuration item. Selecting optional configuration items of different levels for configuration according to the requirements of different levels of the same group; for example, the transaction type level configuration items are selected for configuration according to the requirements of the tested systems in the same group, and the transaction type level configuration items are selected for configuration according to the requirements of the tested system interfaces in the same group.
The embodiment of the invention adopts the transaction type level, the transaction level, the non-leaf node level and the leaf node level configuration items to flexibly configure the target system to be tested, so that the interface test model of the system to be tested is highly expandable, the interface test model can be completely and flexibly adapted to the specific special requirements of the interface test of the system to be tested of a commercial bank at each level, the repeated realization of the functions of the configuration items is avoided by the reusability design of the configuration items, and the newly increased and maintained cost of the configuration items is reduced. The special configuration items which are not included in the embodiment of the invention can be adapted through plug-in development, the defects of the model are filled, the tester and the plug-in developer can work concurrently, and the time cost is reduced.
The embodiment of the invention provides a configuration type interface automatic testing method, which comprises the steps of abstracting a target system interface to be tested, and determining a basic characteristic model of the target system interface to be tested; the target tested system interface characteristic model comprises a communication component, a message component and a message format; determining a target system interface grouping result according to the target system interface basic feature model; and selecting the same target configuration item for the target tested system interface of the same group to carry out uniform configuration according to the grouping result of the target tested system interface. By adopting the technical scheme of the embodiment of the invention, the test process of the system interface to be tested is unified and abstracted, and the basic characteristic model of the system interface to be tested is extracted, so that a basis is provided for the flexible configuration of the system interface to be tested; the system interfaces to be tested are grouped according to the basic characteristic model of the system interfaces to be tested, the same group of system interfaces to be tested are uniformly configured according to the grouping result, flexible configuration is carried out according to the requirements of each level in the same group, and the automatic testing capability of the configured interfaces is improved.
Example two
Fig. 2A is a flowchart of a configuration interface automation testing method according to a second embodiment of the present invention. Embodiments of the present invention are further optimized on the basis of the above-mentioned embodiments, and the embodiments of the present invention may be combined with various alternatives in one or more of the above-mentioned embodiments.
With the rise of the internet, especially the mobile internet, the speed of commercial bank product iteration is continuously increased, but the requirements on stability and reliability are not reduced, the importance of automatic testing is more and more prominent, and the importance of interface automatic testing is paid much attention because of easy development and low maintenance cost. Commercial banks have a large number of systems in operation, important, stable, and with regression testing requirements, building core automated testing assets is urgently needed. In the agile mode, the automatic test construction and regression work in each iteration period is urgent, which puts extremely high requirements on the support capability of the organization-level automatic test. As shown in fig. 2A, the automated testing method for a configured interface provided in the embodiment of the present invention may include the following steps:
s210, abstracting the target system interface to be tested, and determining a basic characteristic model of the target system interface to be tested.
And S220, determining a target system interface grouping result according to the target system interface basic feature model.
And S230, selecting a target configuration item according to the test requirement of the target system to be tested to configure the target system to be tested.
Fig. 2B is a schematic structural diagram of a plug-in hierarchical configuration according to a second embodiment of the present invention, where the second embodiment of the present invention adopts a hierarchical configuration method to solve differences between specific transaction types and specific transaction layers, and reference is made to fig. 2B for a hierarchical organization structure and a plug-in configuration method.
And selecting transaction type level configuration items according to the test requirements of the target system to be tested to configure the target system to be tested. The transaction type level configuration items include, but are not limited to, communication timeout time, character encoding configuration items, and correctness determination condition configuration items. Typical transaction type level configuration items are correctness judgment condition configuration items of transaction types. For a transaction, a flag bit is designed in a return message under most conditions to indicate whether the transaction is correct or not, and the configuration item is set in a method for determining the flag bit and judging whether the flag bit is consistent with an expected return or not after the return message is received, and comprises a flag bit positioning mode, a flag bit name and a flag bit expected value, wherein:
the flag bit positioning mode includes, but is not limited to, a node full path mode and a node name mode, wherein the node full path mode may be used for judging JSON, XML and other structured messages, and the node name mode is mainly used for streaming messages;
the flag bit name can be a flag bit which is found to accord with the flag bit name according to a set positioning mode, and the value of the flag bit is obtained;
the expected value of the flag bit may be compared with the value of the fetched flag bit to determine whether the transaction is correct.
In addition, in the specific code implementation of the embodiment of the present invention, a default setting exists, but the requirements of the specific transaction type may be different from the default setting, and flexible configuration is required, for example, the timeout time of the http communication mode is defaulted to 30s, and if the system performance is better, the communication timeout time may be configured to 10s, so as to save the execution time the next time.
S240, selecting a target configuration item according to the requirements of each level in the target system interface to be tested in the same group to carry out uniform configuration on the target system interface to be tested.
And selecting a transaction-level configuration item according to the requirements of the tested system interfaces in the target tested system interfaces of the same group to configure the tested system interfaces. Under the same transaction type, the specific transaction also has specificity and needs flexible configuration. The transaction-level configuration items include, but are not limited to, character encoding configuration, communication timeout time, acquisition session configuration, whether CDATA configuration is included, whether transaction configuration is uploaded or downloaded, and whether HTML page configuration is returned. Typical transaction-level configuration items include:
whether the XML contains the CDATA configuration item or not can mean that a special format containing CDATA exists in a partial XML format message, and the data in the CDATA can be correctly analyzed after the special format containing CDATA is set;
the communication overtime configuration item can mean that the communication time of part of transactions is longer than that of other transactions due to network specificity and the like, and communication interruption caused by communication overtime can be avoided by configuring the communication time;
acquiring a session configuration item of login transaction can mean that normal communication can be carried out only by taking the session returned by login transaction during part of transaction communication, and the normal communication of the transaction can be ensured through the configuration item;
whether the returned configuration item is the HTML page configuration item or not can mean that the returned part of the transaction communication is the HTML page sometimes, and the configuration item can be set to directly display the content of the HTML page without judging the returned result;
whether to upload or download the transaction configuration item may refer to that a part of the transaction needs to upload or download a file, and the uploading or downloading of the file may be implemented by setting the configuration item.
Similarly, some configurations of specific transactions may be different from default configurations, and different from the configurations of the types of transactions, which the specific transactions belong to, and the specific configurations need to be flexibly configured.
And selecting a non-leaf node level configuration item according to the requirement of the message father node in the target system interface to be tested of the same group to configure the message father node. The non-leaf node level configuration items include, but are not limited to JSON object to string and node name replacement configuration items. The JSON and XML structured messages can be analyzed into a form of root node-non-leaf node, the middle non-leaf node is used for positioning the leaf node, and the particularity of the layer needs to be configured flexibly. Typical non-leaf node level configuration items include:
the node name replacement configuration item can mean that part of special interfaces exist, input messages of the interfaces are similar to JSON or XML structured messages, but the situations that individual special paths are consistent and cannot be distinguished exist, the interfaces can change special non-leaf nodes into another non-repetitive name so that the special non-leaf nodes conform to JSON or XML structured message protocols, and the configuration item is set on the non-leaf nodes so that the actually sent messages conform to the interface requirements;
the conversion of the JSON object into the character string can mean that a part of special interfaces exist, an input message of the JSON object accords with a JSON message protocol, but the JSON object under a certain node of the message is converted into the character string to be sent when the JSON object is sent, and the configuration item can be set in the node to be solved in the scene.
And selecting leaf node level configuration items according to the requirements of the message fields in the target system interface to be tested of the same group to configure the message fields. The leaf node level configuration items include, but are not limited to, a random serial number configuration item, an acquisition current time configuration item, BASE64 transcoding, SM4 encryption, whether to configure a header, and a node name replacement configuration. The leaf node level configuration item configures the processing of data input in the packet at the layer, and a typical leaf node level configuration item includes:
the random serial number configuration item can mean that the serial number field of part of banking transaction is guaranteed not to be repeated when being sent every time, and the configuration item can generate a unique and unrepeated serial number according to a customized rule;
the acquisition of the server time configuration item can refer to the timeliness of the time guaranteed by sending the date field of part of banking transactions each time, and the configuration item guarantees that the value of the date field is the current time when the transaction is sent each time;
the BASE64 transcoding may mean that specific data of a certain domain in a message needs to be transcoded by the BASE64, and after the configuration item is set by the leaf node, a user only needs to input a character string before transcoding;
the SM4 encryption may mean that specific data of a certain domain in a message needs to be encrypted by the SM4, and after the configuration item is set at the leaf node, a user only needs to input a plaintext. When encrypting specific data of a certain domain in a message, other encryption algorithms that can meet encryption conditions may be selected, which is not specifically limited in the embodiment of the present invention.
In addition, in the JSON and XML structured messages, the leaf node at the bottom represents each individual data field, and the node name replacement configuration item is suitable for the scene with repeated leaf node names. The specific configuration item may be applicable to more than one of the four configuration levels, and therefore, the association between the configuration item and the configuration level is also flexibly configured, so that the specific implementation of the configuration item can be reused across levels.
In an alternative of the embodiment of the present invention, optionally, the method further includes:
and if the same target configuration item is selected in the transaction level configuration, the transaction type level configuration and the default setting, performing configuration operation according to the sequence of the transaction level configuration, the transaction type level configuration and the default setting.
Wherein, some transaction type level configurations and transaction level configurations have mutual exclusion, and also have mutual exclusion with default settings, and in the actual execution process, the following priority policy is followed: transaction level > transaction type level > default. Taking the communication timeout time as an example, the http communication timeout time is defaulted to t1, and if the transaction type timeout time configuration t2 exists in a certain transaction type, t2 covers t 1; if there is a transaction-level timeout configuration t3 for a transaction, then t3 overrides t1 and t 2.
The embodiment of the invention provides a configuration type interface automatic testing method, which comprises the steps of abstracting a target system interface to be tested, and determining a basic characteristic model of the target system interface to be tested; determining a target system interface grouping result according to the target system interface basic feature model; selecting a target configuration item according to the test requirement of the target system to be tested to configure the target system to be tested; and selecting a target configuration item according to the requirements of each level in the target system interface to be tested in the same group to carry out uniform configuration on the target system interface to be tested. By adopting the highly structured basic characteristic model of the tested system interface in the embodiment of the invention, the user is transparent and friendly through uniform packaging, and the technical requirement of testers is reduced. The configuration items realized in the basic characteristic model of the tested system interface are organization-level assets which can be flexibly reused, the special configuration items which are not included in the implementation of the invention can be adapted and fill the defects of the model through plug-in development, and testers and plug-in developers can work concurrently, thereby reducing the time cost. The priority strategy of the similar configuration items in the embodiment of the invention solves the conflict between the individual transaction type and the default setting, solves the conflict between the individual transaction type and the transaction type, and ensures the certainty and consistency of the result of the interface test model in the actual execution process.
EXAMPLE III
Fig. 3 is a schematic structural diagram of an automated testing apparatus for a configured interface according to a third embodiment of the present invention, which is applicable to automated testing of a configured interface. The device includes: a target system under test interface basic feature model determining module 310, a target system under test interface grouping result determining module 320 and a target configuration item configuring module 330. Wherein:
the target tested system interface basic feature model determining module 310 is used for abstracting a target tested system interface and determining a target tested system interface basic feature model; the target tested system interface characteristic model comprises a communication component, a message component and a message format;
the target system interface grouping result determining module 320 is configured to determine a target system interface grouping result according to the target system interface basic feature model;
and the target configuration item configuration module 330 is configured to select the same target configuration item for the target system interfaces under test in the same group according to the target system interface under test grouping result.
On the basis of the foregoing embodiment, optionally, the module for determining a basic feature model of the target system under test interface includes:
abstracting each tested system interface, and extracting a basic characteristic model of each tested system interface to obtain a basic characteristic model library of the tested system interface;
and determining a target tested system interface basic feature model from a pre-acquired tested system interface basic feature model library.
On the basis of the foregoing embodiment, optionally, the module for determining a basic feature model of the target system-under-test interface further includes:
abstracting a tested system interface test communication process into a communication assembly; the communication component comprises a communication protocol, communication time and overtime time;
abstracting the test message assembly and message analysis contents of the tested system interface into message components; the message component comprises a message protocol, character codes and correctness judgment conditions;
abstracting the interaction information of the interface test concrete interface of the system to be tested into a message format; the message format includes an input message and an output message.
On the basis of the foregoing embodiment, optionally, the target system under test interface basic feature model determining module includes:
grouping according to a communication protocol in a target tested system interface communication assembly and a message protocol in a message assembly;
and if the communication addresses in the target system interface to be tested are different, further grouping to determine the group to which the target system interface to be tested belongs, and acquiring the grouping result of the target system interface to be tested.
On the basis of the foregoing embodiment, optionally, the target configuration item configuration module includes:
selecting a target configuration item according to the test requirement of the target system to be tested to configure the target system to be tested;
selecting a target configuration item according to the requirements of each level in the target system interface to be tested in the same group to carry out uniform configuration on the target system interface to be tested;
wherein the target configuration items comprise transaction type level configuration items, transaction level configuration items, non-leaf node configuration items and leaf node configuration items; the target system interface to be tested comprises a system interface to be tested, a message parent node and a message field.
On the basis of the foregoing embodiment, optionally, the target configuration item configuration module further includes:
selecting transaction type level configuration items according to the test requirements of the target system to be tested to configure the target system to be tested;
selecting a transaction-level configuration item to configure the system interface to be tested according to the requirements of the system interface to be tested in the target system interface to be tested in the same group;
selecting a non-leaf node level configuration item to configure a message father node according to the requirement of the message father node in the target system interface to be tested in the same group;
and selecting leaf node level configuration items to configure the message fields according to the requirements of the message fields in the target system interface to be tested of the same group.
On the basis of the foregoing embodiment, optionally, the automatic configuration interface testing apparatus further includes:
and if the same target configuration item is selected in the transaction level configuration, the transaction type level configuration and the default setting, performing configuration operation according to the sequence of the transaction level configuration, the transaction type level configuration and the default setting.
The device can execute the automatic test method of the configured interface provided by any embodiment of the invention, and has the corresponding functional modules and beneficial effects of executing the automatic test method of the configured interface.
Example four
Fig. 4 is a schematic structural diagram of an electronic device according to a fourth embodiment of the present invention. The embodiment of the application provides electronic equipment, and the electronic equipment can be integrated with the interaction device for the automatic test of the configured interface provided by the embodiment of the application. As shown in fig. 4, the present embodiment provides an electronic device 400, which includes: one or more processors 420; a storage device 410, configured to store one or more programs, where when the one or more programs are executed by the one or more processors 420, the one or more processors 420 implement the method for automated testing of a configured interface provided by the embodiment of the present application, the method including:
abstracting a target system interface to be tested, and determining a basic characteristic model of the target system interface to be tested; the target tested system interface characteristic model comprises a communication component, a message component and a message format;
determining a target system interface grouping result according to the target system interface basic feature model;
and selecting the same target configuration item for the target tested system interface of the same group to carry out uniform configuration according to the grouping result of the target tested system interface.
Of course, those skilled in the art will understand that the processor 420 also implements the solution of the configured interface automation test method provided in any embodiment of the present application.
The electronic device 400 shown in fig. 4 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present application.
As shown in fig. 4, 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 processors 420 in the electronic device may be one or more, and one processor 420 is taken as an example in fig. 4; the processor 420, the storage device 410, the input device 430, and the output device 440 in the electronic apparatus may be connected by a bus or other means, and are exemplified by a bus 450 in fig. 4.
The storage device 410 is a computer-readable storage medium, and can be used for storing software programs, computer-executable programs, and module units, such as program instructions corresponding to the configured interface automation test method in the embodiment of the present application.
The storage device 410 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function; the storage data area may store data created according to the use of the terminal, and the like. Further, the storage 410 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid state storage device. In some examples, storage 410 may further include memory located remotely from processor 420, which may be connected via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The input means 430 may be used to receive input numbers, character information, or voice information, and to generate key signal inputs related to user settings and function control of the electronic device. The output device 440 may include a display screen, speakers, or other electronic equipment.
The electronic equipment provided by the embodiment of the application can achieve the technical effect of effectively improving the automatic testing capability of the configuration type interface.
EXAMPLE five
An embodiment of the present invention further provides a storage medium containing computer-executable instructions, which when executed by a computer processor, perform a method for automated testing of a configured interface, the method comprising:
abstracting a target system interface to be tested, and determining a basic characteristic model of the target system interface to be tested; the target tested system interface characteristic model comprises a communication component, a message component and a message format;
determining a target system interface grouping result according to the target system interface basic feature model;
and selecting the same target configuration item for the target tested system interface of the same group to carry out uniform configuration according to the grouping result of the target tested system interface.
Computer storage media for embodiments of the invention may employ 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. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, 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 foregoing. A computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
A computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take a variety of forms, including, but not limited to: an electromagnetic signal, an optical signal, or any suitable combination of the foregoing. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, Radio Frequency (RF), etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations for aspects of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the 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 the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
In the description herein, references to the description of the term "one embodiment," "some embodiments," "an example," "a specific example," or "some examples," etc., mean that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the invention. In this specification, the schematic representations of the terms used above do not necessarily refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
It is to be noted that the foregoing description is only exemplary of the invention and that the principles of the technology may be employed. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, although the present invention has been described in greater detail by the above embodiments, the present invention is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims (10)

1. A method for automated testing of a configured interface, the method comprising:
abstracting a target system interface to be tested, and determining a basic characteristic model of the target system interface to be tested; the target tested system interface characteristic model comprises a communication component, a message component and a message format;
determining a target system interface grouping result according to the target system interface basic feature model;
and selecting the same target configuration item for the target tested system interface of the same group to carry out uniform configuration according to the grouping result of the target tested system interface.
2. The method of claim 1, wherein the testing the target system under test interface and determining the target system under test interface basic feature model comprises:
abstracting each tested system interface, and extracting a basic characteristic model of each tested system interface to obtain a basic characteristic model library of the tested system interface;
and determining a target tested system interface basic feature model from a pre-acquired tested system interface basic feature model library.
3. The method according to claim 2, wherein abstracting each tested system interface to extract a basic feature model of each tested system interface comprises:
abstracting a tested system interface test communication process into a communication assembly; the communication component comprises a communication protocol, communication time and overtime time;
abstracting the test message assembly and message analysis contents of the tested system interface into message components; the message component comprises a message protocol, character codes and correctness judgment conditions;
abstracting the interaction information of the interface test concrete interface of the system to be tested into a message format; the message format includes an input message and an output message.
4. The method of claim 1, wherein determining the target system under test interface grouping result according to the target system under test interface basic feature model comprises:
grouping according to a communication protocol in a target tested system interface communication assembly and a message protocol in a message assembly;
and if the communication addresses in the target system interface to be tested are different, further grouping to determine the group to which the target system interface to be tested belongs, and acquiring the grouping result of the target system interface to be tested.
5. The method of claim 1, wherein the selecting the same target configuration item for the target system interfaces under test in the same group according to the grouping result of the target system interfaces under test for unified configuration comprises:
selecting a target configuration item according to the test requirement of the target system to be tested to configure the target system to be tested;
selecting a target configuration item according to the requirements of each level in the target system interface to be tested in the same group to carry out uniform configuration on the target system interface to be tested;
wherein the target configuration items comprise transaction type level configuration items, transaction level configuration items, non-leaf node configuration items and leaf node configuration items; the target system interface to be tested comprises a system interface to be tested, a message parent node and a message field.
6. The method of claim 1, wherein the selecting the same target configuration item for the target system interfaces under test in the same group for uniform configuration according to the grouping result of the target system interfaces under test further comprises:
selecting transaction type level configuration items according to the test requirements of the target system to be tested to configure the target system to be tested;
selecting a transaction-level configuration item to configure the system interface to be tested according to the requirements of the system interface to be tested in the target system interface to be tested in the same group;
selecting a non-leaf node level configuration item to configure a message father node according to the requirement of the message father node in the target system interface to be tested in the same group;
and selecting leaf node level configuration items to configure the message fields according to the requirements of the message fields in the target system interface to be tested of the same group.
7. The method of claim 1, further comprising:
and if the same target configuration item is selected in the transaction level configuration, the transaction type level configuration and the default setting, performing configuration operation according to the sequence of the transaction level configuration, the transaction type level configuration and the default setting.
8. A configuration interface automated testing apparatus, the apparatus comprising:
the target tested system interface basic feature model determining module is used for abstracting a target tested system interface and determining a target tested system interface basic feature model; the target tested system interface characteristic model comprises a communication component, a message component and a message format;
the target tested system interface grouping result determining module is used for determining a target tested system interface grouping result according to the target tested system interface basic feature model;
and the target configuration item configuration module is used for selecting the same target configuration item for the target tested system interface in the same group for uniform configuration according to the grouping result of the target tested system interface.
9. An electronic device, comprising:
one or more processors;
storage means for storing one or more programs;
when executed by the one or more processors, cause the one or more processors to implement the method for automated testing of a configured interface of any of claims 1-7.
10. A storage medium containing computer-executable instructions for performing the method of configuration interface automated testing of any of claims 1-7 when executed by a computer processor.
CN202210118280.0A 2022-02-08 2022-02-08 Automatic testing method and device for configuration type interface, electronic equipment and storage medium Pending CN114461525A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210118280.0A CN114461525A (en) 2022-02-08 2022-02-08 Automatic testing method and device for configuration type interface, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210118280.0A CN114461525A (en) 2022-02-08 2022-02-08 Automatic testing method and device for configuration type interface, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN114461525A true CN114461525A (en) 2022-05-10

Family

ID=81413377

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210118280.0A Pending CN114461525A (en) 2022-02-08 2022-02-08 Automatic testing method and device for configuration type interface, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114461525A (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108280026A (en) * 2018-01-23 2018-07-13 网易(杭州)网络有限公司 Automated testing method and device, storage medium, electronic equipment
CN113157598A (en) * 2021-05-26 2021-07-23 中国银行股份有限公司 Interface testing method and simulation baffle
CN113220594A (en) * 2021-06-04 2021-08-06 中国农业银行股份有限公司 Automatic testing method, device, equipment and storage medium
CN113590468A (en) * 2021-07-01 2021-11-02 交控科技股份有限公司 Automatic testing method and device for ATS interface of automatic train monitoring system
CN113918461A (en) * 2021-10-19 2022-01-11 中国平安人寿保险股份有限公司 Interface test method, device, equipment and storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108280026A (en) * 2018-01-23 2018-07-13 网易(杭州)网络有限公司 Automated testing method and device, storage medium, electronic equipment
CN113157598A (en) * 2021-05-26 2021-07-23 中国银行股份有限公司 Interface testing method and simulation baffle
CN113220594A (en) * 2021-06-04 2021-08-06 中国农业银行股份有限公司 Automatic testing method, device, equipment and storage medium
CN113590468A (en) * 2021-07-01 2021-11-02 交控科技股份有限公司 Automatic testing method and device for ATS interface of automatic train monitoring system
CN113918461A (en) * 2021-10-19 2022-01-11 中国平安人寿保险股份有限公司 Interface test method, device, equipment and storage medium

Similar Documents

Publication Publication Date Title
US10880385B2 (en) Method and system for implementing dual network telemetry application programming interface (API) framework
CN108964968B (en) Service access management method and system in container cloud environment
CN108196915B (en) Code processing method and device based on application container engine and storage medium
US9069665B2 (en) System and method for definition, creation, management, transmission, and monitoring of errors in SOA environment
US9419899B2 (en) Automated service interface optimization
Soldani et al. The μTOSCA toolchain: Mining, analyzing, and refactoring microservice‐based architectures
CN104572043A (en) Method and device for embedding points for controls of client application in real time
CN109144533A (en) A kind of method, system and the computer installation of update and the load of application program
CN108845940A (en) A kind of enterprise information system automated function test method and system
CN113360301B (en) Message transmission system and method
US11294740B2 (en) Event to serverless function workflow instance mapping mechanism
CN114398293A (en) Interface test case generation method, electronic device and storage medium
CN113032256A (en) Automatic test method, device, computer system and readable storage medium
CN114461525A (en) Automatic testing method and device for configuration type interface, electronic equipment and storage medium
US20220247653A1 (en) Early deployment connectivity testing
CN112765038B (en) Distributed cluster software testing method, device, equipment and storage medium
CN114968770A (en) Automatic testing method, device, equipment and storage medium
CN112084115A (en) Software defect flow operation method and device
CN112114833A (en) Device and method for determining middleware installation and deployment
CN117591245B (en) Automatic deployment method and device for Galaxy kylin server migration operation and maintenance management platform
CN113342633B (en) Performance test method and device
CN110598419B (en) Block chain client vulnerability mining method, device, equipment and storage medium
Li et al. Dual-architecture application parallel and traffic switching solution
Guo et al. Design and implementation of traffic recording playback test tool
CN117857390A (en) Method, system, equipment and medium for testing OpenAPI (open application program interface) based on jMeter

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination