CN116680189A - Service testing method and device, storage medium and electronic equipment - Google Patents

Service testing method and device, storage medium and electronic equipment Download PDF

Info

Publication number
CN116680189A
CN116680189A CN202310721224.0A CN202310721224A CN116680189A CN 116680189 A CN116680189 A CN 116680189A CN 202310721224 A CN202310721224 A CN 202310721224A CN 116680189 A CN116680189 A CN 116680189A
Authority
CN
China
Prior art keywords
test
service
request
working
test case
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
CN202310721224.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.)
China Travelsky Technology Co Ltd
Original Assignee
China Travelsky Technology Co Ltd
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 China Travelsky Technology Co Ltd filed Critical China Travelsky Technology Co Ltd
Priority to CN202310721224.0A priority Critical patent/CN116680189A/en
Publication of CN116680189A publication Critical patent/CN116680189A/en
Pending legal-status Critical Current

Links

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/3672Test management
    • G06F11/3684Test management for test design, e.g. generating new test cases
    • 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/3692Test management for test results analysis
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/50Reducing energy consumption in communication networks in wire-line communication networks, e.g. low power modes or reduced link rate

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)
  • Computer And Data Communications (AREA)

Abstract

The invention provides a service testing method and device, a storage medium and electronic equipment, wherein the method comprises the following steps: when a test request is received, analyzing the test request to obtain a test case based on DSL description of a domain-specific language; performing semantic conversion processing on the test cases to obtain an operation set; the operation set comprises a plurality of operation instructions which are arranged in sequence; judging whether the operation set accords with preset execution conditions or not; if the operation set meets the condition, carrying out service test on the service of the business system according to the operation set to obtain a test result; message conversion is carried out on the test result to obtain a response message; and carrying out request response on the test request based on the response message, and ending the service test process. By applying the method of the invention, the tester can realize the service test based on the test case initiation request of DSL description without configuring MATIP session program, thereby being beneficial to improving the test efficiency and improving the convenience of test work.

Description

Service testing method and device, storage medium and electronic equipment
Technical Field
The present invention relates to the field of testing technologies, and in particular, to a service testing method and apparatus, a storage medium, and an electronic device.
Background
In the air transportation industry, workers typically need to process various services through various service systems. Many MATIP services exist in these business systems, i.e., services developed based on the MATIP protocol. The MATIP protocol refers to the aviation traffic service IP group (mappingofairline reservation, ticketingand MessagingTrafficoverIP, MATIP) protocol, which is a special protocol for the air transportation industry.
In the development and operation scenario of the service system, the MATIP service is usually tested. In the existing MATIP service test process, a service test is realized mainly by adopting a mode of a custom program. The tester sets starting parameters for the test scene to configure the session strategy of the current test scene, realizes the message interaction between the server and the client through the customized program, stores the interaction message by utilizing the database, and identifies the test result by referring to the message in the database.
In the actual test process, MATIP service test involves a plurality of test scenes, and based on the existing service test mode, testers need to set different starting parameters in different scenes, the scene adaptability of the test method is poor, the workload of the testers is large, and the test efficiency is relatively low. Secondly, the testers need to master the MATIP protocol, the requirements on the testers are high, and the convenience of the testers in carrying out the test is poor.
Disclosure of Invention
In view of the above, the embodiments of the present invention provide a service testing method and apparatus, a storage medium, and an electronic device, so as to solve the problems that in the existing service testing process, a tester needs to customize a program for a testing scene, the testing efficiency is low, and the tester needs to master a mate protocol, which is not beneficial to conveniently and rapidly developing testing work.
In order to achieve the above object, the embodiment of the present invention provides the following technical solutions:
the first aspect of the embodiment of the invention provides a service testing method, which comprises the following steps:
when a test request for testing service of a business system is received, analyzing the test request to obtain a test case corresponding to the test request; the business system service is a service constructed based on an aviation traffic service IP group protocol; the test request is a request created based on a hypertext transfer protocol; the test case is a case for describing a test scene based on a DSL (digital subscriber line);
performing semantic conversion processing on the test case to obtain an operation set corresponding to the test case; the operation set comprises a plurality of operation instructions which are arranged in sequence;
judging whether the operation set accords with preset execution conditions or not;
If the operation set meets the execution conditions, carrying out service test on the service of the business system according to the operation set to obtain a test result corresponding to the test case;
performing message conversion on the test result to obtain a response message corresponding to the test result;
and carrying out request response on the test request based on the response message, and ending the service test process corresponding to the test request.
A second aspect of an embodiment of the present invention provides a service testing apparatus, including:
the message analysis unit is used for analyzing the test request to obtain a test case corresponding to the test request when receiving the test request for testing the service of the business system; the business system service is a service constructed based on an aviation traffic service IP group protocol; the test request is a request created based on a hypertext transfer protocol; the test case is a case for describing a test scene based on a DSL (digital subscriber line);
the semantic conversion unit is used for carrying out semantic conversion processing on the test cases to obtain operation sets corresponding to the test cases; the operation set comprises a plurality of operation instructions which are arranged in sequence;
The judging unit is used for judging whether the operation set accords with preset execution conditions or not;
the test unit is used for carrying out service test on the service of the business system according to the operation set if the operation set meets the execution condition, and obtaining a test result corresponding to the test case;
the message conversion unit is used for converting the message of the test result to obtain a response message corresponding to the test result;
and the response unit is used for carrying out request response on the test request based on the response message and ending the service test process corresponding to the test request.
A third aspect of the embodiments of the present invention provides a storage medium, where the storage medium includes stored instructions, where the instructions, when executed, control a device in which the storage medium is located to perform a service testing method as described above.
A fourth aspect of an embodiment of the invention provides an electronic device comprising a memory, and one or more instructions, wherein the one or more instructions are stored in the memory and configured to be executed by one or more processors to perform a service testing method as described above.
The embodiment of the invention provides a service testing method and device, a storage medium and electronic equipment, wherein the method comprises the following steps: when a test request for testing the service of the business system is received, analyzing the test request to obtain a test case corresponding to the test request; the business system service is a service constructed based on an aviation traffic service IP group protocol; the test request is a request created based on a hypertext transfer protocol; the test cases are cases for describing a test scene based on a DSL (digital subscriber line) of a domain-specific language; performing semantic conversion processing on the test cases to obtain operation sets corresponding to the test cases; the operation set comprises a plurality of operation instructions which are arranged in sequence; judging whether the operation set accords with preset execution conditions or not; if the operation set meets the execution conditions, carrying out service test on the service of the business system according to the operation set to obtain a test result corresponding to the test case; message conversion is carried out on the test result, and a response message corresponding to the test result is obtained; and carrying out request response on the test request based on the response message, and ending the service test process. By applying the method provided by the embodiment of the invention, a tester can initiate a test request based on a hypertext transfer protocol (HTTP) interface, a service test system can convert a test case into an operation instruction of MATIP service through semantic conversion, then the service test is realized by executing the operation instruction, and a test result is fed back through request response. The tester can realize automatic service test by preparing DSL-based test cases, does not need to configure an actual MATIP session program, and DSL language has declarative characteristics, so that the writing of the test cases can be simplified, the workload of the tester can be reduced, the mastering requirement on MATIP protocol is lower, the improvement of test efficiency is facilitated, and the convenience of test work is improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings that are required to be used in the embodiments or the description of the prior art will be briefly described below, and it is obvious that the drawings in the following description are only embodiments of the present invention, and that other drawings can be obtained according to the provided drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flow chart of a method for testing services according to an embodiment of the present invention;
FIG. 2 is a block diagram of a service testing system according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of another exemplary module of a service testing system according to an embodiment of the present invention;
FIG. 4 is an exemplary diagram of a service testing procedure provided by an embodiment of the present invention;
FIG. 5 is a diagram illustrating a service testing procedure according to an embodiment of the present invention;
FIG. 6 is a diagram illustrating another example of a service testing procedure according to an embodiment of the present invention;
FIG. 7 is a diagram illustrating a service testing procedure according to an embodiment of the present invention;
FIG. 8 is a diagram illustrating another example of a service testing procedure according to an embodiment of the present invention;
Fig. 9 is a schematic structural diagram of a service testing device according to an embodiment of the present invention;
fig. 10 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present invention, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
The term "including" and variations thereof as used herein are intended to be open-ended, i.e., including, but not limited to. The term "based on" is based at least in part on. The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments. Related definitions of other terms will be given in the description below.
It should be noted that the concepts of "first", "second", etc. mentioned in the embodiments of the present invention are only used to distinguish between different devices, modules or units, and are not used to limit the order or interdependence of functions performed by these devices, modules or units.
It should be noted that references to "one" or "a plurality" of embodiments of the present invention are intended to be illustrative rather than limiting, and those of ordinary skill in the art will appreciate that "one or more" is intended to be understood as "one or more" unless the context clearly indicates otherwise.
The embodiment of the invention provides a service testing method, which can be applied to a service testing system, wherein an execution subject of the method can be a server of the system, and a flow chart of the method is shown in fig. 1 and comprises the following steps:
s101: when a test request for testing service of a business system is received, analyzing the test request to obtain a test case corresponding to the test request; the business system service is a service constructed based on an aviation traffic service IP group protocol; the test request is a request created based on a hypertext transfer protocol; the test case is a case for describing a test scene based on a DSL (digital subscriber line);
the method provided by the embodiment of the invention is applied to the test scene of MATIP service, the service test system exposes a HTTP interface at the front end, and a tester can initiate a test request by calling the HTTP interface through the front end to request to carry test cases configured based on DSL (digital subscriber line) of a domain-specific language. The domain-specific language (DSL), also known as domain-specific language, refers to a computer language that is focused on a certain application domain, and is an existing language and is not described in detail herein. In the method provided by the embodiment of the invention, a tester performs declarative semantic description on test scenes such as session establishment and maintenance, heartbeat maintenance, message transceiving and the like of MATIP service through a DSL abstract MATIP session model to obtain a test case, and initiates a test request based on the test case. DSL can be defined by JSON data format.
In the method provided by the embodiment of the invention, when the server serving the test system receives the test request, the test request can be analyzed, and the test case can be obtained from the analysis.
S102: performing semantic conversion processing on the test case to obtain an operation set corresponding to the test case; the operation set comprises a plurality of operation instructions which are arranged in sequence;
in the method provided by the embodiment of the invention, a semantic conversion mechanism of DSL is preconfigured, and the test scene described in the test case can be converted into the operation command of the test process by establishing the semantic model of MATIP service.
In the process of carrying out semantic conversion processing on the test cases, lexical and grammatical analysis is sequentially carried out on the test cases, then a semantic model is established, a corresponding operation instruction sequence is generated by utilizing the semantic model, and an operation set corresponding to the test cases is formed by each operation instruction which is arranged in sequence.
S103: judging whether the operation set accords with preset execution conditions or not;
in the method provided by the embodiment of the invention, the execution conditions, namely the conditions which are required to be met by the operation set for normal execution, such as whether the data source is available or not, are preset according to the requirement of instruction execution.
And carrying out executable analysis on the operation set through preset execution conditions, if the operation set passes the executable analysis, considering that the operation set accords with the execution conditions, and if the operation set does not pass the executable analysis, considering that the operation set does not accord with the execution conditions. For example, there is an operation of sending data based on a certain data source in the operation set, and the database where the data source is located is connected abnormally, at this time, the data to be sent cannot be loaded, that is, the execution condition is considered to be not met.
S104: if the operation set meets the execution conditions, carrying out service test on the service of the business system according to the operation set to obtain a test result corresponding to the test case;
in the method provided by the embodiment of the invention, if the operation set is judged to meet the preset execution condition, each operation command in the operation set is sequentially executed to perform service test on the corresponding MATIP service, so as to obtain a test result. The test result may be a service test result obtained after the test process is executed, or an abnormal feedback result obtained when an abnormality occurs in the execution process.
S105: performing message conversion on the test result to obtain a response message corresponding to the test result;
In the method provided by the embodiment of the invention, the message conversion is carried out on the test result through the preset conversion strategy of the response message, and specifically, the test result can be packaged into the message in the JSON format so as to obtain the response message corresponding to the test result.
S106: and carrying out request response on the test request based on the response message, and ending the service test process corresponding to the test request.
In the method provided by the embodiment of the invention, the response message is fed back to the requester through the HTTP interface to request and respond to the test request, so that the service test process is completed.
Based on the method provided by the embodiment of the invention, when a test request for testing the service of the business system is received, the test request is analyzed to obtain a test case corresponding to the test request; the service system service is MATIP service; the test request is a request created based on a hypertext transfer protocol; the test case is a case for describing a test scene based on a DSL (digital subscriber line) of a domain-specific language; performing semantic conversion processing on the test cases to obtain operation sets corresponding to the test cases, wherein the operation sets comprise a plurality of operation instructions which are arranged in sequence; judging whether the operation set accords with preset execution conditions or not; if the operation set meets the execution conditions, carrying out service test on the service of the business system according to the operation set to obtain a test result corresponding to the test case; message conversion is carried out on the test result, and a response message corresponding to the test result is obtained; and carrying out request response on the test request based on the response message, and ending the service test process corresponding to the test request. By applying the method provided by the embodiment of the invention, a tester can initiate a test request based on the HTTP interface, a service test system can convert the test case into the operation instruction of MATIP service through semantic conversion, then the service test is realized by executing the operation instruction, and the test result is fed back through request response. The tester can realize automatic service test by preparing DSL-based test cases, does not need to configure an actual MATIP session program, and DSL language has declarative characteristics, so that the writing of the test cases can be simplified, the workload of the tester can be reduced, the mastering requirement on MATIP protocol is lower, the improvement of test efficiency is facilitated, and the convenience of test work is improved.
Based on the method shown in fig. 1, in the method provided by the embodiment of the present invention, the process of analyzing the test request mentioned in step S101 to obtain the test case corresponding to the test request includes:
performing message format conversion on the test request to obtain request data corresponding to the test request;
and acquiring the data of a request body in the request data, and taking the data of the request body as a test case corresponding to the test request.
In the method provided by the embodiment of the invention, the test request is a JSON format message, and the test case is carried in a request body of the test request, namely a body part of the request. And converting the test request into request data corresponding to the data format of the system application from the JSON format message by a preset request message conversion strategy, and acquiring the data of the request body from the request data to obtain the test case.
Based on the method shown in fig. 1, in the method provided by the embodiment of the present invention, the process of performing service testing on the service system service according to the operation set mentioned in step S104 to obtain the test result corresponding to the test case includes:
Judging whether a working cooperation program matched with the test case exists in each pre-established working cooperation program;
in the method provided by the embodiment of the invention, the corresponding MATIP session is processed through the working protocol so as to test MATIP service. Because the service test system is a public system and can process different test processes, a working protocol created in response to other test requests exists in the system, and when the service test system is used as a service end of MATIP service to test a client of MATIP service, a tester can send a session establishment request to the service test system through the client, and under normal conditions, the service test system responds to the session establishment request and also creates a corresponding working protocol to process a corresponding MATIP session.
In the method provided by the embodiment of the invention, the test process is carried out by relying on MATIP session, and the corresponding MATIP session is established in the test process. Firstly, judging whether a working protocol matched with the current test case exists in each pre-established working protocol, namely judging whether the MATIP session established by each working protocol is the same as the MATIP session required to be established by the current test case.
If the working coordination programs matched with the test cases exist in the working coordination programs, the working coordination programs matched with the test cases in the working coordination programs are used as target working coordination programs;
in the method provided by the embodiment of the invention, if the working cooperation program matched with the test case exists in each working cooperation program, namely MATIP session required by the test case is established, the working cooperation program matched with the test case is used as the target working cooperation program.
Calling the target working cooperative program to execute command operation corresponding to the operation set, and obtaining an execution result of the target working cooperative program;
and taking the execution result of the target working protocol as a test result corresponding to the test case.
In the method provided by the embodiment of the invention, the target working cooperation program executes the command operation corresponding to the operation set, such as message sending, message receiving, heartbeat signal sending and the like, and after the target working cooperation program completes the command of the command operation, the execution result of executing the command operation can be obtained. And taking the execution result of the target working protocol as a test result corresponding to the test case.
Based on the method provided by the above embodiment, in the method provided by the embodiment of the present invention, the process of determining whether there is a working protocol matched with the test case in each working protocol created in advance includes:
Determining a first session identification group corresponding to the test case; the first session identifier group comprises a connection mode, a far-end identifier and a session identifier of a service session corresponding to the test case;
in the method provided by the embodiment of the invention, each MATIP session, namely the service session, is identified by adopting a session identification group, wherein the session identification group is a triplet, and the triplet comprises data of three attributes, namely a connection mode, a far-end identification and a session identification. The connection mode refers to a mode that the service test system is connected with the tested object, and represents that the service test system is used as a service end to be connected with the tested object or used as a client to be connected with the tested object, and the specific value of the connection mode can be a client or a server. The remote identifier refers to an identifier of the object to be tested, when the system is used as a client, the remote identifier may be an IP and a port address of a server, and when the system is used as a server, the remote identifier may be an IP and a port address of a client connected to the server. The session identifier refers to H1H2, and H1H2 is the session identifier of the mate connection. The attribute data in the session identifier group are carried in a test scene described by the test case, and it can be understood that corresponding information is carried in an operation set obtained by analyzing the test case.
In the method provided by the embodiment of the invention, the session identifier group corresponding to the test case, namely the first session identifier group, can be obtained according to the test case or the data in the operation set.
Determining a second session identification group corresponding to each working protocol; each second session identification group comprises a connection mode, a far-end identification and a session identification of a service session corresponding to the corresponding working protocol;
in the method provided by the embodiment of the invention, for each working protocol, from the session information of the MATIP session processed by the working protocol, the data such as the connection mode, the far-end identifier, the session identifier and the like corresponding to the MATIP session can be obtained, so that the session identifier group of the MATIP session is obtained, and the session identifier group is used as the second session identifier group corresponding to the working protocol.
Comparing each second session identification group with the first session identification group;
if a second session identification group which is the same as the first session identification group exists, determining that a working protocol matched with the test case exists in each working protocol;
in the method provided by the embodiment of the invention, each second session identification group is compared with the first session identification group respectively to identify whether each second session identification group is the same as the first session identification group or not, and the second session identification group is the same as the first session identification group in terms of respectively corresponding and identical data of each attribute in the second session identification group and the first session identification group. If the second session identification group which is the same as the first session identification group exists in each second session identification group, determining that a working protocol matched with the test case exists in each working protocol, and the working protocol corresponding to the second session identification group which is the same as the first session identification group is the working protocol matched with the test case.
And if each second session identification group is different from the first session identification group, determining that no working cooperation program matched with the test case exists in each working cooperation program.
In the method provided by the embodiment of the invention, if each second session identification group is different from the first session identification group, that is, the second session identification groups which are the same as the first session identification group do not exist in each second session identification group, at this time, it is considered that no working protocol matched with the test case exists in each working protocol.
On the basis of the method provided by the embodiment, the method provided by the embodiment of the invention further comprises the following steps:
if the working cooperation program matched with the test case does not exist in each working cooperation program, determining a test connection mode;
in the method provided by the embodiment of the invention, if the working cooperation program matched with the current test case does not exist in each working cooperation program created in advance, the test connection mode is determined according to the data in the test case or the operation set, namely, the connection mode in the first session identification group mentioned in the embodiment, namely, the data for representing whether the current system needs to be used as a client or a server for testing the tested object is represented.
If the test connection mode characterization is used as a client to test the server, a working protocol corresponding to the test case is created, and service session connection is established through the working protocol corresponding to the test case;
in the method provided by the embodiment of the invention, if the test connection mode characterization is used as the client to test the server, namely the system is used as the client to be connected with the tested object, a working protocol can be newly established according to the first session identification group at the moment, and session connection with the corresponding client is established through the working protocol.
If the service session connection is successfully established by the working coordination program corresponding to the test case, executing command operation corresponding to the operation set by the working coordination program corresponding to the test case, and obtaining an execution result of the working coordination program corresponding to the test case;
and taking the execution result of the working protocol corresponding to the test case as the test result corresponding to the test case.
In the method provided by the embodiment of the invention, if the work protocol Cheng Chenggong establishes session connection with the client, the execution result of the work protocol execution command operation is obtained through the command operation corresponding to the work protocol execution operation set, and the execution result is used as a test result. If the service session connection is not successfully established by the working protocol, a result of abnormal connection can be returned as a test result.
On the basis of the method provided by the embodiment, the method provided by the embodiment of the invention further comprises the following steps:
if the test connection mode characterization is used as a server to test the client, generating an abnormal result; the abnormal result indicates that session connection does not exist;
and taking the abnormal result as a test result corresponding to the test case.
In the method provided by the embodiment of the invention, if the test connection mode characterization is used as the server to test the client, namely the current system is used as the server to be connected with the tested object, under the scene, a tester needs to initiate a request for establishing a session to the server through the client, and under the normal condition, the system responds to the session establishment request of the client, a corresponding working protocol is established to establish session connection. If no pre-established working protocol corresponding to the test case exists in the system, the fact that no session connection exists between the client and the server is indicated, and the abnormal result representing that no session connection exists is generated and used as a test result.
On the basis of the method shown in fig. 1, the method provided by the embodiment of the invention further includes:
if the operation set does not accord with the execution condition, generating an abnormal response message; the abnormal response message is a response message for representing that the test case is abnormal;
And carrying out request response on the test request based on the abnormal response message.
In the method provided by the embodiment of the invention, in the judging process of step S103, if the judged operation set does not meet the preset execution condition, generating a response message indicating that the test case has abnormality, namely an abnormal response message. And feeding the abnormal response message back to the requester through the HTTP interface to perform request response.
In order to better illustrate the method provided by the embodiment of the present invention, on the basis of the method provided by the above embodiment, in combination with an actual test scenario, the embodiment of the present invention provides another service testing method. The method provided by the embodiment of the invention can be implemented by a service test system, the system is an instantiation of the method shown in fig. 1, and a block example diagram of the system can be shown in fig. 2, and the system specifically comprises: HTTP access layer 201, message processing component 202, DSL interpreter 203, MATIP processing component 204, etc. And the system performs data interaction with a service opposite end, namely a service end or a client end, so as to realize service testing.
The main functions of each module in the system are as follows:
HTTP access layer: and providing a RESTAPI for receiving the test request of the test case and returning the test result.
Message processing component: aiming at the test request, operation related to the test, service request data carried by the test and the like are acquired through analysis of the JSON format message. And for the response, assembling a status code according to the result status, and converting the MATIP response into corresponding JSON format data for display.
DSL interpreter: and sequentially performing lexical and grammatical analysis according to the input information, then establishing a semantic model, and translating DSL sentences describing MATIP scenes into operations corresponding to MATIP processing components.
MATIP processing component: encapsulating MATIP connection establishment, disconnection, connection maintenance, session opening, session acceptance, session rejection, heartbeat processing and other functions. An exemplary diagram of the modules of the MATIP processing assembly is shown in FIG. 3, and the assembly specifically includes: modules such as a DSL collaboration component 301, a MATIP Listener 302 (MATIP Listener), a MATIP client connection pool 303, a MATIP server connection pool 304, and a MATIP working protocol 305 can implement various scenes of MATIP server and client interaction through combination of module functions.
The method provided by the embodiment of the invention creates DSL for describing MATIP scene, and is used for simplifying the creation of service scene (namely test scene). To facilitate data presentation and HTTP interactions, DSL is defined using JSON data format. The definition of MATIP scene DSL needs to satisfy the service scene of the client and the server. Each service scenario is performed in an independent MATIP session, and in the process of establishing the MATIP session, a MATIP client needs to actively initiate connection to a server, and after connection is established, a session establishment request SessionOpen is initiated. According to MATIP protocol, the same connection supports multiple groups of session management, the session establishment process not only needs remote service IP and port, but also needs the identification H1H2 information of the session, and the server side also performs session management according to the H1H2 information in the SessionOpen request as an independent session identification. Each session is identified by a (connected mode, remote identification, H1H 2) session identification triplet.
In the definition of DSL, one scenario needs to have three key properties of connection mode (mode), remote identity (remote) and H1H 2. In the abstraction of the service action in the scene, in order to reduce the learning cost of the service personnel, only the operation (action) really related to the service is exposed, such as sending a unidirectional request (sendOnly), sending a request and receiving a response (sendendreply), and the like, and the establishment process of the MATIP connection is hidden. And after receiving the requested semantic information, the MATIP processing component directly selects the semantic information if the connection exists, and creates the semantic information according to MATIP attribute information in the semantic information if the connection does not exist. A scenario in which a plurality of service requests are continuously transmitted simultaneously, and a request number (times) and transmission interval (interval) attribute are increased. And the carrier requesting the content may choose whether the data source (dataSrc) is self-contained (rawData) or derived from a particular file (file) or database (databse) in the HTTP request.
In the MATIP connection layer, in order to avoid noise caused to test results by time consumption of frequently newly-built links, after connection establishment, connection maintenance needs to be performed according to connection attributes, for example, a keep alive heartbeat message is sent regularly, and whether connection needs to be closed or not is discriminated according to heartbeat response and link state and is moved out of a connection pool. Thus adding two attributes, timeOut and interval time (keepAlive), in milliseconds.
For example, as an example of a scenario in which a client transmits a request to a server and receives a response, the following may be mentioned:
{“scenario”:{
“mode”:“client”,
“remote”:“10.5.100.101:350”,
“h1h2”:“EE01”,
“timeOut”:5000,
“keepAlive”:30000,
“action”:“sendAndRecv”,
“times”:20,
“interval”:3000},
“msg”:{
“dataSrc”:“rawData”,
“rawData”:“thisisatestcase.”}}。
the scenario field describes that the scenario is that the client sends a request to the server and receives a response, where the server instance is located at 10.5.100.101:350. The test scene sends 20 requests to the server in a pipeline mode, each time is 3 seconds apart, the test scene tries to receive a response, and the timeout time for receiving the response is set to be 5 seconds. Meanwhile, the connection heartbeat with the server is kept, and a heartbeat request is actively sent to the server every 30 seconds. And the source of the data sent is the value of the input rawrdata field of the request. If the value of the dataSrc is database, reading data from the configured database, and if the value is file, reading data from the designated data file. After describing the scene using DSL rules, when initiating HTTP testing, the body part of the request is scene information and request data described using DSL.
After DSL definition is completed, a DSL interpreter is needed to be realized, definition of MATIDSL adopts a JSON data format, and lexical and grammatical analysis are supported by a universal JSON interpreter. When DSL needs to be expanded, only corresponding MATIP operation mapping is added for the newly added element.
Based on the architecture shown in fig. 2, referring to the flowchart shown in fig. 4, the service testing process provided by the embodiment of the present invention mainly includes:
and the HTTP access layer of the system receives an HTTP request, namely a request initiated by a tester, wherein the body of the request is scene information defined by DSL.
And analyzing the request through the message processing component to obtain scene information and interaction data, namely the test case. And after the message processing component performs message analysis and format verification, entering a DSL interpreter.
Operating a DSL interpreter to perform semantic conversion on the test cases, and acquiring scene model semantics, namely sequentially executing operation commands;
judging whether available scene model semantics are successfully obtained through the DSL interpreter, and if so, sending the scene model semantics to the MATIP processing component. If the available scene model semantics are not successfully obtained, the HTTP response of scene abnormality is fed back through the HTTP access layer.
The MATIP processing component performs service test based on the scene model semantics sent by the DSL interpreter, the DSL cooperative component in the component executes the service scene to obtain MATIP response, the MATIP response is converted into JSON format data through the message processing component, and the HTTP response is fed back by the HTTP access layer.
The processing flow of the MATIP processing assembly is further described below. Referring to the flowchart shown in fig. 5, after the service test system is started, the background automatically loads the MATIP processing component, the main cooperative program creates a MATIP server connection pool and a MATIP client connection pool, and starts the relevant cooperative program such as a MATIP monitor cooperative program and a DSL cooperative component. Each MATIP session is identified by a session identification triplet composed of a connection mode, a remote identification and H1H2, wherein H1H2 is the identification of the connection session, and is carried when a client initiates a session to establish SessionOpen.
The main coroutine of the MATIP processing component listens for pipeline information, and the pipeline refers to system resources used when the multiple coroutines interact in the system, such as a pipe of a Linux operating system. If the pipeline receives a termination signal for terminating a certain resource, the main cooperative program releases the corresponding resource, if the termination signal is not received, corresponding operation is executed according to the pipeline signal, and pipeline information is continuously monitored.
In order to better illustrate the processing flow of the mate processing component, the process of establishing a session connection by the mate processing component in response to a request from a client when the system is tested as a server is described next. Referring to the flowchart shown in fig. 6, in the operation process of the MATIP processing component, the MATIP monitor monitors a connection interface, when the interface receives a request, identifies whether the request is a connection request sent by a client, if the request is a connection request of the client, performs session connection and session verification with the client, and if the request is passed, creates a corresponding MATIP working protocol, and puts the working protocol into a MATIP server connection pool. If the verification is not passed, a refusal message is sent to the client.
To better illustrate the process flow of the MATIP processing component, the workflow of the DSL collaboration component is further illustrated. Referring to the flowchart shown in fig. 7, the workflow mainly includes:
monitoring cooperative pipeline information, and if an exit signal is monitored, logging off resources and ending a corresponding cooperative range;
if the detected signal is not the exit signal, judging whether the detected signal is a cooperative signal, and if the detected signal is not the cooperative signal, continuing to monitor the cooperative pipeline;
if the match signal is the cooperative signal, analyzing the cooperative information, acquiring MATIP working cooperative program according to MATIP session identification group, if the matched working cooperative program exists, calling the MATIP working cooperative program to process data, including sending the data and waiting for receiving, determining a response (such as a response of overtime data receiving, assembling the response of overtime prompt) according to the data receiving condition, and returning the response to the message processing component;
if the matched working protocol does not exist, judging the connection type (namely the connection mode), if the matched working protocol is a client, establishing a MATIP working protocol, establishing a MATIP link with a remote end, sending a session establishment (session opening) request, if the session establishment request is refused by a server, assembling a response message, prompting that the session connection is refused, calling a message processing component callback interface, and returning an HTTP response. If the session establishment request is accepted by the server, registering the MATIP working protocol to a client connection pool, and calling the MATIP working protocol to process data;
If the connection type is not the client, but the server, a response message is assembled, the prompt is used as the server, the client connection of the session identification triples is not specified at present, and the response returns to the message processing component.
In the method provided by the embodiment of the invention, the MATIP processing component monitors the cooperative pipeline, and reads the scene model semantics carried by the signals after receiving the cooperative signals of the scene model semantics. And attempting to acquire the working cooperation from the connection pool according to the session identification triples to process the message, and if no matched working cooperation exists, respectively processing according to the type of session connection. When the system is used as a client, connection with a remote MATIP server can be tried to be established, a session establishment SessionOpen message is assembled and sent, if the server receives the connection, the protocol is registered into a client connection pool of a MATIP processing component, actions in a test scene are continuously executed, message sending and receiving are carried out, and after execution of scene model semantics is completed, a processing state and a result are returned by a callback message processing component interface. If the server refuses the connection, reporting to the message processing component, and then returning an abnormal response to the request initiator through the HTTP access layer. When the system is used as a server, if the working cooperation of the session identification triplex does not exist, the remote MATIP client is not initiated to connect with the server, the remote MATIP client directly reports to a message processing assembly, and an abnormal response is returned to a request initiator through an HTTP access layer.
In order to better illustrate the method provided by the embodiment of the present invention, the processing procedure of the work coordination procedure is illustrated.
Taking a scenario that a simulation test is taken as a MATIP server to continuously send 20 unidirectional requests to a specific client as an example, the description of test cases is as follows:
{“scenario”:{
“mode”:“server”,
“remote”:“10.5.100.102”,
“h1h2”:“EE01”,
“timeOut”:5000,
“keepAlive”:30000,
“action”:“sendOnly”,
“times”:20,
“interval”:3000},
“msg”:{
“dataSrc”:“file”,
“file”:“/opt/matip/testcase/case01.dat”}}。
the processing procedure of the DSL cooperative component involves calling MATIP working cooperation program to complete data operation work, taking the test scenario as an example. After the service test system is started, a MATIP monitor protocol is started in the background to monitor the connection of the client, if a remote end 10.5.100.102 initiates a connection request and completes the establishment of a session with H1H2 EE01, the MATIP monitor establishes an independent MATIP working protocol by using a triple of (server), (10.5.100.102) and (EE 01) as an identifier and registers the independent MATIP working protocol in a server connection pool. After the HTTP call of the simulation test starts, the DSL cooperative component takes the MATIP working cooperative program from the service end connection pool and sends a job command to the MATIP working cooperative program. After receiving the operation command, the MATIP working protocol acquires that the command is to send a unidirectional message to the remote end for 20 times, the sending frequency is once every 3 seconds, the data source is obtained from the data file, and the file storage path is as follows: opt/matip/testcase/case01.Dat. The MATIP working protocol firstly searches whether the content of the configuration data file exists in a Cache (Cache), if so, the MATIP working protocol indicates that the content is loaded before and is not expired, and is directly used, and if not, the MATIP working protocol loads the data and adds the data into the Cache. And then attempting to complete data transmission according to the transmission strategy, and calling back the state and the result to the message processing component interface.
Referring to the flowchart shown in fig. 8, the processing procedure of the MATIP working protocol mainly includes:
and monitoring the cooperative pipeline information, if the cooperative pipeline information is the exit signal, cleaning the resource, logging off from the connection pool, and ending the cooperative journey.
If the heartbeat command is a heartbeat command, a heartbeat request (i.e. a heartbeat message) is sent to the far end. If the heartbeat response is not received or the heartbeat is failed to be sent beyond the configuration times, the resources can be cleaned. If the heartbeat is normal, the collaborative pipe can be continuously monitored.
If the operation command is executed, the operation data source is judged, and the data source is the request, the data processing and the subsequent flow are directly carried out.
If the data source is a specific file, inquiring whether the file data exists in the cache, and if so, performing data processing and subsequent processes based on the cache. If the cache does not have file data, the data is loaded from the specific file, the data is stored in the cache, and then the data processing and the subsequent flow are carried out.
If the data source is a database, inquiring whether the database specified data exists in the cache, and if so, performing data processing and subsequent flow. If the data does not exist in the cache, the appointed data is loaded from the database, the data is stored in the cache, and then the data processing and the subsequent flow are carried out.
If the data source is not the data of the above types, prompting scene data errors, generating an abnormal format message, calling back a message processing component interface, generating an HTTP response, and returning to a request caller.
The data processing and subsequent processes comprise data processing, judging whether the processing times are reached, if the processing times are not reached, continuing to process the data until the processing times are reached, generating a response message according to the processing state and the result, calling back a message processing component interface, generating an HTTP response, returning to a request calling end, and then continuing to monitor pipeline information.
Based on the method provided by the embodiment of the invention, the construction of the service scene is simplified by defining DSL applicable to MATIP scene. And a DSL abstract MATIP session model is used for carrying out declarative semantic description on scenes such as session establishment and maintenance, heartbeat maintenance, message transceiving and the like of MATIP, thereby being beneficial to reducing repeated labor in the construction process of business scenes, improving development efficiency and reducing construction cost. Meanwhile, DSL improves the readability of codes, is beneficial to the formation of unified language in the organization, is convenient for internal communication, ensures that testers focus on a service main line, reduces the learning cost of the testers, and supports the rapid construction of novel service scenes by service specialists. Through DSL interpreter and DSL cooperation subassembly, the mapping execution of HTTP request to MATIP job is accomplished, demonstrate to the outside as HTTP service, the integration is convenient with the DevOps instrument, HTTP has simple, nimble, advantage that expansibility is strong, HTTP-based service can use ripe stable instrument, like browser etc. conveniently to test, high to automated test support degree, makes the tester focus on the test of business demand. The test cost is reduced, and the test efficiency is improved. DevOps is a collective term for a set of processes, methods and systems used to facilitate communication, collaboration and integration between development, technical operations and quality assurance departments.
Although operations are depicted in a particular order, this should not be understood as requiring that such operations be performed in the particular order shown or in sequential order. In certain circumstances, multitasking and parallel processing may be advantageous.
It should be understood that the various steps recited in the method embodiments of the present invention may be performed in a different order and/or performed in parallel. Furthermore, method embodiments may include additional steps and/or omit performing the illustrated steps. The scope of the invention is not limited in this respect.
Corresponding to the service testing method shown in fig. 1, the embodiment of the present invention further provides a service testing device, which is used for implementing the method shown in fig. 1, where the service testing device provided in the embodiment of the present invention may be applied to a computer terminal, and the structural schematic diagram of the service testing device is shown in fig. 9, and includes:
the message parsing unit 401 is configured to parse the test request to obtain a test case corresponding to the test request when receiving the test request for testing the service of the service system; the business system service is a service constructed based on an aviation traffic service IP group protocol; the test request is a request created based on a hypertext transfer protocol; the test case is a case for describing a test scene based on a DSL (digital subscriber line);
The semantic conversion unit 402 is configured to perform semantic conversion processing on the test case, so as to obtain an operation set corresponding to the test case; the operation set comprises a plurality of operation instructions which are arranged in sequence;
a judging unit 403, configured to judge whether the operation set meets a preset execution condition;
a test unit 404, configured to perform service testing on the service system service according to the operation set if the operation set meets the execution condition, so as to obtain a test result corresponding to the test case;
a message conversion unit 405, configured to perform message conversion on the test result, so as to obtain a response message corresponding to the test result;
and a response unit 406, configured to respond to the test request based on the response message, and end a service testing procedure corresponding to the test request.
By applying the device provided by the embodiment of the invention, a tester can initiate a test request based on the HTTP interface, a service test system can convert the test case into the operation instruction of MATIP service through semantic conversion, then the service test is realized by executing the operation instruction, and the test result is fed back through request response. The tester can realize automatic service test by preparing DSL-based test cases, does not need to configure an actual MATIP session program, and DSL language has declarative characteristics, so that the writing of the test cases can be simplified, the workload of the tester can be reduced, the mastering requirement on MATIP protocol is lower, the improvement of test efficiency is facilitated, and the convenience of test work is improved.
The device provided by the embodiment of the present invention may further extend a plurality of units on the basis of the device shown in fig. 9, and the functions of each unit may be referred to in the foregoing description of each embodiment provided by the service testing method, which is not further illustrated herein.
The functions described above herein may be performed, at least in part, by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: a Field Programmable Gate Array (FPGA), an Application Specific Integrated Circuit (ASIC), an Application Specific Standard Product (ASSP), a system on a chip (SOC), a Complex Programmable Logic Device (CPLD), and the like.
The embodiment of the invention also provides an electronic device of the service testing method, which comprises a memory and one or more instructions, wherein the one or more instructions are stored in the memory and are configured to execute the service testing method by one or more processors. The schematic structural diagram of the electronic device may be shown in fig. 10, and the electronic device shown in fig. 10 is only an example, and should not impose any limitation on the functions and the application scope of the embodiment of the present invention.
As shown in fig. 10, the electronic device 500 may include a processing means (e.g., a central processing unit, a graphics processor, etc.) 501, which may perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM) 502 or a program loaded from a storage means 508 into a Random Access Memory (RAM) 503. In the RAM503, various programs and data required for the operation of the electronic apparatus 500 are also stored. The processing device 501, the ROM502, and the RAM503 are connected to each other via a bus 504. An input/output (I/O) interface 505 is also connected to bus 504.
In general, the following devices may be connected to the I/O interface 505: input devices 506 including, for example, a touch screen, touchpad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; an output device 507 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, and the like; storage 508 including, for example, magnetic tape, hard disk, etc.; and communication means 509. The communication means 509 may allow the electronic device 500 to communicate with other devices wirelessly or by wire to exchange data. While fig. 10 shows an electronic device 500 having various means, it is to be understood that not all of the illustrated means are required to be implemented or provided. More or fewer devices may be implemented or provided instead.
The embodiment of the invention also provides a storage medium, which comprises stored instructions, wherein the equipment where the storage medium is located is controlled to execute the service testing method when the instructions run.
The storage medium carries one or more programs that, when executed by the electronic device, cause the electronic device to: when a test request for testing service of a business system is received, analyzing the test request to obtain a test case corresponding to the test request; the business system service is a service constructed based on an aviation traffic service IP group protocol; the test request is a request created based on a hypertext transfer protocol; the test case is a case for describing a test scene based on a DSL (digital subscriber line); performing semantic conversion processing on the test case to obtain an operation set corresponding to the test case; the operation set comprises a plurality of operation instructions which are arranged in sequence; judging whether the operation set accords with preset execution conditions or not; if the operation set meets the execution conditions, carrying out service test on the service of the business system according to the operation set to obtain a test result corresponding to the test case; performing message conversion on the test result to obtain a response message corresponding to the test result; and carrying out request response on the test request based on the response message, and ending the service test process corresponding to the test request.
Although the subject matter has been described in language specific to structural features and/or methodological acts, it is to be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are example forms of implementing the claims.
While several specific implementation details are included in the above discussion, these should not be construed as limiting the scope of the application. Certain features that are described in the context of separate embodiments can also be implemented in combination in a single embodiment. Conversely, various features that are described in the context of a single embodiment can also be implemented in multiple embodiments separately or in any suitable subcombination.
The above description is only illustrative of the preferred embodiments of the present application and of the principles of the technology employed. It will be appreciated by persons skilled in the art that the scope of the disclosure referred to in the present application is not limited to the specific combinations of technical features described above, but also covers other technical features formed by any combination of the technical features described above or their equivalents without departing from the spirit of the disclosure. Such as the above-mentioned features and the technical features disclosed in the present application (but not limited to) having similar functions are replaced with each other.
In the detailed description, the application will be repeated with all matters protected by the claims in the form of the following description:
in accordance with one or more embodiments of the present disclosure, fig. 1 provides a service testing method, including: when a test request for testing service of a business system is received, analyzing the test request to obtain a test case corresponding to the test request; the business system service is a service constructed based on an aviation traffic service IP group protocol; the test request is a request created based on a hypertext transfer protocol; the test case is a case for describing a test scene based on a DSL (digital subscriber line); performing semantic conversion processing on the test case to obtain an operation set corresponding to the test case; the operation set comprises a plurality of operation instructions which are arranged in sequence; judging whether the operation set accords with preset execution conditions or not; if the operation set meets the execution conditions, carrying out service test on the service of the business system according to the operation set to obtain a test result corresponding to the test case; performing message conversion on the test result to obtain a response message corresponding to the test result; and carrying out request response on the test request based on the response message, and ending the service test process corresponding to the test request.
Performing message format conversion on the test request to obtain request data corresponding to the test request; and acquiring the data of a request body in the request data, and taking the data of the request body as a test case corresponding to the test request.
Judging whether a working cooperation program matched with the test case exists in each pre-established working cooperation program; if the working coordination programs matched with the test cases exist in the working coordination programs, the working coordination programs matched with the test cases in the working coordination programs are used as target working coordination programs; calling the target working cooperative program to execute command operation corresponding to the operation set, and obtaining an execution result of the target working cooperative program; and taking the execution result of the target working protocol as a test result corresponding to the test case.
Determining a first session identification group corresponding to the test case; the first session identifier group comprises a connection mode, a far-end identifier and a session identifier of a service session corresponding to the test case; determining a second session identification group corresponding to each working protocol; each second session identification group comprises a connection mode, a far-end identification and a session identification of a service session corresponding to the corresponding working protocol; comparing each second session identification group with the first session identification group; if a second session identification group which is the same as the first session identification group exists, determining that a working protocol matched with the test case exists in each working protocol; and if each second session identification group is different from the first session identification group, determining that no working cooperation program matched with the test case exists in each working cooperation program.
If the working cooperation program matched with the test case does not exist in each working cooperation program, determining a test connection mode; if the test connection mode characterization is used as a client to test the server, a working protocol corresponding to the test case is created, and service session connection is established through the working protocol corresponding to the test case; if the service session connection is successfully established by the working coordination program corresponding to the test case, executing command operation corresponding to the operation set by the working coordination program corresponding to the test case, and obtaining an execution result of the working coordination program corresponding to the test case; and taking the execution result of the working protocol corresponding to the test case as the test result corresponding to the test case.
If the test connection mode characterization is used as a server to test the client, generating an abnormal result; the abnormal result indicates that session connection does not exist; and taking the abnormal result as a test result corresponding to the test case.
If the operation set does not accord with the execution condition, generating an abnormal response message; the abnormal response message is a response message for representing that the test case is abnormal; and carrying out request response on the test request based on the abnormal response message.
In accordance with one or more embodiments of the present disclosure, fig. 9 provides a service testing apparatus, comprising: the message analysis unit is used for analyzing the test request to obtain a test case corresponding to the test request when receiving the test request for testing the service of the business system; the business system service is a service constructed based on an aviation traffic service IP group protocol; the test request is a request created based on a hypertext transfer protocol; the test case is a case for describing a test scene based on a DSL (digital subscriber line); the semantic conversion unit is used for carrying out semantic conversion processing on the test cases to obtain operation sets corresponding to the test cases; the operation set comprises a plurality of operation instructions which are arranged in sequence; the judging unit is used for judging whether the operation set accords with preset execution conditions or not; the test unit is used for carrying out service test on the service of the business system according to the operation set if the operation set meets the execution condition, and obtaining a test result corresponding to the test case; the message conversion unit is used for converting the message of the test result to obtain a response message corresponding to the test result; and the response unit is used for carrying out request response on the test request based on the response message and ending the service test process corresponding to the test request.
According to one or more embodiments of the present disclosure, the present disclosure provides a storage medium, where the storage medium includes stored instructions, and when the instructions run, control a device in which the storage medium is located to perform the service testing method described above.
In accordance with one or more embodiments of the present disclosure, FIG. 10 provides an electronic device comprising a memory, and one or more instructions, wherein the one or more instructions are stored in the memory and configured to perform the above-described service testing method by one or more processors.

Claims (10)

1. A service testing method, comprising:
when a test request for testing service of a business system is received, analyzing the test request to obtain a test case corresponding to the test request; the business system service is a service constructed based on an aviation traffic service IP group protocol; the test request is a request created based on a hypertext transfer protocol; the test case is a case for describing a test scene based on a DSL (digital subscriber line);
performing semantic conversion processing on the test case to obtain an operation set corresponding to the test case; the operation set comprises a plurality of operation instructions which are arranged in sequence;
Judging whether the operation set accords with preset execution conditions or not;
if the operation set meets the execution conditions, carrying out service test on the service of the business system according to the operation set to obtain a test result corresponding to the test case;
performing message conversion on the test result to obtain a response message corresponding to the test result;
and carrying out request response on the test request based on the response message, and ending the service test process corresponding to the test request.
2. The method of claim 1, wherein the parsing the test request to obtain the test case corresponding to the test request comprises:
performing message format conversion on the test request to obtain request data corresponding to the test request;
and acquiring the data of a request body in the request data, and taking the data of the request body as a test case corresponding to the test request.
3. The method of claim 1, wherein the performing service testing on the service system service according to the operation set to obtain a test result corresponding to the test case includes:
judging whether a working cooperation program matched with the test case exists in each pre-established working cooperation program;
If the working coordination programs matched with the test cases exist in the working coordination programs, the working coordination programs matched with the test cases in the working coordination programs are used as target working coordination programs;
calling the target working cooperative program to execute command operation corresponding to the operation set, and obtaining an execution result of the target working cooperative program;
and taking the execution result of the target working protocol as a test result corresponding to the test case.
4. The method of claim 3, wherein said determining whether there is a working agreement matching the test case among the pre-created working agreements comprises:
determining a first session identification group corresponding to the test case; the first session identifier group comprises a connection mode, a far-end identifier and a session identifier of a service session corresponding to the test case;
determining a second session identification group corresponding to each working protocol; each second session identification group comprises a connection mode, a far-end identification and a session identification of a service session corresponding to the corresponding working protocol;
comparing each second session identification group with the first session identification group;
If a second session identification group which is the same as the first session identification group exists, determining that a working protocol matched with the test case exists in each working protocol;
and if each second session identification group is different from the first session identification group, determining that no working cooperation program matched with the test case exists in each working cooperation program.
5. A method according to claim 3, further comprising:
if the working cooperation program matched with the test case does not exist in each working cooperation program, determining a test connection mode;
if the test connection mode characterization is used as a client to test the server, a working protocol corresponding to the test case is created, and service session connection is established through the working protocol corresponding to the test case;
if the service session connection is successfully established by the working coordination program corresponding to the test case, executing command operation corresponding to the operation set by the working coordination program corresponding to the test case, and obtaining an execution result of the working coordination program corresponding to the test case;
and taking the execution result of the working protocol corresponding to the test case as the test result corresponding to the test case.
6. The method as recited in claim 5, further comprising:
if the test connection mode characterization is used as a server to test the client, generating an abnormal result; the abnormal result indicates that session connection does not exist;
and taking the abnormal result as a test result corresponding to the test case.
7. The method as recited in claim 1, further comprising:
if the operation set does not accord with the execution condition, generating an abnormal response message; the abnormal response message is a response message for representing that the test case is abnormal;
and carrying out request response on the test request based on the abnormal response message.
8. A service testing apparatus, comprising:
the message analysis unit is used for analyzing the test request to obtain a test case corresponding to the test request when receiving the test request for testing the service of the business system; the business system service is a service constructed based on an aviation traffic service IP group protocol; the test request is a request created based on a hypertext transfer protocol; the test case is a case for describing a test scene based on a DSL (digital subscriber line);
The semantic conversion unit is used for carrying out semantic conversion processing on the test cases to obtain operation sets corresponding to the test cases; the operation set comprises a plurality of operation instructions which are arranged in sequence;
the judging unit is used for judging whether the operation set accords with preset execution conditions or not;
the test unit is used for carrying out service test on the service of the business system according to the operation set if the operation set meets the execution condition, and obtaining a test result corresponding to the test case;
the message conversion unit is used for converting the message of the test result to obtain a response message corresponding to the test result;
and the response unit is used for carrying out request response on the test request based on the response message and ending the service test process corresponding to the test request.
9. A storage medium comprising stored instructions, wherein the instructions, when executed, control a device in which the storage medium is located to perform the service testing method of any one of claims 1-7.
10. An electronic device comprising a memory and one or more instructions, wherein the one or more instructions are stored in the memory and configured to perform the service testing method of any of claims 1-7 by one or more processors.
CN202310721224.0A 2023-06-16 2023-06-16 Service testing method and device, storage medium and electronic equipment Pending CN116680189A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310721224.0A CN116680189A (en) 2023-06-16 2023-06-16 Service testing method and device, storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310721224.0A CN116680189A (en) 2023-06-16 2023-06-16 Service testing method and device, storage medium and electronic equipment

Publications (1)

Publication Number Publication Date
CN116680189A true CN116680189A (en) 2023-09-01

Family

ID=87788898

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310721224.0A Pending CN116680189A (en) 2023-06-16 2023-06-16 Service testing method and device, storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN116680189A (en)

Similar Documents

Publication Publication Date Title
CN107277153B (en) Method, device and server for providing voice service
CN109760041B (en) Chat robot-based cloud management system and operation method thereof
CN107292117B (en) Processing method and device for quality guarantee of mass shared medical images
US11392873B2 (en) Systems and methods for simulating orders and workflows in an order entry and management system to test order scenarios
US11431806B2 (en) Internet of things information system of multiple objects
US11228683B2 (en) Supporting conversations between customers and customer service agents
CN108833510B (en) Message processing method and device
CN108319552A (en) One kind burying a test method, apparatus and system
CN111447170B (en) Data processing method and system, computer system and computer readable medium
CN113037616B (en) Interactive method and device for cooperatively controlling multiple robots
CN112313627B (en) Mapping mechanism of event to serverless function workflow instance
CN110309931A (en) A kind of service optimization method and device
CN111786939A (en) Method, device and system for testing management platform of Internet of things
CN114328132A (en) Method, device, equipment and medium for monitoring state of external data source
KR20130075252A (en) Apparatus and method for conformance testing of service choreography
CN110995538B (en) Network data acquisition method, device, system, equipment and storage medium
CN112416739B (en) Test method and device and electronic equipment
CN116680189A (en) Service testing method and device, storage medium and electronic equipment
CN109587349B (en) Multimedia agent line testing method and device, electronic equipment and storage medium
CN116662193A (en) Page testing method and device
CN114090021A (en) System deployment method, device, electronic equipment and storage medium
CN109660573B (en) Data transmission method and device
CN113079055A (en) Method and device for dynamically acquiring AGV (automatic guided vehicle) running data
CN113542103B (en) Method and device for monitoring invitations of accounts in social communication group and mobile terminal
US20230344910A1 (en) System for establishing communication

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