CN113032244B - Interface test method, device, computer system and computer readable storage medium - Google Patents

Interface test method, device, computer system and computer readable storage medium Download PDF

Info

Publication number
CN113032244B
CN113032244B CN202110202647.2A CN202110202647A CN113032244B CN 113032244 B CN113032244 B CN 113032244B CN 202110202647 A CN202110202647 A CN 202110202647A CN 113032244 B CN113032244 B CN 113032244B
Authority
CN
China
Prior art keywords
test
service
interface
interface service
target tested
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.)
Active
Application number
CN202110202647.2A
Other languages
Chinese (zh)
Other versions
CN113032244A (en
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.)
Industrial and Commercial Bank of China Ltd ICBC
Original Assignee
Industrial and Commercial Bank of China Ltd ICBC
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 Industrial and Commercial Bank of China Ltd ICBC filed Critical Industrial and Commercial Bank of China Ltd ICBC
Priority to CN202110202647.2A priority Critical patent/CN113032244B/en
Publication of CN113032244A publication Critical patent/CN113032244A/en
Application granted granted Critical
Publication of CN113032244B publication Critical patent/CN113032244B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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/3664Environments for testing or debugging software
    • 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

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 disclosure provides an interface testing method, an interface testing device, a computer system and a computer readable storage medium, which can be used in the technical field of computers, internet of things or other fields. Wherein the method comprises the following steps: generating a test template corresponding to the target tested interface service in response to a selection request for the target tested interface service, wherein the selection request is generated by a user selecting the target tested interface service at an interface test interface of a client; the method comprises the steps that a test template is sent to a client, so that the client generates a test message for testing a target tested interface service according to the test template; responding to a test request containing a test message, testing a target tested interface service, and generating a serialized test result; and sending the test result to the client so that the client can display the test result.

Description

Interface test method, device, computer system and computer readable storage medium
Technical Field
The present disclosure relates to the field of computers and internet of things, and more particularly, to an interface testing method, an interface testing device, a computer system, and a computer readable storage medium.
Background
There are various interface definitions in the industrial software system, which can be divided into an external interface and an internal interface according to the scope, and can be divided into an http interface, an RPC interface, an API interface and the like according to the protocol type. In the development process of system software, when testing is performed on different types of interfaces, the corresponding interface environments are inevitably required to be loaded.
In the process of realizing the disclosed concept, the inventor finds that at least the following problems exist in the related art, and the corresponding system environment needs to be loaded during interface test, so that the interface test engineering cost is high, and the technical admission threshold of testers is high.
Disclosure of Invention
In view of this, the present disclosure provides an interface testing method, an interface testing apparatus, a computer system, and a computer-readable storage medium.
One aspect of the present disclosure provides an interface testing method applied to a server, including: generating a test template corresponding to a target tested interface service in response to a selection request for the target tested interface service, wherein the selection request is generated by a user selecting the target tested interface service at an interface test interface of a client; the test template is sent to the client so that the client generates a test message for testing the target tested interface service according to the test template; responding to a test request containing the test message, testing the target tested interface service, and generating a serialized test result; and sending the test result to the client so that the client can display the test result.
Another aspect of the present disclosure provides an interface testing method applied to a client, including: sending a selection request aiming at a target tested interface service to a service end, so that the service end returns a test template corresponding to the target tested interface service according to the selection request, wherein the selection request is generated by a user selecting the target tested interface service at an interface test interface of a client, and the interface test interface comprises at least one tested interface service; generating a test message for testing the target tested interface service according to the test template; sending a test request containing the test message to the server so that the server returns a test result corresponding to the target tested interface service; and receiving the test result and displaying the test result on the client.
Another aspect of the present disclosure provides an interface testing apparatus applied to a server, including: the first generation module is used for responding to a selection request aiming at a target tested interface service and generating a test template corresponding to the target tested interface service, wherein the selection request is generated by a user for selecting the target tested interface service at an interface test interface of a client; the first sending module is used for sending the test template to the client so that the client generates a test message for testing the target tested interface service according to the test template; the second generation module is used for responding to the test request containing the test message, testing the target tested interface service and generating a serialized test result; and the second sending module is used for sending the test result to the client so that the client can display the test result.
Another aspect of the present disclosure provides an interface testing apparatus applied to a client, including: the third sending module is used for sending a selection request aiming at a target tested interface service to the service end so that the service end returns a test template corresponding to the target tested interface service according to the selection request, wherein the selection request is generated by a user selecting the target tested interface service at an interface test interface of the client end, and the interface test interface comprises at least one tested interface service; a fourth generating module, configured to generate a test packet for testing the target tested interface service according to the test template; a fourth sending module, configured to send a test request including the test packet to the server, so that the server returns a test result corresponding to the target tested interface service; and the first display module is used for receiving the test result and displaying the test result on the client.
Another aspect of the present disclosure provides a computer system comprising: one or more processors; and a memory for storing one or more programs, wherein the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the interface testing method as described above.
Another aspect of the present disclosure provides a computer-readable storage medium having stored thereon computer-executable instructions that, when executed, are used to implement the interface test method as described above.
Another aspect of the present disclosure provides a computer program product comprising computer executable instructions which, when executed, are for implementing the interface test method as described above.
According to the embodiment of the disclosure, the test template corresponding to the target tested interface service is generated by responding to the selection request of the target tested interface service, wherein the selection request is generated by selecting the target tested interface service at the interface test interface of the client by a user; the method comprises the steps that a test template is sent to a client, so that the client generates a test message for testing a target tested interface service according to the test template; responding to a test request containing a test message, testing a target tested interface service, and generating a serialized test result; and sending the test result to the client so that the client displays the technical means of the test result, wherein the client provides an interface test interface for controlling the test process of the tested interface service, and the tested interface service does not need to be specially loaded, so that the technical problem that the corresponding system environment needs to be loaded during interface test, which results in high interface test engineering cost, is at least partially overcome, and the technical effect of reducing the technical threshold of testers is achieved.
Drawings
The above and other objects, features and advantages of the present disclosure will become more apparent from the following description of embodiments thereof with reference to the accompanying drawings in which:
FIG. 1 schematically illustrates an exemplary system architecture in which an interface test method may be applied according to an embodiment of the present disclosure;
FIG. 2 schematically illustrates a flow chart of an interface testing method applied to a server according to an embodiment of the disclosure;
FIG. 3 schematically illustrates a dependency auxiliary function diagram set for an interface test method in accordance with an embodiment of the present disclosure;
FIG. 4 schematically illustrates a test message dynamic execution diagram for implementing an interface test method according to an embodiment of the disclosure;
FIG. 5 schematically illustrates a flow chart of an interface testing method applied to a client according to an embodiment of the disclosure;
FIG. 6 schematically illustrates a system block diagram for implementing an interface testing method according to an embodiment of the disclosure;
FIG. 7 schematically illustrates a block diagram of an interface testing apparatus applied to a server according to an embodiment of the present disclosure;
FIG. 8 schematically illustrates a block diagram of an interface testing apparatus applied to a client according to an embodiment of the present disclosure; and
fig. 9 schematically illustrates a block diagram of a computer system suitable for implementing an interface test method, in accordance with an embodiment of the present disclosure.
Detailed Description
Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. It should be understood that the description is only exemplary and is not intended to limit the scope of the present disclosure. In the following detailed description, for purposes of explanation, numerous specific details are set forth in order to provide a thorough understanding of the embodiments of the present disclosure. It may be evident, however, that one or more embodiments may be practiced without these specific details. In addition, in the following description, descriptions of well-known structures and techniques are omitted so as not to unnecessarily obscure the concepts of the present disclosure.
The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the disclosure. The terms "comprises," "comprising," and/or the like, as used herein, specify the presence of stated features, steps, operations, and/or components, but do not preclude the presence or addition of one or more other features, steps, operations, or components.
All terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art unless otherwise defined. It should be noted that the terms used herein should be construed to have meanings consistent with the context of the present specification and should not be construed in an idealized or overly formal manner.
Where expressions like at least one of "A, B and C, etc. are used, the expressions should generally be interpreted in accordance with the meaning as commonly understood by those skilled in the art (e.g.," a system having at least one of A, B and C "shall include, but not be limited to, a system having a alone, B alone, C alone, a and B together, a and C together, B and C together, and/or A, B, C together, etc.). Where a formulation similar to at least one of "A, B or C, etc." is used, in general such a formulation should be interpreted in accordance with the ordinary understanding of one skilled in the art (e.g. "a system with at least one of A, B or C" would include but not be limited to systems with a alone, B alone, C alone, a and B together, a and C together, B and C together, and/or A, B, C together, etc.).
With the development of cloud computing in the field of computers, distributed application technologies tend to be mature, applications tend to be miniaturized, and multi-level development is realized.
The inventor finds that in the process of realizing the conception of the present disclosure, the traditional system design is turned to a horizontal service decoupling and vertical layering structure, but from the research and development testing point of view, more manpower is required to be input to carry out multi-level system realization, and multi-level means that a tool level is required to support research and development testing work of different levels. In the aspect of interface test, more layers and more types of interfaces are required to be covered, but in the research and development process of system software, the problem of system dependence is required to be solved for different types of interfaces, the calling functions of different interfaces are realized, the interface test is realized by sequentially completing multiple steps of interface configuration, communication area editing, interface request, result processing and the like, the test engineering realization cost is high, and the technical admission threshold of testers is high.
The inventor also finds that in the process of implementing the disclosed concept, in the research and development process, the software version iterates, different versions of the same interface are required to be solved, and a plurality of implementations of different environments have cost problems in terms of technology and management.
Embodiments of the present disclosure provide an interface testing method, an interface testing apparatus, a computer system, a computer-readable storage medium, and a computer program product. The method can be applied to a server side and comprises the steps of responding to a selection request aiming at a target tested interface service, and generating a test template corresponding to the target tested interface service, wherein the selection request is generated by selecting the target tested interface service for an interface test interface of a client side by a user; the method comprises the steps that a test template is sent to a client, so that the client generates a test message for testing a target tested interface service according to the test template; responding to a test request containing a test message, testing a target tested interface service, and generating a serialized test result; and sending the test result to the client so that the client can display the test result. The method can also be applied to the client, and comprises the following steps: sending a selection request aiming at a target tested interface service to a service end, so that the service end returns a test template corresponding to the target tested interface service according to the selection request, wherein the selection request is generated by a user selecting the target tested interface service at an interface test interface of a client, and the interface test interface comprises at least one tested interface service; generating a test message for testing the target tested interface service according to the test template; sending a test request containing a test message to a server so that the server returns a test result corresponding to the target tested interface service; receiving the test result and displaying the test result on the client
Fig. 1 schematically illustrates an exemplary system architecture 100 in which an interface test method may be applied according to an embodiment of the present disclosure. It should be noted that fig. 1 is only an example of a system architecture to which embodiments of the present disclosure may be applied to assist those skilled in the art in understanding the technical content of the present disclosure, but does not mean that embodiments of the present disclosure may not be used in other devices, systems, environments, or scenarios.
As shown in fig. 1, the system architecture 100 according to this embodiment may include terminal devices 1, 102, 103, a network 104, and a server 105. The network 104 is used as a medium to provide communication links between the terminal devices 101, 102, 103 and the server 105. The network 104 may include various connection types, such as wired and/or wireless communication links, and the like.
The user may interact with the server 105 via the network 104 using the terminal devices 101, 102, 103 to receive or send messages or the like. Various communication client applications, such as shopping class applications, web browser applications, search class applications, instant messaging tools, mailbox clients and/or social platform software, etc., may be installed on the terminal devices 101, 102, 103.
The terminal devices 101, 102, 103 may be a variety of electronic devices having a display screen and supporting web browsing, including but not limited to smartphones, tablets, laptop and desktop computers, and the like.
The server 105 may be a server providing various services, such as a background management server providing support for websites browsed by users using the terminal devices 101, 102, 103. The background management server may analyze and process the received data such as the user request, and feed back the processing result (e.g., the web page, information, or data obtained or generated according to the user request) to the terminal device.
It should be noted that the interface testing method provided by the embodiments of the present disclosure may be generally performed by the server 105. Accordingly, the interface testing apparatus provided by the embodiments of the present disclosure may be generally disposed in the server 105. The interface testing method provided by the embodiments of the present disclosure may also be performed by a server or a server cluster that is different from the server 105 and is capable of communicating with the terminal devices 101, 102, 103 and/or the server 105. Accordingly, the interface testing apparatus provided by the embodiments of the present disclosure may also be provided in a server or a server cluster that is different from the server 105 and is capable of communicating with the terminal devices 101, 102, 103 and/or the server 105. Alternatively, the interface test method provided by the embodiment of the present disclosure may be performed by the terminal device 101, 102, or 103, or may be performed by another terminal device other than the terminal device 101, 102, or 103. Accordingly, the interface testing apparatus provided by the embodiments of the present disclosure may also be provided in the terminal device 101, 102, or 103, or in another terminal device different from the terminal device 101, 102, or 103.
For example, the interface service under test may be originally provided by any one of the terminal devices 101, 102, or 103 (for example, but not limited to, the terminal device 101) or provided by an external storage device imported into the terminal device 101, and then the server 105 may locally perform the interface test method provided by the embodiment of the present disclosure. Alternatively, the interface service under test may be originally provided by the server 105 or may be provided by an external server imported into the server 105, and then any one of the terminal apparatuses 101, 102, or 103 (for example, but not limited to, the terminal apparatus 101) may locally perform the interface test method provided by the embodiment of the present disclosure. Or the tested interface service is sent to other terminal equipment, a server or a server cluster, and the other terminal equipment, the server or the server cluster receiving the tested interface service executes the interface testing method provided by the embodiment of the disclosure.
It should be understood that the number of terminal devices, networks and servers in fig. 1 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
It should be noted that the interface testing method, the interface testing device, the computer system, the computer readable storage medium and the computer program product of the present disclosure may be used in the technical field of computers and the internet of things, and may also be used in any field other than the technical field of computers and the internet of things, and the application fields of the interface testing method, the interface testing device, the computer system, the computer readable storage medium and the computer program product of the present disclosure are not limited.
Fig. 2 schematically illustrates a flowchart of an interface testing method applied to a server according to an embodiment of the present disclosure.
As shown in fig. 2, the method includes operations S201 to S204.
In operation S201, a test template corresponding to a target tested interface service is generated in response to a selection request for the target tested interface service, wherein the selection request is generated for a user to select the target tested interface service at an interface test interface of a client.
According to the embodiment of the disclosure, the tested interface service may be implemented according to a tested system, for example, the tested system may be used for constructing a server, and the tested interface service may be constructed by packaging each tested interface in the tested system into different testing service nodes according to different types and versions, for example. The test service nodes can be deployed with minimum service granularity, for example, different types of tested interfaces can be combined to synthesize one tested interface service in consideration of the implementation cost, but the iteration versions of the combined tested interfaces are required to be ensured to be consistent, version conflict is avoided, and at the same time, each test service node can inherit the basic service of the corresponding tested system, such as service registration, service response module and the like. The client is used for providing an integrated user interface (i.e. the interface test interface) for a developer, for example, all test service nodes obtained by packaging at the server can be displayed in the interface test interface in the form of a measurable service list, and the target tested interface service can be, for example, a test service node selected by a user. The selection request may include a url portion and a message portion, where the url portion is used to determine the target tested interface service, and the data of the message portion may be default data or null data, and the initial field value of the obtained test template may be a default value or a null value, for example.
In operation S202, the test template is sent to the client, so that the client generates a test message for testing the target tested interface service according to the test template.
According to the embodiment of the disclosure, after receiving the test template, the client can edit data on the basis of the test template, for example, manually by a tester, such as modifying an initial field value in the template to a test value with practical meaning, so that a test message for testing the target tested interface service can be generated according to the modified data.
In operation S203, in response to the test request including the test message, the target tested interface service is tested, and a serialized test result is generated.
According to an embodiment of the present disclosure, the test request may include, for example, a url (link) portion and a message portion (i.e., the test message), where the url portion includes, for example, service attribute related information that may be used to determine the target tested interface service, and the message portion may include, for example, service related information that may be used to provide test data for the target tested interface service.
In operation S204, the test result is sent to the client so that the client presents the test result.
According to the embodiment of the disclosure, the test result obtained after the test is performed in response to the test request may be displayed on the client, for example, so that a tester can intuitively observe the test result.
According to the embodiment of the disclosure, the client provides the interface test interface for controlling the test process of the tested interface service, the tested interface service can be obtained by directly packaging the service end, meanwhile, the system environment of the service can be directly utilized, a complex additional loading process is not needed, the technical problem of high interface test engineering cost caused by loading the corresponding system environment during interface test is solved, and the technical threshold of testers is reduced.
The method shown in fig. 2 is further described below with reference to specific examples and with reference to the accompanying drawings.
According to an embodiment of the present disclosure, the above operation S201 may include operations S201-1 to S201-3, for example.
In operation S201-1, registration information of a target tested interface service registered in a test service registration center is determined according to a selection request, wherein the registration information includes attribute information of the target tested interface service and an input class method for performing information processing.
According to an embodiment of the present disclosure, the test service registry may be configured to provide a registration service for the test service node, and when a tester needs to request to access one or some test service nodes (e.g. the target tested interface service), the test service node may be first found from a service end by a routing manner, and then registered in the test service registry. The registration information may include, for example, service node information, service ID, interface name, request version, request path, communication area information, request parameter, etc. (i.e., the attribute information described above), so as to ensure the uniqueness of the tested interface service. The client can find all the measurable services through the test service registry, for example, and display the related information of all the measurable interface services in the interface test interface in the form of a measurable service list for reference and selection by testers.
According to an embodiment of the present disclosure, for example, by defining service registration information at a client, determining a test service node that needs to request access, and after finding a corresponding test service node from the server, completing registration with data in JSON format, where JSON data may be represented, for example, as follows:
the values corresponding to fields such as id, name, interface, method and version may constitute the attribute information, and the values corresponding to input fields may constitute the input class method.
In operation S201-2, attribute information is processed using an input class method, generating an input class instance.
According to an embodiment of the present disclosure, the above-described input class method may be expressed, for example, in the form of:
in operation S201-3, the input class instance is serialized to obtain a test template.
The input class instance (or communication zone class instance) described above may be used, for example, to generate a test template according to embodiments of the present disclosure. Specifically, by serializing an input class instance and extracting annotation information using java doc API in combination with source code (e.g., the input class method described above), a request message Wen Moban (i.e., the test template described above) can be generated in the form of:
Note that, the native JSON does not support the annotation format, and when the background service processes the message, the annotation content needs to be removed and restored to the valid JSON message data.
According to an embodiment of the present disclosure, the above operation S203 may include operations S203-1 to S203-4, for example.
In operation S203-1, registration information of a target tested interface service registered in a test service registration center is acquired, wherein the registration center includes an output class method for performing information processing.
According to an embodiment of the present disclosure, the above-described output class method may be expressed, for example, in the form of:
in operation S201-2, return information obtained by the target tested interface service after the test is performed in response to the test request is acquired.
According to an embodiment of the present disclosure, the return format of the target tested interface service may be JSON format data, and the return packet (i.e. the return information) is { "result1": true, "result2": "transaction successful", "request 3":10000}.
In operation S201-3, the return information is deserialized by using the output class method, and an output class instance is obtained.
In operation S201-4, the output class instance is subjected to serialization processing to obtain a test result.
According to the embodiment of the disclosure, the message return format has no supplementary information and is poor in readability for researchers. In order to solve this problem, for example, according to the information of the returned message and the output class method, an output class instance is obtained by performing inverse serialization processing, and the output class instance is further processed by performing serialization processing, and field annotation information is extracted by combining with JAVA DOC API, so as to finally obtain a test result in the following form, for example:
through the embodiment of the disclosure, a plurality of tested system test service nodes are built, and the test service nodes are registered in the test service registration center, so that the registered test service nodes in the registration center can be derived from the tested system and can be isolated from the tested system, namely, on the basis of inheriting basic services of the tested system, the mutual conflict with built-in registration services of the tested system can be avoided, the problem of test service erection of the plurality of tested systems is solved, and the technical problem that multi-level test of the tested system is difficult to realize can be effectively shielded. Meanwhile, a detectable service list is displayed to research and development personnel through an interface test interface of the client, discoverability of the test service node is improved, generation of a test template is achieved through binding with source codes, annotation information of the source codes is injected, testability of the test service node is improved, and correlation of the testable service node is displayed to the research and development personnel more transparently.
In accordance with embodiments of the present disclosure, to further optimize test efficiency, a system dependency auxiliary function may be introduced, for example. Based on this, the above interface test method may further include, for example: acquiring auxiliary tools aiming at a target tested interface service and tested system configuration related to the target tested interface service; and registering the attribute information of the auxiliary tool to the test service registry.
Fig. 3 schematically illustrates a correlation-assist function diagram set for an interface test method according to an embodiment of the present disclosure.
According to an embodiment of the disclosure, referring to fig. 3, the correlation auxiliary function set for the tested system related to the tested interface service may be implemented, for example, by a test server, and may be customized according to the type of the tested system, where the test server services the monitoring module and registers the monitoring service to a registry, and the client may discover the monitoring service and collect the monitoring data through the registry. In this embodiment, taking a distributed system as an example, for example, the following services can be implemented:
a) Log monitoring, collecting log information of a tested system in real time, and providing functions of monitoring, filtering, sampling, abnormality screening and the like.
b) And monitoring the service state of the tested system.
c) And the heartbeat service is used for monitoring the heartbeat service of the tested system.
d) Interface availability monitoring, monitoring service status of interface granularity, service availability, interface version, etc.
e) And (3) caching data, and realizing the conventional operation of availability monitoring, adding, deleting and modifying the cache.
f) And the system configuration and the like, related functions such as a configuration center and the like are commonly used in the distributed system, the test service and the tested system realize isomorphism, the same research and development framework, the system configuration and the like are used, the test service is set as a sensitive service, and the research and development personnel can more efficiently sense the running state of the tested system.
According to the embodiment of the disclosure, in order to further improve the testability of the test service, for example, a dynamic analysis function of the test message can be introduced, and the transition of the test message from the static text to the dynamic text is realized by constructing a set of dynamic script analysis execution mechanism. Based on this, the above interface test method may further include, for example: obtaining a test script with a preset format from a client, wherein the test script comprises a parameter value setting script, a message generating script and a result processing script; determining a parameter value for testing the target tested interface service according to the parameter value setting script; generating a test message with parameter values which is matched with the test template according to the message generation script; and processing the test result according to the result processing script.
According to the embodiment of the disclosure, since the system data is continuously changed in the development process, in order to ensure the executable performance of the static message, dynamic logic processing needs to be performed on the message, such as a system date field in the message, a state of test data, a dictionary of parameters and the like, and meanwhile, the test data needs to be adjusted to different test cases and test scenes in the test process of the tested system. Therefore, a set of custom literal expression analysis functions are needed to be designed and realized, and the functions of dynamic generation, logic calculation, database operation and the like of the message are realized. The dynamic parsing of test messages is further described below in connection with specific embodiments.
In order to implement the above-mentioned series of operations of the test script having the preset format, for example, it is necessary to first define a message segmentation format and parse syntax according to the embodiment of the present disclosure.
According to an embodiment of the present disclosure, the defining manner for the packet segmentation format may be expressed as: the method is divided into pre-execution analysis execution, request message template and post-execution analysis execution according to execution steps, and is marked by script segmentation labels// script,// before,// template and// after. Wherein the tag// script may, for example, represent a rule that the segment script uses the message segmentation format defined herein; the tag// before may, for example, represent a corresponding script for parameter value setting script, e.g., for parsing execution prior to execution (e.g., prior to generating a test message); the label// template may, for example, represent a corresponding script for generating a script for a message, where the corresponding script is used, for example, to request a message template, and by executing the portion of script, for example, a test message may be dynamically generated, and after the test message is generated, an interface request may be initiated (for example, an operation requiring an interface to be requested in the test request); the tag// after may, for example, represent a corresponding script that is used, for example, to parse execution after execution (e.g., after the system under test returns test results in response to a test request) for result processing scripts.
According to an embodiment of the present disclosure, the parsing syntax may be defined using, for example, a word surface amount expression, and a specific definition rule may be expressed, for example:
a) After the message is split according to the message segmentation format, each segment is analyzed and executed according to the line.
b) Using $ [ type. Operation ] { operation, parameter, }, define basic expression form, where $ is expression head, left and right curly brackets { } is beginning and ending symbol, where type, operation are noun-verb combination, type is defined as a group of identical objects, verb is an operation of the object, and parameter is indefinite length parameter.
c) During text analysis, the minimal units of the regular expression are used for identification, matching of all units is completed recursively, and a matching model is (? ) \ $ ([ ζ \ $ { } ] {0, } | \? ) \ { ([ +\ $ { } ] {0, }) \ } (.
d) The parameter part adopts Comma Separated Values (CSV) to decompose, parameter Values are obtained according to positions, literal expressions can be nested in the parameter Values, analysis is carried out according to a use-analysis-as-a-time mode, and analysis is not carried out when the parameter is not used.
e) The expression return type is defined as String, boolean, number, null Empty, mixed.
f) And logically judging, and introducing a Javascript execution engine to perform expression logic calculation processing, such as an expression $assuredly { assuredly, wherein the assertion is established, 1 is more than 0}, and the 1 is more than 0 logic expression uses the Javascript engine to execute result processing.
g) And inputting a plurality of lines of data as parameters by using the < coincidence start and the > coincidence end when the plurality of lines of input exist in the text.
h) Defining various internal objects to implement common functions:
variable, variable.
General expression 1, acquisition variable: variable { get, variable, [ default ] }.
General expression 2, set variable: variable { set, variable, value }.
Environment, environment defined by module granularity.
General expression 1, binding environment: environment { bind, environment name }.
General expression 2, setting environment: environment { set, environment name, field name 1, value 1, }.
Setting, system setting.
General expression 1, acquisition variable: setting { get, field, [ default ] }.
General expression 2, set variable: set { set, field, value }.
Asserts, declaring whether the correlation value is consistent with the expected value in the execution process of the assertion.
Common expression 1, assertion equal: asserted { equivalents, desc, expect, actual }.
General expression 2, assertion calculation: asserted { command, desc, command line }.
Http, http protocol request.
General expression 1, POST mode request: http { post, url, content, charset }.
General expression 2, GET mode request: http { get, url }.
Database operation, database operation requires selected environment, and in configuration, environment loading is performed first, and references are made by name.
Common expression 1, $DataBase { SQL, environment name, < >
select*from sometable where limit 10;
update sometable set field1=$Variable{get,field1}where field2=$Variable{get,field2};
>>>}。
JSON data parsing.
General expression 1, parsing and setting JSON string key values as variables:
$JSON{fetch2Variable,$Variable{get,somejsonstring}}。
commonly used expression 2, key value acquisition field value in JOSN:
$JSON{fetch,fieldName,$Variable{get,somejsonstring}}。
fig. 4 schematically illustrates a test packet dynamic execution diagram for implementing an interface test method according to an embodiment of the disclosure.
According to an embodiment of the present disclosure, as shown in fig. 4, the rule of the message segmentation format including the labels// before,// template,// after, etc. described above is introduced using the// script segmentation label.
According to an embodiment of the present disclosure, as shown in fig. 4, using the// before script fragment tag, for example, pre-execution script (i.e., the above-described parameter value setting script) text content may be acquired. Each literal expression is identified by line by using a script grammar parser, expression parsing is completed by using an expression execution engine, internal objects are created, variable contents defined in the expressions are stored, and thus operations such as upper and lower information definition of a script, data (such as the above parameter values) preparation and the like are completed.
According to an embodiment of the present disclosure, as shown in fig. 4, using// template script segment labels, for example, the content of a message template (i.e., the above-described message generation script) may be obtained, where the numeric portion of the template is defined by a $ { variable name } expression. By using the message assembler, the numerical format of the replaceable part defined in the message template content is identified according to the line, and the strain value (such as the parameter value) is obtained and replaced in the context until no replaceable format exists, so that the requestable message content (namely the test message) can be finally obtained. By acquiring service configuration information, acquiring test service node information at a test service registry, a request instance may be created and a test request initiated. In response to the test request, the request response information can be obtained, and the storage unit can be created to store the text result of the message.
According to an embodiment of the disclosure, as shown in fig. 4, for example, a request result may be first subjected to request assertion, and an exception return may be identified, for example, if the request fails to throw out exception processing, the assertion result is that a transaction fails, and a normal return request is further subjected to processing, for example, data query, data printing, and data comparison peer processing operations may be performed. In this embodiment, the// after script segmentation tag is used, for example, text content of the script after execution (i.e., the result processing script) can be obtained, a script grammar parser is used to identify each literal expression by line, and an expression execution engine is used to complete expression parsing. The general processing flow may be represented, for example, by processing a message result, e.g., converting a message whose returned result is a JSON literal into a JSON object, extracting a message field, and respectively performing validity assertion on a result field and a service field. Printing and displaying objects such as a list in the result, counting background data, and asserting the expected result.
By the above embodiments of the present disclosure, a set of dynamic scenario execution schemes is provided, and case design execution may go excessively from static to dynamic. Through dynamic script, can make the script more self-adaptation carry out, need not too much manual intervention in the test execution of many rounds, dynamic script also can more express tester's test intention to solidify a plurality of verification points, thereby very big promotion research and development efficiency of test.
Fig. 5 schematically illustrates a flowchart of an interface testing method applied to a client according to an embodiment of the present disclosure.
As shown in fig. 5, the method includes operations S501 to S504.
In operation S501, a selection request for a target tested interface service is sent to a server, so that the server returns a test template corresponding to the target tested interface service according to the selection request, where the selection request is generated by selecting the target tested interface service from an interface test interface of a client by a user, and the interface test interface includes at least one tested interface service.
In operation S502, a test message for testing a target tested interface service is generated according to a test template.
In operation S503, a test request including a test message is sent to the server, so that the server returns a test result corresponding to the target tested interface service.
In operation S504, the test result is received and presented to the client.
According to the embodiment of the disclosure, the client provides the interface test interface for controlling the test process of the tested interface service, the tested interface service can be obtained by directly packaging the service end, meanwhile, the system environment of the service can be directly utilized, a complex additional loading process is not needed, the technical problem of high interface test engineering cost caused by loading the corresponding system environment during interface test is solved, and the technical threshold of testers is reduced.
According to an embodiment of the present disclosure, the above-mentioned interface testing method applied to a client may further include: acquiring auxiliary information monitored by auxiliary tools aiming at a target tested interface service and tested system configuration related to the target tested interface service; and displaying the auxiliary information on the client.
According to an embodiment of the present disclosure, the above-mentioned interface testing method applied to a client may further include: obtaining a test script with a preset format from a client, wherein the test script comprises a parameter value setting script, a message generating script and a result processing script; determining a parameter value for testing the target tested interface service according to the parameter value setting script; generating a test message with parameter values which is matched with the test template according to the message generation script; and processing the test result according to the result processing script.
It should be noted that, in the embodiment of the present disclosure, the portion of the interface test method applied to the client corresponds to the portion of the interface test method applied to the server in the embodiment of the present disclosure, and the description of the portion of the interface test method applied to the client may refer to the portion of the interface test method applied to the server specifically, which is not described herein again.
The method illustrated in fig. 2 and 3 is further described below with reference to fig. 6 in conjunction with the exemplary embodiment.
Fig. 6 schematically illustrates a system architecture diagram for implementing an interface testing method according to an embodiment of the present disclosure.
As shown in fig. 6, the system is implemented by adopting a BS (Browser/Server) structure, and includes a B-end (client) and an S-end (Server), where the B-end can provide a unified interface test interface for a tester and exhibit interface attribute information, a message template, a request path, and the like, and can provide tested system information including system application information, interface service information, auxiliary information, and the like, and the S-end can implement various types of interface calling component modules, and the component extends laterally and can provide test service nodes corresponding to each tested system in an independent service mode. The service end may be implemented by a service component, for example, including a test service registry, a test service route, an interface service node, and the like.
According to the embodiment of the disclosure, the client can acquire a test service list through the test service registration center, edit the communication area information after the client selects the test interface, initiate a request after requesting parameters, and the test service route can follow up the service information, route to the test service node and complete the service request through the test service node.
According to the embodiment of the disclosure, in the case that the tested system is an API system, the test service node may, for example, implement an API interface call, complete SDK loading of the API interface, identify a testable service, and register the testable service to a test service registry. In the case that the tested system is an http system, the test service node may implement an http protocol request, for example, to register the measurable service in a test service registry. Taking a Dubbo open source distributed system as an example, the test service node can be simulated into a consumer role, and register information of the test service node into a test service registry.
According to the embodiment of the disclosure, since the iteration period is shorter in the project development mode of agile development, a set of system may have multiple iteration versions coexisting, and as shown in fig. 6, for example, multiple versions of service can be realized through longitudinal expansion, and different versions of test service nodes are respectively registered in a registry, so that the isomerism of a tested system, such as the difference between different interface services in the tested system, is shielded, a unified test entry is obtained through packaging, and the test cost of research and development personnel can be effectively reduced.
Through the embodiment of the disclosure, a set of interface test service models is defined, and test service nodes with different types and versions can be integrated, so that the mutual influence of different interface types, research and development environments and research and development versions is reduced, and the dependence conflicts and the like are solved. Meanwhile, the cost of simulating system call realization in the interface test process is saved, and the technical threshold of testers is reduced.
According to an embodiment of the present disclosure, for the system shown in fig. 6, in response to a test request, for example, it may be agreed that input and output messages of a test service node all adopt JSON data format. Taking a tested system realized by JAVA as an example, the tested interface service generally includes interface identification, interface name, calling method, input class, output class and other related information, extracting annotation information by using the input and output class in combination with test engineering source codes and using JAVA DOC API technology, and realizing generation of an input message template with a format and presentation of an output message by JAVA object serialization and anti-serialization operation, thus presenting complete interface test information to researchers and improving the testability of the system. Meanwhile, by converting JAVA into a JSON format to construct a test message, the pressure of the system is reduced, and the test cost can be further reduced.
Through the embodiment of the disclosure, a multifunctional interface testing method is realized and is used as a reuse support of a software research and development team in research and development work. In the agile development mode, the project generally needs to complete project development and delivery work through multiple iteration cycles, one team or multiple systems are simultaneously being manufactured, multiple applications and multiple types of interfaces are adopted, along with the increase of the complexity of an application system, the development project faces human resource risks, development technical risks, and benign development of the development team can be effectively supported by building the interface test service which is high in expansibility, good in maintainability, convenient and easy to use.
Fig. 7 schematically illustrates a block diagram of an interface testing apparatus applied to a server according to an embodiment of the present disclosure.
As shown in fig. 7, the interface test apparatus 700 includes a first generating module 710, a first transmitting module 720, a second generating module 730, and a second transmitting module 740.
The first generating module 710 is configured to generate a test template corresponding to a target tested interface service in response to a selection request for the target tested interface service, where the selection request is generated by a user selecting the target tested interface service at an interface test interface of the client.
The first sending module 720 is configured to send the test template to the client, so that the client generates a test packet for testing the target tested interface service according to the test template.
The second generating module 730 is configured to test the target tested interface service in response to the test request including the test message, and generate a serialized test result.
The second sending module 740 is configured to send the test result to the client, so that the client reveals the test result.
According to the embodiment of the disclosure, the client provides the interface test interface for controlling the test process of the tested interface service, the tested interface service can be obtained by directly packaging the service end, meanwhile, the system environment of the service can be directly utilized, a complex additional loading process is not needed, the technical problem of high interface test engineering cost caused by loading the corresponding system environment during interface test is solved, and the technical threshold of testers is reduced.
According to an embodiment of the present disclosure, the first generating module includes a determining unit, a first processing unit, and a second processing unit.
And the determining unit is used for determining the registration information of the target tested interface service registered in the test service registration center according to the selection request, wherein the registration information comprises attribute information of the target tested interface service and an input class method for information processing.
And the first processing unit is used for processing the attribute information by using an input class method and generating an input class instance.
And the second processing unit is used for carrying out serialization processing on the input class examples to obtain the test template.
According to an embodiment of the present disclosure, the second generating module includes a first acquiring unit, a second acquiring unit, a third processing unit, and a fourth processing unit.
And the first acquisition unit is used for acquiring registration information of the target tested interface service registered in the test service registration center, wherein the registration center comprises an output class method for information processing.
And the second acquisition unit is used for acquiring the return information obtained by testing the target tested interface service after responding to the test request.
And the third processing unit is used for performing deserialization processing on the returned information by using an output class method to obtain an output class instance.
And the fourth processing unit is used for carrying out serialization processing on the output class examples to obtain a test result.
According to an embodiment of the present disclosure, the interface test apparatus 700 further includes a first obtaining module and a registering module.
And the first acquisition module is used for acquiring auxiliary tools aiming at the target tested interface service and tested system configuration related to the target tested interface service.
And the registration module is used for registering the attribute information of the auxiliary tool to the test service registration center.
According to an embodiment of the present disclosure, the interface testing apparatus 700 further includes a second obtaining module, a first determining module, a third generating module, and a first processing module.
The second acquisition module is used for acquiring the test script with the preset format from the client, wherein the test script comprises a parameter value setting script, a message generating script and a result processing script.
And the first determining module is used for determining the parameter value for testing the target tested interface service according to the parameter value setting script.
And the third generation module is used for generating a test message with parameter values which is matched with the test template according to the message generation script.
And the first processing module is used for processing the test result according to the result processing script.
Fig. 8 schematically illustrates a block diagram of an interface testing apparatus applied to a client according to an embodiment of the present disclosure.
As shown in fig. 8, the interface test apparatus 800 includes a third transmitting module 810, a fourth generating module 820, a fourth transmitting module 830, and a first displaying module 840.
And the third sending module 810 is configured to send a selection request for the target tested interface service to the server, so that the server returns a test template corresponding to the target tested interface service according to the selection request, where the selection request is generated by selecting the target tested interface service at an interface test interface of the client by a user, and the interface test interface includes at least one tested interface service.
The fourth generating module 820 is configured to generate a test packet for testing the target tested interface service according to the test template.
The fourth sending module 830 is configured to send a test request including a test packet to the server, so that the server returns a test result corresponding to the target tested interface service.
The first display module 840 is configured to receive the test result and display the test result on the client.
According to the embodiment of the disclosure, the client provides the interface test interface for controlling the test process of the tested interface service, the tested interface service can be obtained by directly packaging the service end, meanwhile, the system environment of the service can be directly utilized, a complex additional loading process is not needed, the technical problem of high interface test engineering cost caused by loading the corresponding system environment during interface test is solved, and the technical threshold of testers is reduced.
According to an embodiment of the present disclosure, the interface testing apparatus 800 further includes a third obtaining module and a second display module.
And the third acquisition module is used for acquiring auxiliary information monitored by auxiliary tools aiming at the target tested interface service and tested system configuration related to the target tested interface service.
And the second display module is used for displaying the auxiliary information on the client.
According to an embodiment of the present disclosure, the interface testing apparatus 800 further includes a fourth obtaining module, a second determining module, a fifth generating module, and a second processing module.
The fourth acquisition module is used for acquiring the test script with the preset format from the client, wherein the test script comprises a parameter value setting script, a message generating script and a result processing script.
And the second determining module is used for determining the parameter value for testing the target tested interface service according to the parameter value setting script.
And the fifth generation module is used for generating the test message with the parameter value matched with the test template according to the message generation script.
And the second processing module is used for processing the test result according to the result processing script.
Any number of the modules, units, or at least some of the functionality of any number of the modules, units, or units according to embodiments of the present disclosure may be implemented in one module. Any one or more of the modules, units according to embodiments of the present disclosure may be implemented as split into multiple modules. Any one or more of the modules, units according to embodiments of the present disclosure may be implemented at least in part as a hardware circuit, such as a Field Programmable Gate Array (FPGA), a Programmable Logic Array (PLA), a system on a chip, a system on a substrate, a system on a package, an Application Specific Integrated Circuit (ASIC), or in hardware or firmware in any other reasonable manner of integrating or packaging the circuits, or in any one of or in any suitable combination of three of software, hardware, and firmware. Alternatively, one or more of the modules, units according to embodiments of the disclosure may be at least partially implemented as computer program modules, which when executed, may perform the corresponding functions.
For example, any of the first generating module 710, the first transmitting module 720, the second generating module 730, and the second transmitting module 740, or the third transmitting module 810, the fourth generating module 820, the fourth transmitting module 830, and the first exposing module 840 may be combined in one module/unit to be implemented, or any one of the modules/units may be split into a plurality of modules/units. Alternatively, at least some of the functionality of one or more of the modules/units may be combined with at least some of the functionality of other modules/units and implemented in one module/unit. According to embodiments of the present disclosure, at least one of the first generation module 710, the first transmission module 720, the second generation module 730, and the second transmission module 740, or the third transmission module 810, the fourth generation module 820, the fourth transmission module 830, and the first presentation module 840 may be implemented at least in part as hardware circuitry, such as a Field Programmable Gate Array (FPGA), a Programmable Logic Array (PLA), a system on a chip, a system on a substrate, a system on a package, an Application Specific Integrated Circuit (ASIC), or may be implemented in hardware or firmware in any other reasonable manner of integrating or packaging circuitry, or in any one of or a suitable combination of three of software, hardware, and firmware. Alternatively, at least one of the first generating module 710, the first transmitting module 720, the second generating module 730, and the second transmitting module 740, or the third transmitting module 810, the fourth generating module 820, the fourth transmitting module 830, and the first presentation module 840 may be at least partially implemented as computer program modules, which when executed, may perform the respective functions.
It should be noted that, in the embodiment of the present disclosure, the interface test device portion corresponds to the interface test method portion in the embodiment of the present disclosure, and the description of the interface test device portion specifically refers to the interface test method portion, which is not described herein again.
Fig. 9 schematically illustrates a block diagram of a computer system suitable for implementing an interface test method, in accordance with an embodiment of the present disclosure. The computer system illustrated in fig. 9 is merely an example, and should not be construed as limiting the functionality and scope of use of the embodiments of the present disclosure.
As shown in fig. 9, a computer system 900 according to an embodiment of the present disclosure includes a processor 901, which can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM) 902 or a program loaded from a storage portion 908 into a Random Access Memory (RAM) 903. The processor 901 may include, for example, a general purpose microprocessor (e.g., a CPU), an instruction set processor and/or an associated chipset and/or a special purpose microprocessor (e.g., an Application Specific Integrated Circuit (ASIC)), or the like. Processor 901 may also include on-board memory for caching purposes. Processor 901 may include a single processing unit or multiple processing units for performing the different actions of the method flows according to embodiments of the present disclosure.
In the RAM 903, various programs and data necessary for the operation of the system 900 are stored. The processor 901, the ROM 902, and the RAM 903 are connected to each other by a bus 904. The processor 901 performs various operations of the method flow according to the embodiments of the present disclosure by executing programs in the ROM 902 and/or the RAM 903. Note that the program may be stored in one or more memories other than the ROM 902 and the RAM 903. The processor 901 may also perform various operations of the method flow according to embodiments of the present disclosure by executing programs stored in the one or more memories.
According to an embodiment of the disclosure, the system 900 may also include an input/output (I/O) interface 905, the input/output (I/O) interface 905 also being connected to the bus 904. The system 900 may also include one or more of the following components connected to the I/O interface 905: an input section 906 including a keyboard, a mouse, and the like; an output portion 907 including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and a speaker; a storage portion 908 including a hard disk or the like; and a communication section 909 including a network interface card such as a LAN card, a modem, or the like. The communication section 909 performs communication processing via a network such as the internet. The drive 910 is also connected to the I/O interface 905 as needed. A removable medium 911 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is installed as needed on the drive 910 so that a computer program read out therefrom is installed into the storage section 908 as needed.
According to embodiments of the present disclosure, the method flow according to embodiments of the present disclosure may be implemented as a computer software program. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable storage medium, the computer program comprising program code for performing the method shown in the flowcharts. In such an embodiment, the computer program may be downloaded and installed from the network via the communication portion 909 and/or installed from the removable medium 911. The above-described functions defined in the system of the embodiments of the present disclosure are performed when the computer program is executed by the processor 901. The systems, devices, apparatus, modules, units, etc. described above may be implemented by computer program modules according to embodiments of the disclosure.
The present disclosure also provides a computer-readable storage medium that may be embodied in the apparatus/device/system described in the above embodiments; or may exist alone without being assembled into the apparatus/device/system. The computer-readable storage medium carries one or more programs which, when executed, implement methods in accordance with embodiments of the present disclosure.
According to embodiments of the present disclosure, the computer-readable storage medium may be a non-volatile computer-readable storage medium. Examples may include, but are not limited to: a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this disclosure, 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.
For example, according to embodiments of the present disclosure, the computer-readable storage medium may include ROM 902 and/or RAM 903 and/or one or more memories other than ROM 902 and RAM 903 described above.
Embodiments of the present disclosure also include a computer program product comprising a computer program comprising program code for performing the methods provided by the embodiments of the present disclosure, when the computer program product is run on an electronic device, for causing the electronic device to implement the interface testing methods provided by the embodiments of the present disclosure.
The above-described functions defined in the system/apparatus of the embodiments of the present disclosure are performed when the computer program is executed by the processor 901. The systems, apparatus, modules, units, etc. described above may be implemented by computer program modules according to embodiments of the disclosure.
In one embodiment, the computer program may be based on a tangible storage medium such as an optical storage device, a magnetic storage device, or the like. In another embodiment, the computer program may also be transmitted, distributed, and downloaded and installed in the form of a signal on a network medium, via communication portion 909, and/or installed from removable medium 911. The computer program may include program code that may be transmitted using any appropriate network medium, including but not limited to: wireless, wired, etc., or any suitable combination of the foregoing.
According to embodiments of the present disclosure, program code for performing computer programs provided by embodiments of the present disclosure may be written in any combination of one or more programming languages, and in particular, such computer programs may be implemented in high-level procedural and/or object-oriented programming languages, and/or assembly/machine languages. Programming languages include, but are not limited to, such as Java, c++, python, "C" or similar programming languages. The program code may execute entirely on the user's computing device, partly on the user's device, partly on a remote computing device, or entirely on the remote computing device or server. In the case of remote computing devices, the remote computing device may be connected to the user computing device through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computing device (e.g., connected via the Internet using an Internet service provider).
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions. Those skilled in the art will appreciate that the features recited in the various embodiments of the disclosure and/or in the claims may be combined in various combinations and/or combinations, even if such combinations or combinations are not explicitly recited in the disclosure. In particular, the features recited in the various embodiments of the present disclosure and/or the claims may be variously combined and/or combined without departing from the spirit and teachings of the present disclosure. All such combinations and/or combinations fall within the scope of the present disclosure.
The embodiments of the present disclosure are described above. However, these examples are for illustrative purposes only and are not intended to limit the scope of the present disclosure. Although the embodiments are described above separately, this does not mean that the measures in the embodiments cannot be used advantageously in combination. The scope of the disclosure is defined by the appended claims and equivalents thereof. Various alternatives and modifications can be made by those skilled in the art without departing from the scope of the disclosure, and such alternatives and modifications are intended to fall within the scope of the disclosure.

Claims (10)

1. An interface testing method, comprising:
generating a test template corresponding to a target tested interface service in response to a selection request for the target tested interface service, including:
determining registration information of the target tested interface service registered in a test service registration center according to the selection request, wherein the registration information comprises attribute information of the target tested interface service, and an input class method and an output class method for information processing;
processing the attribute information by using the input class method to generate an input class instance;
carrying out serialization processing on the input class instance to obtain the test template, wherein the selection request is generated by a user selecting the target tested interface service at an interface test interface of a client;
The test template is sent to the client so that the client generates a test message for testing the target tested interface service according to the test template;
responding to the test request containing the test message, testing the target tested interface service, and generating a serialized test result, wherein the method comprises the following steps:
acquiring return information obtained by testing the target tested interface service after responding to the test request;
performing deserialization processing on the returned information by using the output class method to obtain an output class instance;
carrying out serialization processing on the output class examples to obtain the test result; and
and sending the test result to the client so that the client can display the test result.
2. The method of claim 1, further comprising:
acquiring auxiliary tools aiming at the target tested interface service and tested system configuration related to the target tested interface service; and
and registering the attribute information of the auxiliary tool to a test service registration center.
3. The method of claim 1, further comprising:
obtaining a test script with a preset format from a client, wherein the test script comprises a parameter value setting script, a message generating script and a result processing script;
Determining a parameter value for testing the target tested interface service according to the parameter value setting script;
generating the test message with the parameter value matched with the test template according to the message generation script; and
and processing the test result according to the result processing script.
4. An interface testing method, comprising:
sending a selection request for a target tested interface service to a service end, so that the service end returns a test template corresponding to the target tested interface service according to the selection request, and the method comprises the following steps: determining registration information of the target tested interface service registered in a test service registration center according to the selection request, wherein the registration information comprises attribute information of the target tested interface service, and an input class method and an output class method for information processing; processing the attribute information by using the input class method to generate an input class instance; the input class examples are subjected to serialization processing to obtain the test template, wherein the selection request is generated by a user selecting the target tested interface service on an interface test interface of a client, and the interface test interface comprises at least one tested interface service;
Generating a test message for testing the target tested interface service according to the test template;
sending a test request containing the test message to the server so that the server returns a test result corresponding to the target tested interface service, including: acquiring return information obtained by testing the target tested interface service after responding to the test request; performing deserialization processing on the returned information by using the output class method to obtain an output class instance; carrying out serialization processing on the output class examples to obtain the test result; and
and receiving the test result and displaying the test result on the client.
5. The method of claim 4, further comprising:
acquiring auxiliary information monitored by auxiliary tools aiming at the target tested interface service and tested system configuration related to the target tested interface service; and
and displaying the auxiliary information on the client.
6. The method of claim 4, further comprising:
obtaining a test script with a preset format from a client, wherein the test script comprises a parameter value setting script, a message generating script and a result processing script;
Determining a parameter value for testing the target tested interface service according to the parameter value setting script;
generating the test message with the parameter value matched with the test template according to the message generation script; and
and processing the test result according to the result processing script.
7. An interface testing apparatus, comprising:
a first generation module, configured to generate a test template corresponding to a target tested interface service in response to a selection request for the target tested interface service, where the selection request is generated by a user selecting the target tested interface service at an interface test interface of a client, and the first generation module includes:
a determining unit, configured to determine, according to the selection request, registration information of the target tested interface service registered in a test service registry, where the registration information includes attribute information of the target tested interface service and an input class method for performing information processing;
the first processing unit is used for processing the attribute information by using the input class method to generate an input class instance;
the second processing unit is used for carrying out serialization processing on the input class examples to obtain the test template;
The first sending module is used for sending the test template to the client so that the client generates a test message for testing the target tested interface service according to the test template;
the second generating module is configured to test the target tested interface service in response to a test request including the test packet, and generate a serialized test result, where the registration information further includes an output class method for performing information processing, and the second generating module includes:
the second acquisition unit is used for acquiring return information obtained by testing the target tested interface service after responding to the test request;
the third processing unit is used for performing deserialization processing on the returned information by using the output class method to obtain an output class instance;
the fourth processing unit is used for carrying out serialization processing on the output class examples to obtain the test result; and
and the second sending module is used for sending the test result to the client so that the client can display the test result.
8. An interface testing apparatus, comprising:
the third sending module is configured to send a selection request for a target tested interface service to a server, so that the server returns a test template corresponding to the target tested interface service according to the selection request, and the third sending module includes: determining registration information of the target tested interface service registered in a test service registration center according to the selection request, wherein the registration information comprises attribute information of the target tested interface service, and an input class method and an output class method for information processing; processing the attribute information by using the input class method to generate an input class instance; the input class examples are subjected to serialization processing to obtain the test template, wherein the selection request is generated by a user selecting the target tested interface service on an interface test interface of a client, and the interface test interface comprises at least one tested interface service;
A fourth generating module, configured to generate a test packet for testing the target tested interface service according to the test template;
the fourth sending module is configured to send a test request including the test packet to the server, so that the server returns a test result corresponding to the target tested interface service, and includes: acquiring return information obtained by testing the target tested interface service after responding to the test request; performing deserialization processing on the returned information by using the output class method to obtain an output class instance; carrying out serialization processing on the output class examples to obtain the test result; and
and the first display module is used for receiving the test result and displaying the test result on the client.
9. A computer system, comprising:
one or more processors;
a memory for storing one or more programs,
wherein the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the method of any of claims 1-3 or 4-6.
10. A computer readable storage medium having stored thereon executable instructions which when executed by a processor cause the processor to implement the method of any of claims 1 to 3 or 4 to 6.
CN202110202647.2A 2021-02-23 2021-02-23 Interface test method, device, computer system and computer readable storage medium Active CN113032244B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110202647.2A CN113032244B (en) 2021-02-23 2021-02-23 Interface test method, device, computer system and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110202647.2A CN113032244B (en) 2021-02-23 2021-02-23 Interface test method, device, computer system and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN113032244A CN113032244A (en) 2021-06-25
CN113032244B true CN113032244B (en) 2024-02-02

Family

ID=76460945

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110202647.2A Active CN113032244B (en) 2021-02-23 2021-02-23 Interface test method, device, computer system and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN113032244B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113377680A (en) * 2021-07-14 2021-09-10 中国工商银行股份有限公司 Dubbo service test system and method
CN114143222A (en) * 2021-12-07 2022-03-04 无锡物联网产业研究院 Internet of things key equipment cloud testing method for typical application of smart city
CN114567571B (en) * 2022-03-14 2023-11-10 Oppo广东移动通信有限公司 Performance test method, device, electronic equipment and computer readable storage medium
CN114666258B (en) * 2022-03-22 2023-11-07 阿波罗智联(北京)科技有限公司 Interface testing method, device, electronic equipment and medium
CN115695228B (en) * 2022-10-18 2024-05-14 深圳市航盛电子股份有限公司 LVDS function test method, device, terminal equipment and storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110032511A (en) * 2019-03-19 2019-07-19 深圳市买买提信息科技有限公司 A kind of interface test method and interface testing equipment
CN110716870A (en) * 2019-09-23 2020-01-21 中国建设银行股份有限公司 Automatic service testing method and device

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9710368B1 (en) * 2014-05-02 2017-07-18 Amazon Technologies, Inc. Inter-process communication automated testing framework

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110032511A (en) * 2019-03-19 2019-07-19 深圳市买买提信息科技有限公司 A kind of interface test method and interface testing equipment
CN110716870A (en) * 2019-09-23 2020-01-21 中国建设银行股份有限公司 Automatic service testing method and device

Also Published As

Publication number Publication date
CN113032244A (en) 2021-06-25

Similar Documents

Publication Publication Date Title
CN113032244B (en) Interface test method, device, computer system and computer readable storage medium
JP7371141B2 (en) Tools and methods for real-time dataflow programming languages
US10318595B2 (en) Analytics based on pipes programming model
US20090282136A1 (en) Automatic Generation of Web Service client for Web Services Interoperability Testing
US9952835B2 (en) Generation of hybrid enterprise mobile applications in cloud environment
Cerny Aspect-oriented challenges in system integration with microservices, SOA and IoT
CN112187558B (en) Data verification method and device and electronic equipment
CN111221521A (en) Method and device for generating log code, computer system and readable storage medium
CN113900958A (en) Test case script generation method, system, medium and electronic device
Raj et al. Patterns for migration of SOA based applications to microservices architecture
WO2021129812A1 (en) Method and system for running artificial intelligence application, and device
CN115221033A (en) Interface protocol testing method and device, computer readable medium and electronic equipment
CN110717992B (en) Method, apparatus, computer system and readable storage medium for scheduling model
CN116483888A (en) Program evaluation method and device, electronic equipment and computer readable storage medium
CN111666201A (en) Regression testing method, device, medium and electronic equipment
CN114677114A (en) Approval process generation method and device based on graph dragging
CN111767194B (en) Information processing method, device, electronic equipment and medium
CN114116509A (en) Program analysis method, program analysis device, electronic device, and storage medium
CN113377648A (en) Software system diagnosis method and device, electronic equipment and computer readable medium
CN112685023A (en) Front-end development processing method, device, equipment and storage medium based on basic library
Dinca et al. Modern web application for image annotation using web technologies
CN112817573B (en) Method, apparatus, computer system, and medium for building a streaming computing application
CN113515326B (en) Data conversion method, device, electronic equipment and storage medium
Segura Specification-Driven Code Generation for Inter-parameter Dependencies in Web APIs
CN114911858A (en) Cloud platform interface generation method and device

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
GR01 Patent grant
GR01 Patent grant