CN110177006B - Node testing method and device based on interface prediction model - Google Patents

Node testing method and device based on interface prediction model Download PDF

Info

Publication number
CN110177006B
CN110177006B CN201910303832.3A CN201910303832A CN110177006B CN 110177006 B CN110177006 B CN 110177006B CN 201910303832 A CN201910303832 A CN 201910303832A CN 110177006 B CN110177006 B CN 110177006B
Authority
CN
China
Prior art keywords
interface
node
test
test case
input data
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
CN201910303832.3A
Other languages
Chinese (zh)
Other versions
CN110177006A (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.)
Ping An Puhui Enterprise Management Co Ltd
Original Assignee
Ping An Puhui Enterprise Management 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 Ping An Puhui Enterprise Management Co Ltd filed Critical Ping An Puhui Enterprise Management Co Ltd
Priority to CN201910303832.3A priority Critical patent/CN110177006B/en
Publication of CN110177006A publication Critical patent/CN110177006A/en
Application granted granted Critical
Publication of CN110177006B publication Critical patent/CN110177006B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/14Network analysis or design
    • H04L41/145Network analysis or design involving simulating, designing, planning or modelling of a network
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/50Testing arrangements

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Debugging And Monitoring (AREA)
  • Test And Diagnosis Of Digital Computers (AREA)

Abstract

The invention relates to the field of artificial intelligence, and particularly discloses a node testing method and device based on an interface prediction model, which comprises the following steps: acquiring an input test case, wherein the test case comprises a node identification corresponding to a node to be tested and input data in the node to be tested; inputting the input data and the node identification into an interface prediction model, and predicting and determining an interface which needs to be called at the test node for executing the test case through the interface prediction model; calling the determined interface to return target data corresponding to the input data through the interface; and obtaining the test result of the test case according to the target data and the expected data set for the test case. The efficiency of node test is improved.

Description

Node testing method and device based on interface prediction model
Technical Field
The disclosure relates to the field of artificial intelligence, and in particular relates to a node testing method and device.
Background
Before the formal business process is on-line, each node in the process needs to be tested. However, for a service flow in which the data trend at each node is intricate, for a tester, it is necessary to be familiar with the data trend of each node in the service flow, that is, interfaces that each node needs to call in the flow, so that when the service flow is tested, the tester needs to select a called interface according to processing logic disposed at the node, that is, according to interface calling conditions corresponding to each interface disposed at the node, so as to complete the test of each node in the service flow.
Therefore, if a tester is unfamiliar with the processing logic at each node of the business process, the test of the business process cannot be performed on the automated test platform, so that the node test method in the prior art has the problems of high requirement on the tester and low test efficiency.
Disclosure of Invention
In order to solve the problems in the related art, the present disclosure provides a node testing method and apparatus.
In a first aspect, a node testing method based on an interface prediction model includes:
acquiring an input test case, wherein the test case comprises a node identification corresponding to a node to be tested and input data in the node to be tested;
inputting the input data and the node identification into an interface prediction model, and predicting and determining an interface which needs to be called at the test node for executing the test case through the interface prediction model;
calling the determined interface to return target data corresponding to the input data through the interface;
and obtaining the test result of the test case according to the target data and the expected data set for the test case.
In a second aspect, a node testing apparatus based on an interface prediction model includes:
an acquisition module configured to: acquiring an input test case, wherein the test case comprises a node identification corresponding to a node to be tested and input data in the node to be tested;
an interface determination module configured to: inputting the input data and the node identification into an interface prediction model, and predicting and determining an interface which needs to be called at the test node for executing the test case through the interface prediction model;
an interface invocation module configured to: calling the determined interface to return target data corresponding to the input data through the interface;
a test result obtaining module configured to: and obtaining the test result of the test case according to the target data and the expected data set for the test case.
In one embodiment, the interface determination module includes:
a first determination unit configured to: in the interface prediction model, determining a plurality of interfaces available for calling at the test node according to the node identification;
a building unit configured to: constructing a feature vector of the input data;
a classification prediction unit configured to: performing classification prediction according to the feature vectors to obtain the probability of the feature vectors corresponding to each of the plurality of interfaces;
a second determination unit configured to: and traversing the probability of each interface, and determining the interface corresponding to the maximum probability as the interface which needs to be called at the test node for executing the test case.
In an embodiment, the interface prediction model-based node testing apparatus further includes:
a sample acquisition module configured to: acquiring a plurality of sample test cases and an interface label determined by marking each sample test case;
an extraction module configured to: extracting node identification corresponding to a node to be tested in the sample test case and sample input data in the node to be tested from each sample test case;
a training module configured to: and training the interface prediction model through the node identification of the to-be-tested node corresponding to each sample test case, the corresponding sample input data and the corresponding interface label until the prediction precision of the interface prediction model reaches the set precision.
In an embodiment, the node testing apparatus based on the interface prediction model further includes:
the node is configured as a file acquisition module configured to: acquiring a node configuration file configured for the node to be tested from a configuration file according to the node identification, wherein the configuration file is obtained by configuration according to the data trend of each node in the service flow;
a second interface determination module configured to: and determining an interface which needs to be called for executing the test case at the test node according to the input data and the interface condition in the node configuration file.
In one embodiment, the second interface determining module includes:
a keyword extraction unit configured to: extracting a plurality of keywords and the value of each keyword from the input data;
a lookup unit configured to: searching the plurality of keywords and the interface condition met by the value of each keyword in the node configuration file;
a second interface determination unit configured to: and determining the interface corresponding to the searched interface condition as the interface which needs to be called for executing the test case at the node to be tested.
In one embodiment, the interface calling module includes:
an assignment unit configured to: assigning values to parameters in the interface according to the input data;
a request initiation unit configured to: initiating a data request through the interface which has completed assignment;
a receiving unit configured to: receiving target data corresponding to the input data returned through the interface.
In an embodiment, the interface prediction model-based node testing apparatus further includes:
a test record generation module configured to: generating a test record of the test case according to the input data corresponding to the test case, the node identification of the node to be tested, the determined interface, the target data and the corresponding test result;
a test report generation module configured to: and forming a test report by storing the test record of the test case.
In a third aspect, a node testing apparatus based on an interface prediction model includes:
a processor; and
a memory having computer readable instructions stored thereon which, when executed by the processor, implement a method as described above.
In a fourth aspect, a computer-readable storage medium, on which a computer program is stored, wherein the computer program, when executed by a processor, implements the method as described above.
In the technical scheme of the disclosure, the interface to be called according to the input data at each node to be tested is determined based on the established interface prediction model, and the judgment and determination are performed without depending on the processing logic deployed at each node grasped by a tester, so that the node can be tested even by a tester unfamiliar with the node to be tested, the efficiency of node testing is greatly improved, and the workload of the tester is reduced.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and together with the description, serve to explain the principles of the invention.
FIG. 1 is a schematic illustration of an implementation environment according to the present disclosure;
FIG. 2 is a block diagram illustrating a server in accordance with an exemplary embodiment;
FIG. 3 is a flow diagram illustrating a method for node testing based on an interface prediction model in accordance with an exemplary embodiment;
FIG. 4 is a flow diagram of step S130 of the corresponding embodiment of FIG. 3 in one embodiment;
FIG. 5 is a flow diagram in one embodiment of steps prior to step S130 of the corresponding embodiment of FIG. 3;
FIG. 6 is a flowchart illustrating a method of node testing in accordance with another exemplary embodiment;
FIG. 7 is a flowchart of step S330 of the corresponding embodiment of FIG. 6 in one embodiment;
FIG. 8 is a flow diagram of step S150 of the corresponding embodiment of FIG. 3 in one embodiment;
FIG. 9 is a flowchart of steps in one embodiment after step S170 of the corresponding embodiment of FIG. 3;
FIG. 10 is a block diagram illustrating an interface prediction model based node testing apparatus in accordance with an exemplary embodiment;
FIG. 11 is a block diagram illustrating an interface prediction model based node testing apparatus according to another exemplary embodiment.
While specific embodiments of the invention have been shown and described in detail in the foregoing drawings, it will be appreciated that such drawings and detailed description are not intended to limit the scope of the inventive concepts in any manner, but rather to explain the inventive concepts to those skilled in the art by reference to the particular embodiments.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present invention. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the invention, as detailed in the appended claims.
FIG. 1 is a schematic illustration of an implementation environment according to the present disclosure. The implementation environment includes: a terminal 100 and a test server 300.
The terminal 100 may be a communication device such as a smart phone, a tablet computer, a notebook computer, a desktop computer, etc. that can establish a communication connection with the test server 300. The test server 300 may be an independent server, or may be a server cluster, a cloud server, or the like, and is not particularly limited herein.
Based on the communication connection established between the terminal 100 and the test server 300, a tester can input a test case in the terminal 100, and the test server 300 receives the test case transmitted by the terminal 100 and performs a node test according to the technical scheme of the present disclosure. The association between the terminal 100 and the test server 300 includes the network association and/or the protocol of the hardware, and the data association therebetween.
It should be noted that the node testing method based on the interface prediction model of the present disclosure is not limited to deploying corresponding processing logic in the testing server 300, and may also be processing logic deployed in other machines. For example, processing logic for node testing is deployed in a computing-capable terminal device, etc.
Fig. 2 is a block diagram illustrating a server 200 in accordance with an example embodiment. The apparatus having this hardware structure may be deployed in the implementation environment shown in fig. 1 as a test server 300 to execute the interface prediction model-based node test method of the present disclosure.
It should be noted that the server is only an example adapted to the present disclosure, and should not be considered as providing any limitation to the scope of the present disclosure. Nor should the server be construed as necessarily dependent upon or having one or more components of the exemplary server 200 shown in fig. 2.
The hardware structure of the server may be greatly different due to different configurations or performances, as shown in fig. 2, the server 200 includes: a power supply 210, an interface 230, at least one memory 250, and at least one Central Processing Unit (CPU) 270.
The power supply 210 is used to provide operating voltage for each hardware device on the server 200.
The interface 230 includes at least one wired or wireless network interface 231, at least one serial-to-parallel conversion interface 233, at least one input/output interface 235, and at least one USB interface 237, etc. for communicating with external devices.
The storage 250 is used as a carrier for storing resources, and may be a read-only memory, a random access memory, a magnetic disk, an optical disk, or the like, where the resources stored thereon include an operating system 251, an application 253, data 255, and the like, and the storage manner may be a transient storage manner or a permanent storage manner. The operating system 251 is used for managing and controlling various hardware devices and application programs 253 on the server 200 to implement the computation and processing of the mass data 255 by the central processing unit 270, and may be Windows server, mac OS XTM, unix, linux, freeBSDTM, or the like. The application 253 is a computer program that performs at least one specific task on the operating system 251, and may include at least one module (not shown in fig. 2), each of which may contain a series of computer-readable instructions for the server 200. Data 255 may be program code stored on disk, etc.
Central processor 270 may include one or more processors and is configured to communicate with memory 250 via a bus for computing and processing mass data 255 in memory 250.
As described in detail above, a server 200 to which the present disclosure is applicable will complete the node testing method by the central processor 270 reading a series of computer readable instructions stored in the memory 250.
In an exemplary embodiment, the server 200 may be implemented by one or more Application Specific Integrated Circuits (ASICs), digital signal processors, digital signal processing devices, programmable logic devices, field programmable gate arrays, controllers, microcontrollers, microprocessors or other electronic components for performing the methods described below. Thus, implementations of the invention are not limited to any specific hardware circuitry, software, or combination of both.
FIG. 3 is a flow chart illustrating a method for node testing based on an interface prediction model in accordance with an exemplary embodiment. The node testing method based on the interface prediction model can be executed by the testing server 300, and can include the following steps:
step S110, an input test case is obtained, wherein the test case comprises a node identification corresponding to a node to be tested and input data in the node to be tested.
The service flow is composed of a plurality of nodes which are arranged according to a set sequence. Therefore, the processing of the service is to execute the processing logic disposed in the node at each node according to the sequence set in the service flow. For example, in the process of loan, four nodes of reservation, insurance application, card binding and video interview are arranged in sequence, and for example, in the process of processing a certain part, five nodes of raw material detection, turning, heat treatment, grinding and finished product detection are arranged in sequence.
Before the business process is formally brought online, the whole business process needs to be tested, and the test is performed on the basis of testing each node (namely, the node test mentioned in the present disclosure), so as to verify whether the processing logic at the node is consistent with the expected processing logic.
At each node in the traffic flow, the processing logic deployed at the node provides several interfaces that are available for invocation at that node, i.e., different data trends are provided at the node. Correspondingly, the processing logic disposed at the node defines the requirements to be met by calling each interface, namely the interface condition corresponding to the interface. Wherein the interface conditions set for each interface are set for input data defined at that interface.
For example, the node of the binding card mentioned above correspondingly provides 4 interfaces for calling: the interface A provided by the system A, the interface B provided by the system B, the interface C provided by the system C and the interface D provided by the system D, wherein the interface condition for calling the interface A at the node is A1, the interface condition for calling the interface B is B1, the interface condition for calling the interface C is C1, and the interface condition for calling the interface D is D1. Thus, if a certain input data at the node satisfies the interface condition C1, the interface C is called at the node according to the input data.
At each node, the type of data input at the node is defined in the processing logic deployed at the node. Wherein the type of input data can be distinguished according to keywords. The interface condition mentioned above is defined according to the key and the value of the key. For example, the node of binding card mentioned above requires to input the user name, identification number and address, if the input data of a user is: the user name is Lidong, the identification number is 511234 x 1024, and the address is Sichuan province city region x street. In the input data of the user, the user name, the identification number and the address are all keywords, "liedong" is the value of the keyword of the user name, "511234 × × 1024" is the value of the keyword of the identification number, "and" city × district × street, province, four provinces "is the value of the keyword of the address.
An interface, i.e., an interface function, is a function that a certain module provides to other modules. For example, the interface a provided by the system of the bohai bank mentioned above may be called to obtain data of a certain user, for example, credit record data, from the database corresponding to the system a.
Test Case (Test Case) is a set of data compiled for a particular target, where each Test Case includes Test inputs, test objects, and expected data to Test whether the Test objects meet requirements. In the technical scheme of the disclosure, a test object is an interface which is deployed at a node to be tested and can be called, a test input is input data at the node to be tested, expected data is at the node to be tested, theoretical processing logic at the test node determines the interface which corresponds to the input data and can be called, calls the interface, and returns data according to the input data through the interface.
When the test result of a test case is judged to be passed, the target data is compared with the expected data, if the target data is consistent with the expected data, the test result of the test case is passed, otherwise, the test result is failed.
In the technical scheme of the disclosure, the testing is performed based on the nodes in the service flow, the interfaces provided by each node in the service flow and available for calling are all test objects, and each node is a node to be tested before the node testing is performed.
The test case is compiled according to the nodes to be tested. And identifying the nodes to be tested in the test case through the node identifications corresponding to the test cases to be tested. The node identifier is used to uniquely identify a node, and may be a node name configured for the node, or a node number configured for each node in a system where a service flow is located, which is not specifically limited herein.
Step S130, inputting the input data and the node identifier into an interface prediction model, and determining an interface that needs to be called at the test node to execute the test case through prediction by the interface prediction model.
The interface prediction model is a complex neural network model formed by a plurality of neurons widely connected with each other for making the interface prediction to be called at each node. The interface prediction model may be a cyclic neural network model, a convolutional neural network model, or other model that can be used for the interface prediction color neural network model after being trained, and is not specifically limited herein.
In one embodiment, as shown in fig. 4, step S130 includes:
step S131, in the interface prediction model, determining a plurality of interfaces available for calling at the test node according to the node identification.
In the technical solution of the present disclosure, the interfaces provided in the business process are divided according to nodes, that is, interfaces available for calling at each node are defined. Therefore, in order to reduce the operation amount of the interface prediction model in the process of carrying out classification prediction, a plurality of interfaces which are provided by the business process at the node and can be called are determined in advance according to the node identification. Thus, classification prediction is performed in the determined several interfaces in step S133.
Step S132, constructing a feature vector of the input data.
The feature vector of the input data is a vector constructed from features of the input data. In the technical scheme of the disclosure, the characteristics of the input data are embodied by the keywords in the input data and the value of each keyword.
And step S133, performing classified prediction according to the feature vectors to obtain the probability that the feature vectors correspond to each of the plurality of interfaces.
Step S134, traversing the probability of each of the plurality of interfaces, and determining the interface corresponding to the maximum probability as the interface to be called at the test node for executing the test case.
After the probability that the feature vector corresponds to each interface in the determined interfaces is obtained through prediction, the interface corresponding to the maximum probability value is determined as the interface needing to be called for executing the test case at the test node.
Step S150, calling the determined interface to return the target data corresponding to the input data through the interface.
The same interface, for different input data, corresponds to the data returned by calling the interface not necessarily the same, in other words, the target data returned by calling the interface is dependent on the input data in the test case. After the interface needing to be called is determined, interface calling needs to be carried out according to the input data in the test case, and target data corresponding to the input data are obtained.
In one embodiment, as shown in fig. 8, step S150 includes:
and step S151, assigning values to the parameters in the interface according to the input data.
Step S152, a data request is initiated through the interface that has completed assignment.
And step S153, receiving the target data corresponding to the input data returned by the interface.
As described above, the interface is an interface function. In a specific interface, parameters to be assigned when the interface is called are defined. Wherein the parameters in the interface correspond to keywords in the input data, i.e. a parameter in the interface corresponds to a keyword in the input data. The assignment of the parameters in the interface is performed, that is, the value of the keyword corresponding to each parameter is extracted from the input data, and the value of the corresponding parameter is assigned through the value of the keyword. For example, in an interface provided at a node, defined parameters include identification number, name, gender, academic history, income, and a user's input data at the node includes: the identity card number is 511234 x 1024, the name is Lidong, the gender is male, the academic history is the subject, the income is 20 w/year, the occupation is an engineer, when the input data of the user is assigned to the parameter in the node, the identity card number of the user is extracted from the input data to be assigned as the parameter assignment of the identity card number, and the assignment of the parameters such as the name, the gender, the academic history and the income is carried out in the same way.
Therefore, after the assignment of each parameter in the interface is completed, the interface is called, namely, a data request is initiated, and the target data corresponding to the input data can be received through the called interface.
Step S170, obtaining the test result of the test case according to the target data and the expected data set for the test case.
The test result of the test case comprises a result that the test passes and a result that the test fails. And if the target data are the same as the expected data, the test result of the test case is that the test is passed, otherwise, if the target data are different from the expected data, the test result of the test case is that the test is failed.
In the prior art, because a tester needs to be familiar with processing logic deployed at a node to test the node, that is, interfaces provided at each node and available for calling and interface conditions corresponding to each interface are known, so that the interface required to be called according to input data of a test case at the node is determined to test the node, and the interface determination is performed by relying on judgment of the tester on the interface, on one hand, the workload of the tester is large, and the requirement of a test process on the tester is high, that is, the tester unfamiliar with the processing logic deployed at the node has no way to test the node; on the other hand, the interface is slow based on the determination by the tester, resulting in a slow rate of interface testing.
In the technical scheme of the disclosure, the interface to be called according to the input data at each node to be tested is determined based on the established interface prediction model, the determination is not performed based on the judgment of the tester, the node can be tested even if the tester unfamiliar with the node to be tested can perform the node test, the node test efficiency is greatly improved, and the workload of the tester is reduced.
In an embodiment, as shown in fig. 5, before step S130, the method further includes:
step S210, obtaining a plurality of sample test cases and marking the determined interface tag for each sample test case.
Step S230, extracting node identifiers corresponding to the nodes to be tested in the sample test cases and sample input data in the nodes to be tested from each sample test case.
And step S250, training the interface prediction model through the node identification of the to-be-tested node corresponding to each sample test case, the corresponding sample input data and the corresponding interface label until the prediction precision of the interface prediction model reaches the set precision.
In order to ensure the accuracy of the interface prediction model for predicting and determining the interface, the interface prediction model is trained until the set accuracy is reached before the interface prediction model is used for predicting and determining the interface in step S130.
Compared with the test case actually used for node prediction, the sample test case used for training the interface prediction model includes sample input data at a node, a node identifier corresponding to the node, and does not include target data corresponding to the sample input data.
The interface label determined by marking the sample test case is an interface determined by artificial judgment according to sample input data and the interface conditions set by nodes corresponding to the sample test case.
The training of the interface prediction model is as follows: inputting sample input data and node identification in a sample test case into an interface prediction model, constructing a feature vector through the interface prediction model, predicting to obtain an interface aiming at the sample input data at a node indicated by the node identification, and if the predicted interface is inconsistent with an interface label determined by marking the test case, adjusting parameters of the interface prediction model until the interface predicted by the interface prediction model is consistent with the corresponding interface label. And repeating the steps, and continuing the training of the interface prediction model by using the next test case and the interface label marked and obtained for the test case.
After training for a period of time, testing the prediction accuracy of the interface prediction model, and if the set prediction accuracy is reached, ending the training of the interface prediction model; and if the set prediction accuracy is not reached, continuing the training of the interface prediction model.
And (3) performing precision test on the interface prediction model, namely testing by using a plurality of test sample test cases and interface labels obtained according to the marks of each test sample test case, inputting the sample input data and the node identifications in each test sample test case into the trained interface prediction model, and predicting by using the interface prediction model to obtain the interface of the test sample test case. After obtaining the interfaces of the test sample test cases based on the interface prediction model, calculating the prediction precision of the interface prediction model according to the interface obtained for each test sample test case label, and finishing the training of the interface prediction model if the calculated prediction precision reaches the set prediction precision; and if not, continuing the training of the interface prediction model until the set prediction precision is reached.
In an embodiment, as shown in fig. 6, after step S110, the method further includes:
step S310, obtaining a node configuration file configured for the node to be tested from a configuration file according to the node identification, wherein the configuration file is obtained by configuring according to the data trend of each node in the service process.
Step S330, determining an interface that needs to be invoked at the test node to execute the test case according to the input data and the interface condition in the node configuration file.
In this embodiment, another method for determining an interface from input data in a test case is provided. That is, a configuration file is generated in advance according to the data trend at each node in the business process (depending on the configured interface conditions at the node). And in the configuration file, the node identification of each node and the corresponding node configuration file are stored in an associated mode. Therefore, the node configuration file corresponding to the node can be correspondingly obtained according to the node identification of the node to be tested.
Interface conditions for calling each interface at a node are configured in the node configuration file, so that after input data in a test case is obtained, the input data is matched in the node configuration file to determine the interface conditions met by the input data, and therefore, an interface corresponding to the determined interface conditions is determined to be an interface needing to be called at the test node for executing the test case.
Therefore, the configuration file is obtained by configuring according to the data trend of each node in the business process in advance, when the node test is carried out, a tester does not need to judge the interface corresponding to the input data according to the processing logic of the node to be tested, and in the node test process, the interface which is corresponding to the input data and needs to be called is determined according to the node configuration file corresponding to the node in the configuration file, so that the workload of the tester is reduced, and the test efficiency is improved.
In one embodiment, as shown in fig. 7, step S330 includes:
in step S331, a number of keywords and a value of each of the keywords are extracted from the input data.
Step S332, searching the node configuration file for the plurality of keywords and the interface condition that the value of each keyword satisfies.
Step S333, determining the interface corresponding to the searched interface condition as the interface that needs to be called for executing the test case at the node to be tested.
In step S332, which interface condition in the node configuration file is satisfied is determined according to the keywords extracted from the input data and the value of each extracted keyword, so that the interface corresponding to the determined interface condition is determined as the interface that needs to be called to execute the test case at the node to be tested.
In an embodiment, as shown in fig. 9, after step S170, the method further includes:
step S410, generating a test record of the test case according to the input data corresponding to the test case, the node identification of the node to be tested, the determined interface, the target data and the corresponding test result.
And step S430, storing the test records of the test cases to form a test report.
The test report includes test records corresponding to a plurality of test cases. The data acquired by the test case in the test process can be acquired through the test record generated by aiming at each test case in the test report, so that the data can be conveniently consulted and audited by testers. And moreover, the evaluation and analysis of the interface performance of each node and each node in the test process and the service flow can be conveniently carried out by a tester according to the test record.
In the embodiment, the test report is correspondingly sent to the tester, so that the tester can know the test progress and the test result in the test process according to the test report.
The following is an embodiment of the apparatus of the present disclosure, which may be used to execute an embodiment of a node testing method based on an interface prediction model executed by the testing server 300 of the present disclosure. For details not disclosed in the embodiments of the device of the present disclosure, please refer to the embodiments of the node testing method of the present disclosure.
Fig. 10 is a block diagram of a node testing apparatus based on an interface prediction model according to an exemplary embodiment, which may be used in the testing server 300 in the implementation environment shown in fig. 1 to perform all or part of the steps of the node testing method shown in any one of the above method embodiments. As shown in fig. 10, the node testing apparatus includes but is not limited to: an obtaining module 510, an interface determining module 530, an interface calling module 550, and a test result obtaining module 570, wherein:
an obtaining module 510 configured to: the method comprises the steps of obtaining an input test case, wherein the test case comprises a node identification corresponding to a node to be tested and input data in the node to be tested.
An interface determination module 530 configured to: inputting the input data and the node identification into an interface prediction model, and predicting and determining an interface which needs to be called at the test node for executing the test case through the interface prediction model;
an interface call module 550 configured to: calling the determined interface to return target data corresponding to the input data through the interface;
a test result obtaining module 570 configured to: and obtaining a test result of the test case according to the target data and the expected data set for the test case.
In one embodiment, the interface determination module 530 includes:
a first determination unit configured to: in the interface prediction model, determining a plurality of interfaces available for calling at the test node according to the node identification;
a building unit configured to: constructing a feature vector of the input data;
a classification prediction unit configured to: performing classification prediction according to the feature vectors to obtain the probability of the feature vectors corresponding to each of the plurality of interfaces;
a second determination unit configured to: and traversing the probability of each interface, and determining the interface corresponding to the maximum probability as the interface which needs to be called at the test node for executing the test case.
In an embodiment, the interface prediction model-based node testing apparatus further includes:
a sample acquisition module configured to: obtaining a plurality of sample test cases and an interface label determined by marking each sample test case;
an extraction module configured to: extracting node identification corresponding to a node to be tested in the sample test case and sample input data in the node to be tested from each sample test case;
a training module configured to: and training the interface prediction model through the node identification of the to-be-tested node corresponding to each sample test case, the corresponding sample input data and the corresponding interface label until the prediction precision of the interface prediction model reaches the set precision.
In an embodiment, the interface prediction model-based node testing apparatus further includes:
the node is configured as a file acquisition module configured to: acquiring a node configuration file configured for the node to be tested from a configuration file according to the node identification, wherein the configuration file is obtained by configuring according to the data trend of each node in a service flow;
a second interface determination module configured to: and determining an interface which needs to be called for executing the test case at the test node according to the input data and the interface condition in the node configuration file.
In one embodiment, the second interface determining module includes:
a keyword extraction unit configured to: extracting a plurality of keywords and the value of each keyword from the input data;
a lookup unit configured to: searching the plurality of keywords and the interface condition met by the value of each keyword in the node configuration file;
a second interface determination unit configured to: and determining the interface corresponding to the searched interface condition as the interface which needs to be called for executing the test case at the node to be tested.
In one embodiment, the interface calling module 550 includes:
an assignment unit configured to: assigning values to parameters in the interface according to the input data;
a request initiation unit configured to: initiating a data request through the interface which has completed the assignment;
a receiving unit configured to: receiving target data corresponding to the input data returned through the interface.
In an embodiment, the node testing apparatus based on the interface prediction model further includes:
a test record generation module configured to: generating a test record of the test case according to the input data corresponding to the test case, the node identification of the node to be tested, the determined interface, the target data and the corresponding test result;
a test report generation module configured to: and forming a test report by storing the test records of the test cases.
The implementation process of the functions and actions of each module in the above device is specifically detailed in the implementation process of the corresponding step in the above node testing method, and is not described again here.
It is understood that these modules may be implemented in hardware, software, or a combination of both. When implemented in hardware, these modules may be implemented as one or more hardware modules, such as one or more application specific integrated circuits. When implemented in software, the modules may be implemented as one or more computer programs executing on one or more processors, such as programs stored in memory 250 for execution by central processor 270 of FIG. 2.
Optionally, the present disclosure further provides a node testing apparatus based on an interface prediction model, which may be deployed in the testing server 300 shown in fig. 1, and perform all or part of the steps of any one of the node testing methods in the foregoing method embodiments. As shown in fig. 11, the node test apparatus 1000 includes:
a processor 1001; and
memory 1002, the memory 1002 having stored thereon computer readable instructions which, when executed by the processor 1001, implement the method of any of the above method implementations.
Wherein the executable instructions, when executed by the processor 1001, implement the method in any of the above embodiments. Such as computer readable instructions, which when executed by the processor 1001, read stored in the memory via the communication line/bus 1003 connected to the memory.
The specific manner in which the processor of the apparatus in this embodiment performs the operations has been described in detail in the embodiment related to the node testing method, and will not be elaborated upon here.
In an exemplary embodiment, a computer-readable storage medium is also provided, on which a computer program is stored which, when being executed by a processor, carries out the method in any of the above method embodiments. Wherein the computer readable storage medium, such as the memory 250, includes a computer program, the instructions executable by the central processor 270 of the server 200 to implement the methods described above.
The specific manner in which the processor in this embodiment performs operations has been described in detail in the embodiment of the interface prediction model-based node testing method, and will not be described in detail here.
It will be understood that the invention is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the invention is limited only by the appended claims.

Claims (9)

1. A node testing method based on an interface prediction model is characterized by comprising the following steps:
acquiring an input test case, wherein the test case comprises a node identification corresponding to a node to be tested and input data in the node to be tested;
inputting the input data and the node identification into an interface prediction model, wherein the interface prediction model is a neural network model for predicting an interface to be called at each node; in the interface prediction model, determining a plurality of interfaces available for calling at the test node according to the node identification; constructing a feature vector of the input data; performing classification prediction according to the feature vectors to obtain the probability of the feature vectors corresponding to each of the plurality of interfaces; traversing the probability of each interface, and determining the interface corresponding to the maximum probability as the interface which needs to be called for executing the test case at the test node;
calling the determined interface to return target data corresponding to the input data through the interface;
and obtaining the test result of the test case according to the target data and the expected data set for the test case.
2. The method of claim 1, wherein the inputting the input data and the node identification into an interface prediction model, the method further comprising, before predicting, by the interface prediction model, an interface that needs to be invoked at the test node to execute the test case, the method further comprising:
obtaining a plurality of sample test cases and an interface label determined by marking each sample test case;
extracting node identification corresponding to a node to be tested in the sample test case and sample input data in the node to be tested from each sample test case;
and training the interface prediction model through the node identification of the node to be tested corresponding to each sample test case, the corresponding sample input data and the corresponding interface label until the prediction precision of the interface prediction model reaches the set precision.
3. The method of claim 1, wherein the obtaining of the input test case includes a node identifier corresponding to a node to be tested and input data in the node to be tested, and the method further includes:
acquiring a node configuration file configured for the node to be tested from a configuration file according to the node identification, wherein the configuration file is obtained by configuration according to the data trend of each node in the service flow;
and determining an interface which needs to be called for executing the test case at the test node according to the input data and the interface condition in the node configuration file.
4. The method of claim 3, wherein determining the interface at the test node that needs to be invoked to execute the test case based on the input data and the interface condition in the node configuration file comprises:
extracting a plurality of keywords and the value of each keyword from the input data;
searching the plurality of keywords and the interface condition met by the value of each keyword in the node configuration file;
and determining the interface corresponding to the searched interface condition as the interface which needs to be called for executing the test case at the node to be tested.
5. The method of claim 1, wherein the invoking the determined interface to return target data corresponding to the input data through the interface comprises:
assigning values to parameters in the interface according to the input data;
initiating a data request through the interface which has completed assignment;
receiving target data corresponding to the input data returned through the interface.
6. The method according to claim 1, wherein after obtaining the test result of the test case according to the target data and the expected data set for the test case, the method further comprises:
generating a test record of the test case according to the input data corresponding to the test case, the node identification of the node to be tested, the determined interface, the target data and the corresponding test result;
and forming a test report by storing the test records of the test cases.
7. A node testing device based on an interface prediction model is characterized by comprising:
an acquisition module configured to: acquiring an input test case, wherein the test case comprises a node identifier corresponding to a node to be tested and input data in the node to be tested;
an interface determination module configured to: inputting the input data and the node identification into an interface prediction model, wherein the interface prediction model is a neural network model for predicting an interface to be called at each node; in the interface prediction model, determining a plurality of interfaces available for calling at the test node according to the node identification; constructing a feature vector of the input data; performing classification prediction according to the feature vectors to obtain the probability of the feature vectors corresponding to each of the plurality of interfaces; traversing the probability of each interface, and determining the interface corresponding to the maximum probability as the interface which needs to be called for executing the test case at the test node;
an interface call module configured to: calling the determined interface to return target data corresponding to the input data through the interface;
a test result obtaining module configured to: and obtaining a test result of the test case according to the target data and the expected data set for the test case.
8. A node testing device based on an interface prediction model is characterized by comprising:
a processor; and
a memory having computer readable instructions stored thereon which, when executed by the processor, implement the method of any of claims 1 to 6.
9. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the method according to any one of claims 1 to 6.
CN201910303832.3A 2019-04-16 2019-04-16 Node testing method and device based on interface prediction model Active CN110177006B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910303832.3A CN110177006B (en) 2019-04-16 2019-04-16 Node testing method and device based on interface prediction model

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910303832.3A CN110177006B (en) 2019-04-16 2019-04-16 Node testing method and device based on interface prediction model

Publications (2)

Publication Number Publication Date
CN110177006A CN110177006A (en) 2019-08-27
CN110177006B true CN110177006B (en) 2022-12-30

Family

ID=67689607

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910303832.3A Active CN110177006B (en) 2019-04-16 2019-04-16 Node testing method and device based on interface prediction model

Country Status (1)

Country Link
CN (1) CN110177006B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112631930B (en) * 2020-12-30 2024-06-21 平安证券股份有限公司 Dynamic system testing method and related device

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101330329A (en) * 2008-07-29 2008-12-24 中兴通讯股份有限公司 Self-adapting testing method and system
CN104077218A (en) * 2013-03-29 2014-10-01 百度在线网络技术(北京)有限公司 Test method and device of MapReduce distributed system
CN109491922A (en) * 2018-12-13 2019-03-19 北京轩宇信息技术有限公司 One kind being based on model-driven test method and apparatus

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10496927B2 (en) * 2014-05-23 2019-12-03 DataRobot, Inc. Systems for time-series predictive data analytics, and related methods and apparatus

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101330329A (en) * 2008-07-29 2008-12-24 中兴通讯股份有限公司 Self-adapting testing method and system
CN104077218A (en) * 2013-03-29 2014-10-01 百度在线网络技术(北京)有限公司 Test method and device of MapReduce distributed system
CN109491922A (en) * 2018-12-13 2019-03-19 北京轩宇信息技术有限公司 One kind being based on model-driven test method and apparatus

Also Published As

Publication number Publication date
CN110177006A (en) 2019-08-27

Similar Documents

Publication Publication Date Title
CN111340237B (en) Data processing and model running method, device and computer equipment
CN110554958B (en) Graph database testing method, system, device and storage medium
CN111080304B (en) Credible relationship identification method, device and equipment
CN104252481A (en) Dynamic check method and device for consistency of main and salve databases
WO2019100635A1 (en) Editing method and apparatus for automated test script, terminal device and storage medium
CN114237754B (en) Data loading method and device, electronic equipment and storage medium
CN114968816A (en) Data simulation-based strategy testing method, device, equipment and storage medium
CN110177006B (en) Node testing method and device based on interface prediction model
CN111949530B (en) Test result prediction method and device, computer equipment and storage medium
CN112199715B (en) Object generation method based on block chain and cloud computing and digital financial service center
CN113468017A (en) Online service state detection method applied to block chain and service server
CN113516251A (en) Machine learning system and model training method
CN116501979A (en) Information recommendation method, information recommendation device, computer equipment and computer readable storage medium
CN116561003A (en) Test data generation method, device, computer equipment and storage medium
CN110716778A (en) Application compatibility testing method, device and system
CN115757172A (en) Test execution method and device, storage medium and computer equipment
CN113032547B (en) Big data processing method and system based on artificial intelligence and cloud platform
CN111741526B (en) Positioning method, positioning device, electronic equipment and computer storage medium
CN113628077A (en) Method for generating non-repeated examination questions, terminal and readable storage medium
CN112559589A (en) Remote surveying and mapping data processing method and system
CN112015659A (en) Prediction method and device based on network model
CN112600282B (en) Intelligent solar luggage charging and discharging control method and system
CN116401113B (en) Environment verification method, device and medium for heterogeneous many-core architecture acceleration card
CN113448733B (en) Data processing method and system
CN117313856B (en) Reliability test planning system and method

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
CB02 Change of applicant information

Address after: 201, room 518000, building A, No. 1, front Bay Road, Qianhai Shenzhen Guangdong Shenzhen Hong Kong cooperation zone (Qianhai business secretary)

Applicant after: PING AN PUHUI ENTERPRISE MANAGEMENT Co.,Ltd.

Address before: 518000 Guangdong city of Shenzhen province Qianhai Shenzhen Hong Kong cooperation zone before Bay Road No. 1 building 201 room A

Applicant before: PING AN PUHUI ENTERPRISE MANAGEMENT Co.,Ltd.

CB02 Change of applicant information
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant