CN114398294B - Test method, test device, electronic equipment and storage medium - Google Patents

Test method, test device, electronic equipment and storage medium Download PDF

Info

Publication number
CN114398294B
CN114398294B CN202210297860.0A CN202210297860A CN114398294B CN 114398294 B CN114398294 B CN 114398294B CN 202210297860 A CN202210297860 A CN 202210297860A CN 114398294 B CN114398294 B CN 114398294B
Authority
CN
China
Prior art keywords
data
interface
result
variable
aiming
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
CN202210297860.0A
Other languages
Chinese (zh)
Other versions
CN114398294A (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.)
Beijing Ruirong Tianxia Technology Co ltd
Original Assignee
Beijing Ruirong Tianxia Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Ruirong Tianxia Technology Co ltd filed Critical Beijing Ruirong Tianxia Technology Co ltd
Priority to CN202210297860.0A priority Critical patent/CN114398294B/en
Publication of CN114398294A publication Critical patent/CN114398294A/en
Application granted granted Critical
Publication of CN114398294B publication Critical patent/CN114398294B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3684Test management for test design, e.g. generating new test cases

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 application provides a test method, a test device, electronic equipment and a storage medium, wherein the method comprises the following steps: the method comprises the steps that a calling request aiming at a simulation interface is obtained by responding to the calling operation of a caller aiming at the simulation interface; then, based on the received call request, collecting interface data about the simulation interface; the interface data comprises original data and configuration data; the configuration data corresponds to a processing rule; then, carrying out corresponding processing on the original data according to a processing rule corresponding to the configuration data to generate an interface result aiming at the simulation interface dynamic state; and then, feeding back the interface result to the caller so that the caller tests the unit to be tested based on the interface result. The method and the device can generate dynamic interface results, provide more test modes and improve test effects.

Description

Test method, test device, electronic equipment and storage medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to a test method, an apparatus, an electronic device, and a storage medium.
Background
With the rapid development of software technology, systems are increasingly complex, more and more modules for splitting financial software are needed to be built for fusion and butt joint, in order to improve efficiency, all the modules provide butt joint documents and are developed in parallel, joint debugging data is needed for development, butt joint systems are not built and are caused to wait for each other, Mock interface simulation test service is derived according to the requirement, and products such as PostMan and Eolink in the existing market provide Mock interface simulation test service. The mock interface simulation service is to randomly generate an interface service address generated by the domain name service docking access after the docking information is recorded into the system according to the docking document, and the interface service returns a preset fixed result.
The Mock interface simulation service provided by the existing products PostMan, Eolink and the like can not meet the dynamic property of a service result, and because the provided service result is preset, the returned result is relatively fixed, and the simulation test of complex software on the interface dynamic result can not be met.
Disclosure of Invention
In view of this, an object of the present application is to provide a testing method, an apparatus, an electronic device and a storage medium, which can generate a dynamic interface result, provide more testing modes and improve a testing effect.
In a first aspect, an embodiment of the present application provides a testing method, where the method includes:
responding to the calling operation of a caller aiming at a simulation interface, and acquiring a calling request aiming at the simulation interface;
collecting interface data about the simulation interface based on the received call request; the interface data comprises original data and configuration data; the configuration data corresponds to a processing rule;
performing corresponding processing on the original data according to a processing rule corresponding to the configuration data to generate an interface result aiming at the simulation interface dynamic state;
and feeding back the interface result to the caller so that the caller tests the unit under test based on the interface result.
In some embodiments of the present application, the raw data includes variable data; the variable data comprises a request variable, a service provider variable and a global variable;
collecting the variable data by:
for the simulation interface, reading the global variable, the request variable, the service provider variable and the service variable of the simulation interface in sequence;
and if the unread variable exists in the simulation interface, reading again until the variable data in the simulation interface is read out.
In some technical solutions of the present application, the original data includes request information, and the method further includes:
reading the request information aiming at the simulation interface;
and integrating the request information and the variable data, and storing according to a preset data model.
In some technical solutions of the present application, the configuration data is a result template, the result template is configured according to a test requirement, and a processing rule in the result template includes replacement and operation.
In some technical solutions of the present application, the performing corresponding processing on the original data according to the processing rule corresponding to the configuration data to generate an interface result for the simulation interface dynamics includes:
processing the specified area by using a preset regular expression aiming at the specified area in the result template to obtain the specified content corresponding to the specified area;
inquiring in a preset object model according to the designated content to obtain result data;
and correspondingly processing the original data and the result data according to a processing rule corresponding to the configuration data to generate an interface result aiming at the simulation interface dynamic state.
In some technical solutions of the present application, the querying in a preset object model according to the specified content to obtain result data includes:
if the query data corresponding to the specified content can be queried in a preset object model, the query data is the result data;
and if the query data corresponding to the specified content cannot be queried in a preset object model, the null data is the result data.
In some embodiments of the present application, the method further includes:
responding to the newly added operation aiming at the analog interface, and acquiring newly added data; the newly added data comprises the data template;
and performing corresponding information processing according to whether the service provider already exists or not to obtain the newly added service.
In a second aspect, an embodiment of the present application provides a testing apparatus, including:
the obtaining module is used for responding the calling operation of a caller aiming at the simulation interface and obtaining a calling request aiming at the simulation interface;
the collection module is used for collecting interface data about the simulation interface based on the received call request; the interface data comprises original data and configuration data; the configuration data corresponds to a processing rule;
the generating module is used for carrying out corresponding processing on the original data according to a processing rule corresponding to the configuration data to generate an interface result aiming at the simulation interface dynamic state;
and the feedback module is used for feeding the interface result back to the caller so that the caller tests the unit to be tested based on the interface result.
In a third aspect, an embodiment of the present application provides an electronic device, which includes a memory, a processor, and a computer program stored on the memory and executable on the processor, where the processor implements the steps of the test method when executing the computer program.
In a fourth aspect, the present application provides a computer-readable storage medium, on which a computer program is stored, where the computer program is executed by a processor to perform the steps of the above-mentioned testing method.
The technical scheme provided by the embodiment of the application can have the following beneficial effects:
the method comprises the steps that a calling request aiming at a simulation interface is obtained by responding to the calling operation of a caller aiming at the simulation interface; then, based on the received call request, collecting interface data about the simulation interface; the interface data comprises original data and configuration data; the configuration data corresponds to a processing rule; then, carrying out corresponding processing on the original data according to a processing rule corresponding to the configuration data to generate an interface result aiming at the simulation interface dynamic state; and then, feeding back the interface result to the caller so that the caller tests the unit under test based on the interface result. The method and the device can generate dynamic interface results, provide more test modes and improve test effects.
In order to make the aforementioned objects, features and advantages of the present application more comprehensible, preferred embodiments accompanied with figures are described in detail below.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are required to be used in the embodiments will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present application and therefore should not be considered as limiting the scope, and for those skilled in the art, other related drawings can be obtained from the drawings without inventive effort.
FIG. 1 is a flow chart of a testing method provided by an embodiment of the present application;
fig. 2 is a schematic diagram illustrating a start-up flow of a mock testing service according to an embodiment of the present application;
FIG. 3 illustrates an interface simulation service data flow diagram provided by an embodiment of the present application;
fig. 4 shows a schematic flow diagram of a newly added mock service according to an embodiment of the present application;
FIG. 5 is a schematic diagram of a testing apparatus according to an embodiment of the present application;
fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
In order to make the purpose, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it should be understood that the drawings in the present application are for illustrative and descriptive purposes only and are not used to limit the scope of protection of the present application. Additionally, it should be understood that the schematic drawings are not necessarily drawn to scale. The flowcharts used in this application illustrate operations implemented according to some embodiments of the present application. It should be understood that the operations of the flow diagrams may be performed out of order, and steps without logical context may be performed in reverse order or simultaneously. One skilled in the art, under the guidance of this application, may add one or more other operations to, or remove one or more operations from, the flowchart.
In addition, the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. The components of the embodiments of the present application, generally described and illustrated in the figures herein, can be arranged and designed in a wide variety of different configurations. Thus, the following detailed description of the embodiments of the present application, presented in the accompanying drawings, is not intended to limit the scope of the claimed application, but is merely representative of selected embodiments of the application. All other embodiments, which can be derived by a person skilled in the art from the embodiments of the present application without making any creative effort, shall fall within the protection scope of the present application.
It should be noted that in the embodiments of the present application, the term "comprising" is used to indicate the presence of the features stated hereinafter, but does not exclude the addition of further features.
With the rapid development of software technology, systems are increasingly complex, more and more modules for splitting financial software are needed to be built for fusion and butt joint, in order to improve efficiency, all the modules provide butt joint documents and are developed in parallel, joint debugging data is needed for development, butt joint systems are not built and are caused to wait for each other, Mock interface simulation test service is derived according to the requirement, and products such as PostMan and Eolink in the existing market provide Mock interface simulation test service. The mock interface simulation service is to randomly generate an interface service address generated by the domain name service docking access after the docking information is recorded into the system according to the docking document, and the interface service returns a preset fixed result.
The Mock interface simulation service provided by the existing products PostMan, Eolink and the like can not meet the dynamic property of a service result, and because the provided service result is preset, the returned result is relatively fixed, and the simulation test of complex software on the interface dynamic result can not be met.
Based on this, embodiments of the present application provide a testing method, an apparatus, an electronic device, and a storage medium, which are described below by way of embodiments.
Fig. 1 is a schematic flow chart illustrating a testing method provided in an embodiment of the present application, wherein the method includes steps S101-S104; specifically, the method comprises the following steps:
s101, responding to the calling operation of a caller aiming at the simulation interface, and acquiring a calling request aiming at the simulation interface;
s102, collecting interface data about the simulation interface based on the received call request; the interface data comprises original data and configuration data; configuring data corresponding to a processing rule;
s103, carrying out corresponding processing on the original data according to the processing rule corresponding to the configuration data to generate an interface result aiming at the dynamic state of the simulation interface;
and S104, feeding back the interface result to the caller so that the caller tests the unit to be tested based on the interface result.
The invention can generate dynamic interface results, provide more test modes and improve test effect.
Some embodiments of the present application are described in detail below. The embodiments described below and the features of the embodiments can be combined with each other without conflict.
S101, responding to the calling operation of a caller aiming at the simulation interface, and acquiring a calling request aiming at the simulation interface.
The method is developed for a certain financial software system, and in order to improve development efficiency, the financial software is divided into a plurality of modules, and then each module is developed. Because the development progresses of different modules are different, some modules with higher development speed complete the development work first. For such a module having a high development speed, a preliminary test is required. Because other modules with slower development speed do not complete the development work, the joint test can not be carried out with the modules with faster development speed.
For a module with a slow development speed (or a module which cannot be jointly tested for other reasons), an analog interface is used for replacement. When data of a module with a low development speed needs to be used, the simulation interface is used for generating, and the combined test with the module with the high development speed is sequentially completed.
When the simulation interface is used, a caller initiates a calling operation aiming at the simulation interface, and the application responds to the calling operation aiming at the simulation interface of the caller and acquires a calling request aiming at the simulation interface.
S102, collecting interface data related to the simulation interface based on the received call request; the interface data comprises original data and configuration data; the configuration data corresponds to a processing rule.
After receiving a call request for a caller to call a simulation interface, the present application collects interface data on the simulation interface based on the received call request. The interface data in this application includes raw data and configuration data. Specifically, the raw data includes variable data, where the variable data is a request variable, a service provider variable, and a global variable. When variable data is collected, the global variable, the request variable, the service provider variable and the service variable of the simulation interface are read in sequence aiming at the simulation interface. When the unread variable exists in the simulation interface, the unread variable needs to be read again until the variable data in the simulation interface is read out.
The original data in the application also comprises request information, and the application also needs to collect the request information. The process of collecting the request information is as follows: and reading the request information aiming at the simulation interface, integrating the request information and the collected variable data, and storing according to a preset data model. That is, according to the present application, after the variable data and the request information are collected, the variable data and the request information are integrated, and after the two are collated, the variable data and the request information are stored according to a preset data model.
The interface data in this application comprises, in addition to the raw data, configuration data, where the configuration data corresponds to the processed rules. Specifically, the configuration data is a result template. The result template is a processing rule configured according to the test requirement, and the processing rule may be an alternative or an operation.
S103, carrying out corresponding processing on the original data according to the processing rule corresponding to the configuration data to generate an interface result aiming at the simulation interface dynamic state.
After the result template is obtained, the original data are correspondingly processed according to the processing rule corresponding to the result template. Here, the corresponding processing of the original data is specifically to sequentially replace or calculate the original data by using the processing rule corresponding to the result template.
When the processing rule corresponding to the result template is used for processing the original data, aiming at the specified area in the result template, a preset regular expression is used for processing the specified area, and the corresponding specified content included in the specified area is obtained. After the specified content is obtained, inquiring in a preset object model to obtain result data. When the object model is queried, two query cases exist, one is that query data corresponding to specified content can be queried in the object model; the other is that the query data corresponding to the specified content cannot be queried in the object model. If the query data corresponding to the specified content can be queried in a preset object model, the query data is the result data; and if the query data corresponding to the specified content cannot be queried in a preset object model, the null data is the result data.
And then, sequentially replacing or operating the original data and the result data by using the processing rule corresponding to the result template. And replacing or operating the result after the original data and the result data to be used as an interface result for simulating result dynamics.
And S104, feeding back the interface result to the caller so that the caller tests the unit to be tested based on the interface result.
After the interface result corresponding to the analog interface is obtained, the interface result needs to be fed back to the caller. After the caller receives the interface, the caller uses the interface result to test the unit under test. The tested unit is the module with the higher development speed.
In addition, the application also provides a service adding function. The caller carries out the new operation to the simulation interface service, this application responds to this new operation, obtains the new data corresponding to this new operation, and the new data here has deducted the data template suddenly, according to whether the service provider already exists, carry on the corresponding information processing, receive the new service.
In the present application, the processing rules in the result template, i.e. the substitution or operation in the result template, may be modified. That is to say, when a simulation interface is tested for multiple times in the present application, different results can be generated correspondingly by modifying the result template.
In this embodiment of the present application, as an optional embodiment, the method further includes:
and modifying the configuration data, and executing the method again to obtain another interface result.
In the embodiment of the present application, as an optional embodiment, a specific implementation process of the present application is as follows:
the first step is as follows: starting a Web container to export the configuration information of the maintained simulation interface out of the interface service and providing the Web container service; as shown in fig. 2, the start flow steps of the mock interface simulation service container are as follows:
step 1: reading the global environment variable of the whole mock, wherein the global environment variable can include but is not limited to; a time processing tool class, a random number tool class, a string processing tool class, and the like;
step 2: reading service provider environment variables maintained in a database, such as login names, login passwords and other public resource variables of service providers;
and step 3: reading service environment variables maintained in a database, such as environment variables of service numbers and the like;
and 4, step 4: judging whether the supplier has services or not, if so, performing the step 3, and if not, entering the step 5;
and 5: judging whether a supplier exists or not, if so, entering the step 2, and if not, entering the step 6;
step 6: and exposing the read service to the outside and providing the mock service.
The second step is that: the specific implementation details of the service and the data flow into fig. 1 are divided into 5 steps:
step 1: the butt joint person initiates a service request to the interface;
step 2: and collecting request information including information such as message headers, message bodies and cookies, and integrating the system global environment variables, the environment variables for providing the services and the environment variables for the services read in the steps 1,2 and 3 in the first step. Store messages in four dimensions with a data model, global variables: mocks, service provider: serviceProvider, service: service, request: the request is divided into three dimensions of headers, params and cookies, and is in the form of:
{
"mocks": {},
"serviceProvider": {},
"service": {},
"request": {
"headers":{},
"params":{},
"cookies":{}
}
}。
and step 3: reading a result template configured by the service, and returning an example of a format as follows:
example 1:
name=${request.params.name}&address=${request.params.address}
example 2:
{
"name":"${request.params.name}",
"sex":"${request.params.sex}"
}
example 3:
<sites>
<#list service.sites as item>
<site>
<name>${item.name}</name>
<url>${item.url}</url>
</site>
</#list>
</sites>
and 4, step 4: and (3) combining the data model obtained in the step (2) with the result template obtained in the step (3) through a process method of a Freemarker template engine, and using a regular expression for occupying the template {. The method includes the steps of obtaining a character string in $. }, searching data in an object model according to the analyzed character string, replacing $. } in a template with a result after the data is found, and replacing $. } with an empty character string when the data cannot be found, as shown in fig. 3.
And 5: and returning the result to the interface caller.
The third step: the Web container is provided with service management capabilities including adding, deleting and changing basic capabilities of services, and fig. 4 shows a new adding process of mock simulation services.
Step 1: the newly-added mock service request needs the following contents: the service provider (not necessary) to which the service belongs, the service environment variable (not necessary), the service return data template (necessary), and the data are stored in the persistent data;
step 2: judging whether the service provider exists or not, if not, entering a step 3, and if so, entering a step 4;
and step 3: storing service provider information and updating or adding environment variables on service provision;
and 4, step 4: saving the service environment variable;
and 5: and exporting mock interface simulation service.
Fig. 5 is a schematic structural diagram of a testing apparatus provided in an embodiment of the present application, where the apparatus includes:
the obtaining module is used for responding the calling operation of a caller aiming at the simulation interface and obtaining a calling request aiming at the simulation interface;
the collection module is used for collecting interface data related to the simulation interface based on the received call request; the interface data comprises original data and configuration data; the configuration data corresponds to a processing rule;
the generating module is used for carrying out corresponding processing on the original data according to a processing rule corresponding to the configuration data to generate an interface result aiming at the simulation interface dynamic state;
and the feedback module is used for feeding the interface result back to the caller so that the caller tests the unit to be tested based on the interface result.
The raw data comprises variable data; the variable data comprises a request variable, a service provider variable and a global variable;
collecting the variable data by:
for the simulation interface, reading the global variable, the request variable, the service provider variable and the service variable of the simulation interface in sequence;
the raw data includes request information, the method further comprising:
reading the request information aiming at the simulation interface;
and integrating the request information and the variable data, and storing according to a preset data model.
The configuration data is a result template, the result template is configured according to the test requirement, and the processing rule in the result template comprises replacement and operation.
The performing corresponding processing on the original data according to the processing rule corresponding to the configuration data to generate an interface result for the simulation interface dynamics includes:
processing the specified area by using a preset regular expression aiming at the specified area in the result template to obtain the specified content corresponding to the specified area;
inquiring in a preset object model according to the designated content to obtain result data;
and correspondingly processing the original data and the result data according to a processing rule corresponding to the configuration data to generate an interface result aiming at the simulation interface dynamic state.
The querying in a preset object model according to the specified content to obtain result data includes:
if the query data corresponding to the specified content can be queried in a preset object model, the query data is the result data;
and if the query data corresponding to the specified content cannot be queried in a preset object model, the null data is the result data.
The device also comprises a newly added module, wherein the newly added module is used for responding to newly added operation aiming at the analog interface and acquiring newly added data; the newly added data comprises the data template;
and performing corresponding information processing according to whether the service provider already exists or not to obtain the newly added service.
As shown in fig. 6, an embodiment of the present application provides an electronic device for executing the testing method in the present application, where the electronic device includes a memory, a processor, a bus, and a computer program stored in the memory and executable on the processor, where the processor implements the steps of the testing method when executing the computer program.
Specifically, the memory and the processor may be general-purpose memory and processor, which are not limited specifically, and the processor can execute the test method when the processor runs the computer program stored in the memory.
Corresponding to the testing method in the present application, the present application also provides a computer-readable storage medium, on which a computer program is stored, and the computer program, when executed by a processor, performs the steps of the testing method described above.
In particular, the storage medium can be a general-purpose storage medium, such as a removable disk, a hard disk, etc., on which a computer program can be executed when being executed to perform the above-mentioned test method.
In the embodiments provided in the present application, it should be understood that the disclosed system and method may be implemented in other ways. The above-described system embodiments are merely illustrative, and for example, the division of the units is only one logical functional division, and there may be other divisions in actual implementation, and for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection of systems or units through some communication interfaces, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments provided in the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit.
The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application or portions thereof that substantially contribute to the prior art may be embodied in the form of a software product stored in a storage medium and including instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus once an item is defined in one figure, it need not be further defined and explained in subsequent figures, and moreover, the terms "first", "second", "third", etc. are used merely to distinguish one description from another and are not to be construed as indicating or implying relative importance.
Finally, it should be noted that: the above-mentioned embodiments are only specific embodiments of the present application, and are used for illustrating the technical solutions of the present application, but not limiting the same, and the scope of the present application is not limited thereto, and although the present application is described in detail with reference to the foregoing embodiments, those skilled in the art should understand that: any person skilled in the art can modify or easily conceive the technical solutions described in the foregoing embodiments or equivalent substitutes for some technical features within the technical scope disclosed in the present application; such modifications, changes or substitutions do not depart from the spirit and scope of the present disclosure, which should be construed in light of the above teachings. Are intended to be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (9)

1. A method for testing an analog interface, the method comprising:
responding to the calling operation of a caller aiming at a simulation interface, and acquiring a calling request aiming at the simulation interface;
collecting interface data about the simulation interface based on the received call request; the interface data comprises original data and configuration data; the configuration data corresponds to a processing rule;
performing corresponding processing on the original data according to a processing rule corresponding to the configuration data to generate an interface result aiming at the simulation interface dynamic state;
feeding the interface result back to the caller so that the caller tests the unit under test based on the interface result;
the raw data comprises variable data; the variable data comprises a request variable, a service provider variable and a global variable; the processing rule comprises replacement and operation;
the performing corresponding processing on the original data according to the processing rule corresponding to the configuration data to generate an interface result for the simulation interface dynamics includes:
replacing or operating the request variable, the service provider variable and the global variable to generate an interface result aiming at the simulation interface dynamic state;
the method further comprises the following steps:
responding to the newly added operation aiming at the analog interface, and acquiring newly added data; the new data comprises a data template;
and performing corresponding information processing according to whether the service provider already exists or not to obtain the newly added service.
2. The method of claim 1, wherein the variable data is collected by:
for the simulation interface, reading the global variable, the request variable, the service provider variable and the service variable of the simulation interface in sequence;
and if the unread variable exists in the simulation interface, reading again until the variable data in the simulation interface is read out completely.
3. The method of claim 2, wherein the raw data comprises request information, the method further comprising:
reading the request information aiming at the simulation interface;
and integrating the request information and the variable data, and storing according to a preset data model.
4. The method of claim 1, wherein the configuration data is a result template, the result template is configured according to test requirements, and the processing rules in the result template include replacement and operation.
5. The method according to claim 4, wherein the performing corresponding processing on the raw data according to the processing rule corresponding to the configuration data to generate an interface result for the simulation interface dynamics includes:
processing the specified area by using a preset regular expression aiming at the specified area in the result template to obtain the specified content corresponding to the specified area;
inquiring in a preset object model according to the designated content to obtain result data;
and correspondingly processing the original data and the result data according to a processing rule corresponding to the configuration data to generate an interface result aiming at the simulation interface dynamic state.
6. The method according to claim 5, wherein the querying in a preset object model according to the specified content to obtain result data comprises:
if the query data corresponding to the specified content can be queried in a preset object model, the query data is the result data;
and if the query data corresponding to the specified content cannot be queried in a preset object model, the null data is the result data.
7. A test apparatus, the apparatus comprising:
the obtaining module is used for responding the calling operation of a caller aiming at the simulation interface and obtaining a calling request aiming at the simulation interface;
the collection module is used for collecting interface data related to the simulation interface based on the received call request; the interface data comprises original data and configuration data; the configuration data corresponds to a processing rule;
the generating module is used for carrying out corresponding processing on the original data according to a processing rule corresponding to the configuration data to generate an interface result aiming at the simulation interface dynamic state;
the feedback module is used for feeding the interface result back to the caller so that the caller tests the unit to be tested based on the interface result;
the raw data comprises variable data; the variable data comprises a request variable, a service provider variable and a global variable; the processing rule comprises replacement and operation;
the generating module, when configured to perform corresponding processing on the raw data according to a processing rule corresponding to the configuration data, and generate an interface result for the simulation interface dynamics, includes:
replacing or operating the request variable, the service provider variable and the global variable to generate an interface result aiming at the simulation interface dynamic state;
the device further comprises:
the new module is used for responding to new operation aiming at the analog interface and acquiring new data; the new data comprises a data template;
and performing corresponding information processing according to whether the service provider already exists or not to obtain the newly added service.
8. An electronic device, comprising: a processor, a memory and a bus, the memory storing machine-readable instructions executable by the processor, the processor and the memory communicating over the bus when the electronic device is operating, the machine-readable instructions when executed by the processor performing the steps of the testing method of any of claims 1 to 6.
9. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the steps of the test method according to one of claims 1 to 6.
CN202210297860.0A 2022-03-25 2022-03-25 Test method, test device, electronic equipment and storage medium Active CN114398294B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210297860.0A CN114398294B (en) 2022-03-25 2022-03-25 Test method, test device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210297860.0A CN114398294B (en) 2022-03-25 2022-03-25 Test method, test device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN114398294A CN114398294A (en) 2022-04-26
CN114398294B true CN114398294B (en) 2022-08-05

Family

ID=81235031

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210297860.0A Active CN114398294B (en) 2022-03-25 2022-03-25 Test method, test device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114398294B (en)

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112306881A (en) * 2020-11-02 2021-02-02 平安普惠企业管理有限公司 Simulation data generation method, device, equipment and storage medium

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112306881A (en) * 2020-11-02 2021-02-02 平安普惠企业管理有限公司 Simulation data generation method, device, equipment and storage medium

Also Published As

Publication number Publication date
CN114398294A (en) 2022-04-26

Similar Documents

Publication Publication Date Title
US10546006B2 (en) Method and system for hybrid information query
JP2018026178A (en) Populating user contact entry
CN111597110B (en) Page test method and device, electronic equipment and storage medium
CN110399448B (en) Chinese place name address searching and matching method, terminal and computer readable storage medium
CN113031951B (en) Menu generation method, menu generation device, computer equipment and storage medium
Khan et al. Measuring the impact of biodiversity datasets: Data reuse, citations and altmetrics
CN114385620A (en) Data processing method, device, equipment and readable storage medium
CN111290996A (en) Document format conversion method, device, equipment and readable storage medium
CN114328632A (en) User data analysis method and device based on bitmap and computer equipment
CN114398294B (en) Test method, test device, electronic equipment and storage medium
CN117290250A (en) Automatic test framework establishment method, computer equipment and computer storage medium
CN116775488A (en) Abnormal data determination method, device, equipment, medium and product
CN112214494B (en) Retrieval method and device
CN112506800B (en) Method, apparatus, device, medium and program product for testing code
CN113704486A (en) Map data construction method and device and map data query method and device
CN114444447A (en) Card processing method and device
CN113553425A (en) Data aggregation method, device, equipment and storage medium based on RPA and AI
CN112650964A (en) Service processing method, equipment and machine readable storage medium
CN110737662A (en) data analysis method, device, server and computer storage medium
CN116010467B (en) Risk discovery method, device, equipment and storage medium based on communication map
CN111310088A (en) Page rendering method and device
CN111352824A (en) Test method and device and computer equipment
Lin et al. Large language models reveal big disparities in current wildfire research
CN112035425B (en) Log storage method and device and computer system
CN111126015B (en) Report form compiling method and equipment

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