CN110377471B - Interface verification data generation method and device, storage medium and electronic equipment - Google Patents

Interface verification data generation method and device, storage medium and electronic equipment Download PDF

Info

Publication number
CN110377471B
CN110377471B CN201910647207.0A CN201910647207A CN110377471B CN 110377471 B CN110377471 B CN 110377471B CN 201910647207 A CN201910647207 A CN 201910647207A CN 110377471 B CN110377471 B CN 110377471B
Authority
CN
China
Prior art keywords
data
interface
verification
target field
returned
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
CN201910647207.0A
Other languages
Chinese (zh)
Other versions
CN110377471A (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.)
Jiangsu Manyun Software Technology Co Ltd
Original Assignee
Jiangsu Manyun Software 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 Jiangsu Manyun Software Technology Co Ltd filed Critical Jiangsu Manyun Software Technology Co Ltd
Priority to CN201910647207.0A priority Critical patent/CN110377471B/en
Publication of CN110377471A publication Critical patent/CN110377471A/en
Application granted granted Critical
Publication of CN110377471B publication Critical patent/CN110377471B/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/22Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing
    • G06F11/2205Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing using arrangements specific to the hardware being tested
    • G06F11/221Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing using arrangements specific to the hardware being tested to test buses, lines or interfaces, e.g. stuck-at or open line faults
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/22Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing
    • G06F11/2247Verification or detection of system hardware configuration

Landscapes

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

Abstract

The embodiment of the application discloses a method and a device for generating interface verification data, a storage medium and electronic equipment. The method comprises the following steps: responding to a verification data generation request, and acquiring data returned by an interface at least twice within a preset time period; determining a check target field and check target field content of the interface returned data according to the data returned by the interface at least twice; and generating verification data according to the verification target field and the content of the verification target field. By operating the technical scheme provided by the application, the purpose of quickly generating the interface verification data can be realized, so that the interface is detected through the interface verification data, and the interface detection efficiency and the detection quality are improved.

Description

Interface verification data generation method and device, storage medium and electronic equipment
Technical Field
The embodiment of the application relates to the technical field of data communication, in particular to a method and a device for generating interface verification data, a storage medium and electronic equipment.
Background
With the development of computer technology, more and more businesses are implemented by computer programs, such as financial services, social services, online shopping, and the like, and data interaction between various business services, such as interaction between the interior of a business system and interaction between the business system and a user, is implemented by calling various interfaces defined in advance. In order to ensure that various interfaces can meet the requirements for data interaction, the interfaces need to be tested after being developed.
In the existing interface testing method, a verification scheme is that a certain interface is requested, and a user determines whether the interface works normally by observing a return result in the interface so as to complete the test of the interface. The efficiency of such detection is extremely low and, due to the need for manual intervention, errors in the detection result can result. And the data format change returned by one interface is frequent, if the interface verification data can be quickly compiled aiming at the interface, and then the data returned by the interface is detected through the interface verification data, the labor cost can be greatly reduced. However, how to generate the interface verification data is a technical problem to be solved urgently at present.
Disclosure of Invention
The embodiment of the application provides a method and a device for generating interface verification data, a storage medium and electronic equipment, so as to achieve the purpose of quickly generating the interface verification data, detect an interface through the interface verification data, and improve the interface detection efficiency and the detection quality.
In a first aspect, an embodiment of the present application provides a method for generating interface verification data, where the method includes:
responding to a verification data generation request, and acquiring data returned by an interface at least twice within a preset time period;
determining a check target field and check target field content of the interface returned data according to the data returned by the interface at least twice;
and generating verification data according to the verification target field and the verification target field content.
Further, after generating the verification data according to the verification target field and the content of the verification target field, the method further includes:
and verifying the data to be verified returned by the interface through the verification data so as to detect the interface.
Further, the checking the data to be checked returned from the interface by the checking data to detect the interface includes:
determining a data content identification position of the data to be verified returned by the interface according to a verification target field of the verification data;
and judging whether the field content in the data content identification position is consistent with the field content of the verification target, and if so, determining that the interface detection result is qualified.
Further, after determining whether the field content in the data content identification location is consistent with the verification target field content, the method further includes:
if not, determining that the interface detection result is unqualified, and recording the data to be verified.
Further, according to the data returned by the interface at least twice, determining a check target field and check target field content of the data returned by the interface, including:
carrying out consistency filtering on data returned by the interface at least twice;
determining the fields passing the consistency filtering as verification target fields; determining the fields which do not pass the consistency filtering as filtered fields;
and determining the field content of the verification target field as the verification target field content.
Further, the criteria for the consistent filtering include: determining at least two fields to be filtered by adopting a preset rule for data returned by the interface at least twice, and if the contents of the corresponding fields to be filtered among different data are the same, determining that the fields to be filtered pass consistency filtering; if not, determining that the field to be filtered does not pass consistency filtering.
Further, after generating the verification data according to the verification target field and the content of the verification target field, the method further includes:
storing the verification data into a database; detecting whether an interface parameter updating event exists or not;
and if so, updating the check data stored in the database.
In a second aspect, an embodiment of the present application provides an apparatus for generating interface verification data, where the apparatus includes:
the data acquisition module is used for responding to the check data generation request and acquiring data returned by the interface at least twice within a preset time period;
the verification information determining module is used for determining a verification target field and verification target field content of the interface returned data according to the data returned by the interface at least twice;
and the verification data generation module is used for generating verification data according to the verification target field and the content of the verification target field.
In a third aspect, an embodiment of 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 implement the method for generating interface verification data according to the embodiment of the present application.
In a fourth 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 by the processor, where the processor executes the computer program to implement the method for generating interface verification data according to the embodiment of the present application.
According to the technical scheme provided by the embodiment of the application, the data returned by the interface at least twice is acquired within the preset time period in response to the verification data generation request; determining a check target field and check target field content of the interface returned data according to the data returned by the interface at least twice; and generating verification data according to the verification target field and the verification target field content. By adopting the technical scheme provided by the application, the purpose of quickly generating the interface verification data can be realized, so that the interface is detected through the interface verification data, and the interface detection efficiency and the detection quality are improved.
Drawings
Fig. 1 is a flowchart of a method for generating interface verification data according to an embodiment of the present application;
FIG. 2 is a flow chart of interface detection provided in an embodiment of the present application;
fig. 3 is a schematic structural diagram of a device for generating interface verification data according to a third embodiment of the present application;
fig. 4 is a schematic structural diagram of an electronic device according to a fifth embodiment of the present application.
Detailed Description
The present application will be described in further detail with reference to the following drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the application and are not limiting of the application. It should be further noted that, for the convenience of description, only some of the structures related to the present application are shown in the drawings, not all of the structures.
Before discussing exemplary embodiments in more detail, it should be noted that some exemplary embodiments are described as processes or methods depicted as flowcharts. Although a flowchart may describe the steps as a sequential process, many of the steps can be performed in parallel, concurrently or simultaneously. In addition, the order of the steps may be rearranged. The process may be terminated when its operations are completed, but could have additional steps not included in the figure. The processes may correspond to methods, functions, procedures, subroutines, and the like.
Example one
Fig. 1 is a flowchart of a method for generating interface verification data according to an embodiment of the present application, where the present embodiment is suitable for interface monitoring and the like, and the method may be executed by an apparatus for generating interface verification data according to an embodiment of the present application, where the apparatus may be implemented by software and/or hardware, and may be integrated in an electronic device such as an interface detection device.
As shown in fig. 1, the method for generating the interface verification data includes:
and S110, responding to the verification data generation request, and acquiring data returned by the interface at least twice in a preset time period.
The check data generation request may be sent through the interface detection device or the interface detection platform. Because the check data for detecting the data returned by the interface in the prior art is written manually, the labor cost is high, the interface detection efficiency is influenced, and particularly under the condition of more interfaces, the interface detection speed and the detection quality can be greatly influenced by writing the check data. The scheme provides a scheme for automatically generating the interface detection data, and the advantages of the scheme are that the check data can be rapidly generated and used, and the detection efficiency of the interface is improved.
The preset time period may be 3 seconds, 1 second or other time, and the shorter the time interval between the acquisition of the data returned at least twice in the preset time period, the higher the stability of the data returned by the interface. For example, for an interface, a certain specific data is returned by the interface, if the detection time is long, the interface may affect the stability of the returned data due to a problem of a multiplexing function and the like, and in a short time, the problem that the difference between the returned data is large generally does not occur. In addition, since the parameters of the interface can be adjusted even if the version is updated or the demand changes, the data returned by the interface is acquired twice or more in a short time, and the change of the structure or content of the returned data due to the update of the parameters can be avoided. It will be appreciated that the present scheme may collect data returned three or more times.
And S120, determining a verification target field and verification target field content of the interface returned data according to the data returned by the interface at least twice.
In this technical solution, it can be understood that the data returned by the interface may be data returned for the same request, for example, if the same request is sent twice, the data returned by the interface may have consistency in the data content portion. In addition, the interface may return data only for a certain request, for example, the current interface returns only data of "item details". The data returned by the interface may include multiple fields, each of which may represent different content. For example, a time field, a sequence number field, a content field, etc. may be included. The set algorithm can determine which field contents are consistent and which field contents are different in the fields contained by the acquired at least two pieces of return data. For example, taking the example of including the time field, the sequence number field and the content field, the time field contents of the two returned data are different because the times of the two returned data are different, and the two data have different numbers, so the sequence number field is also different, but the content of the content field is the same because the two data are returned for the same request or the same content is returned, for example, "order information" is both returned. Thus, it can be determined that the check data of this interface can be checked against the content field, and thus the content field can be determined as the check target field. Meanwhile, if the data returned by the interface is order information, the order information returned every time should be the same, so that the specific content of the content field can be determined as the content of the verification target field.
And S130, generating verification data according to the verification target field and the verification target field content.
After the verification target field and the content of the verification target field are determined, verification data can be generated according to the determined verification target field and the content of the verification target field. The check field can be generated in an automatic coding mode according to the check target field and the contents of the check target field, and one of the two returned data can be directly used as the check data. Through the arrangement, a worker does not need to manually write the verification data, so that the labor consumption of interface verification can be reduced, and the accuracy of the verification data can be ensured because the verification data is automatically generated according to the data returned by the interface. Meanwhile, if the check data needs to be modified due to the change of the interface parameters, the steps can be repeated to obtain new check data, the method is simple, convenient and flexible, corresponding check data can be generated in time, and the maintenance cost of the check data can be reduced.
In this embodiment, optionally, after generating the verification data according to the verification target field and the content of the verification target field, the method further includes: and verifying the data to be verified returned by the interface through the verification data so as to detect the interface. Because the verification target field and the content of the verification target field are known, the verification target field of the data can be determined to be compared with the verification data in the process that the data returned by the interface is verified, if the data returned by the interface is consistent with the verification data, the data returned by the interface can be determined to be in accordance with the standard, and the interface can be considered to be qualified in verification. The advantage of this arrangement is that the accuracy of the interface verification can be improved and the verification efficiency can be improved.
According to the technical scheme provided by the embodiment of the application, the data returned by the interface at least twice is acquired within the preset time period in response to the verification data generation request; determining a check target field and check target field content of the interface returned data according to the data returned by the interface at least twice; and generating verification data according to the verification target field and the verification target field content. By adopting the technical scheme provided by the application, the purpose of quickly generating the interface verification data can be realized, so that the interface is detected through the interface verification data, and the interface detection efficiency and the detection quality are improved.
On the basis of the foregoing technical solutions, optionally, after generating the verification data according to the verification target field and the content of the verification target field, the method further includes: storing the verification data into a database; detecting whether an interface parameter updating event exists or not; and if so, updating the check data stored in the database. The interface verification platform can be sent to a network database through a network, and can also be stored in a local database of the interface verification platform. For example, the stored verification data may be stored corresponding to the number of the current interface, and during the use process, it may be determined which verification data is used to verify the interface according to the number of the interface. In this technical solution, optionally, when it is detected that an update event exists in the interface parameter, the check data stored in the database is updated. The interface parameter update event may be an update of a parameter of the interface caused by an update of an application program, or an update caused by other reasons. In this embodiment, a time length may be set, for example, 7 days or 15 days, and when the verification data is generated for 7 days or 15 days, even if the update of the interface parameter is not detected, the verification data stored in the database needs to be updated. The advantage of this setting is that can improve the accuracy of the check-up result of interface check-up data. Specifically, the verification data may be regenerated and stored in the database to update the original verification data, where the way of regenerating the verification data is the same as that described above. The method has the advantages that the generated and used check data can be ensured to be effective, the abnormal phenomenon that the returned check data are all wrong in the process of checking the data returned by the interface due to the error of the check data is avoided, and therefore the accuracy of interface detection can be ensured.
On the basis of the above technical solutions, optionally, determining the verification target field and the verification target field content of the interface returned data according to the data returned by the interface at least twice, includes: carrying out consistency filtering on data returned by the interface at least twice; determining the fields passing the consistency filtering as verification target fields; determining the fields which do not pass the consistency filtering as filtered fields; and determining the field content of the verification target field as the verification target field content. The consistent fields and the inconsistent fields of the returned data at least twice can be determined through consistency filtering, the inconsistent fields are filtered out, the consistent fields are determined as the verification target fields, and the content in the consistent fields is determined as the content of the verification target fields. According to the technical scheme, the consistency between at least two data returned by the interface is determined by taking the field as a unit, the verification object and the verification content of the verification data to be generated can be determined, and the verification data can be generated based on a specific one or more verification fields, so that the verification data can be accurately and automatically generated, manual writing by workers is not needed, and the workload of the workers is reduced.
On the basis of the above technical solutions, optionally, the criteria of the consistency filtering include: determining at least two fields to be filtered by adopting a preset rule for data returned by the interface at least twice, and if the contents of the corresponding fields to be filtered among different data are the same, determining that the fields to be filtered pass consistency filtering; if not, determining that the field to be filtered does not pass consistency filtering. The consistency filtering criterion may be that the data returned at least twice is classified into a plurality of fields to be filtered in the same manner, and the plurality of fields to be filtered between two returned data are compared, for example, the field 1 of the first data is compared with the field 1 of the second data, and the field 2 of the first data is compared with the field 2 of the second data, so as to obtain a comparison result. And if the comparison result shows that the contents of the two fields are the same, determining that the consistency filtering is passed, and if the contents of the two fields are different, determining that the consistency filtering is not passed. The method has the advantages that the verification target field and the content of the verification target field can be determined based on consistency filtering, and then the verification data can be generated.
Fig. 2 is a flowchart of interface detection according to an embodiment of the present application. As shown in fig. 2, the process includes:
s210, responding to the verification data generation request, and acquiring data returned by the interface at least twice in a preset time period.
S220, according to the data returned by the interface at least twice, determining a verification target field and verification target field content of the data returned by the interface.
And S230, generating verification data according to the verification target field and the content of the verification target field.
S240, determining the data content identification position of the data to be verified returned by the interface according to the verification target field of the verification data.
The data returned by the interface is checked, and the check of all fields is not required to be performed on the data returned by the interface, and the check of part of fields can be performed. Therefore, before the data to be verified is verified, the verified field position, namely the data content identification position, can be preferentially determined. It is understood that all fields of the data to be checked may also be checked, and accordingly, different fields of the checked data may be recorded and a report may be generated. The staff member can determine the verification result of the data to be verified by checking the report and determining whether the contents of the verification target field are included therein.
And S250, judging whether the field content in the data content identification position is consistent with the field content of the verification target, and if so, determining that the interface detection result is qualified.
After the data content identification position is determined, whether the field content in the data content identification position is consistent with the field content of the verification target or not can be judged, and if the field content is completely consistent with the field content of the verification target, the verification result returned by the interface is determined to be qualified. And then the detected interface can be determined to meet the detection requirement.
In this technical solution, optionally, after determining whether the field content in the data content identification location is consistent with the field content of the verification target, the method further includes: if not, determining that the interface detection result is unqualified, and recording the data to be verified. If the field content of the verification target is inconsistent with the field content in the content identification position, the result of the data verification is inconsistent, and the data to be verified is recorded. For example, a record table may be generated for calculating all inconsistent data to be checked. And the ratio of the inconsistent data to be verified to the total data to be verified is counted. The advantage of setting up like this can supply the statistical result that produces to the staff and refer to, confirm whether for this check-up data have the problem to can assist the staff in time to discover the problem and confirm the place of problem, help improving staff's work efficiency in the interface testing process.
On the basis of the technical schemes, the technical scheme discloses a mode of detecting the interface by checking data, namely, whether the data to be checked is consistent with the check target field of the check data and the content of the check target field is determined, and the check result of the data to be checked is counted, so that the accuracy of the monitoring process of the interface is improved, meanwhile, data analysis basis can be provided for workers, and the workers are assisted to improve the working efficiency.
Example two
In order to make the technical solution disclosed in the present application more clear to those skilled in the art, the present application also provides a preferred embodiment.
At present, the defects of the prior art are as follows:
the whole process needs artificial participation to judge the result of the interface, write the check data of the interface, and artificially change the former old data after the return format of the interface is changed.
The technical problem that this application will solve is:
the intelligent interface verification method has the advantages that the full amount of interface verification data is generated intelligently, unnecessary items are filtered automatically, meanwhile, the manual intervention is supported, and the intervention and the editing are carried out on special data.
By the scheme, in the interface testing process, a user carries out intelligent interface automatic testing in different modes, such as G & A, ASSERT and GENERATE. Wherein GENERATE is a generation mode, check data of the interface is automatically generated, ASSERT is an assertion mode, the check data generated by GENERATE are compared, a comparison result is returned, error data are highlighted, and G & A is the combination of the two modes.
And data are returned aiming at some special interfaces, a user can also delete the check data in a self-defined mode or the editor declares the type, and the method is more flexible.
The technical scheme provided by the application can comprise a control module, a generation module, an assertion module, a generation and assertion module and an editing/storing module.
A control module: actually, there are 3 modes, GENERATE mode, ASSERT mode and G & A mode together, and the user selects the expected operation for the interface to run by selecting different modes.
A generation module: when the user selects the GENERATE mode to run, namely, the user jumps to a generation module, in the module, continuously runs the interface twice by ensuring the interface to be consistent under the condition of parameter consistency, compares the running results of the two times layer by an algorithm, keeps the fields which are consistent in running twice, and rejects inconsistent data such as serial numbers, time and the like. And generating verification data and an assertion mode, and storing the result in a database as the verification template data of the interface.
An assertion module: by operating the interface and applying an algorithm, comparing layer by layer, comparing the numerical value of each field of each layer with the data in the check template of the interface one by one, recording inconsistent data, highlighting and returning to the user for informing.
A generation and assertion module: and directly and sequentially calling the generation module and the assertion module to check the check result of the interface.
The editing/storage module user can directly perform operations such as addition, deletion, change and the like on the verification template data of the interface, flexibly change the verification data, simultaneously support the change of the assertion type, and finally store the template result in the database.
According to the technical scheme, the full amount of data needing to be checked in the interface can be generated intelligently and compared, and a user can carry out custom editing. The automatic generation of the verification data can be realized, the user definition is supported, the test accuracy and the integrity of the interface are improved, and the effect of missing test or wrong test brought by personal operation is reduced.
EXAMPLE III
Fig. 3 is a schematic structural diagram of a device for generating interface verification data according to a third embodiment of the present application. As shown in fig. 3, the apparatus for generating interface verification data includes:
the data acquisition module 310 is configured to, in response to the check data generation request, acquire data returned by the interface at least twice within a preset time period;
the verification information determining module 320 is configured to determine, according to the data returned by the interface at least twice, a verification target field and verification target field content of the data returned by the interface;
and the verification data generation module 330 is configured to generate verification data according to the verification target field and the content of the verification target field.
According to the technical scheme provided by the embodiment of the application, the data returned by the interface at least twice is acquired within the preset time period in response to the verification data generation request; determining a check target field and check target field content of the interface returned data according to the data returned by the interface at least twice; and generating verification data according to the verification target field and the verification target field content. By adopting the technical scheme provided by the application, the purpose of quickly generating the interface verification data can be realized, so that the interface is detected through the interface verification data, and the interface detection efficiency and the detection quality are improved.
The product can operate the method provided by any embodiment of the application, and has the corresponding functional modules and beneficial effects of the operation method.
Example four
Embodiments of the present application further provide a storage medium containing computer executable instructions, which when executed by a computer processor, are configured to execute a method for generating interface verification data, the method including:
responding to a verification data generation request, and acquiring data returned by an interface at least twice within a preset time period;
determining a check target field and the contents of the check target field of the interface returned data according to the data returned by the interface at least twice;
and generating verification data according to the verification target field and the content of the verification target field.
Storage medium-any of various types of memory devices or storage devices. The term "storage medium" is intended to include: mounting media such as CD-ROM, floppy disk, or tape devices; computer system memory or random access memory such as DRAM, DDR RAM, SRAM, EDO RAM, Lanbas (Rambus) RAM, etc.; non-volatile memory such as flash memory, magnetic media (e.g., hard disk or optical storage); registers or other similar types of memory elements, etc. The storage medium may also include other types of memory or combinations thereof. In addition, the storage medium may be located in the computer system in which the program is executed, or may be located in a different second computer system connected to the computer system through a network (such as the internet). The second computer system may provide the program instructions to the computer for execution. The term "storage medium" may include two or more storage media that may reside in different locations, such as in different computer systems that are connected by a network. The storage medium may store program instructions (e.g., embodied as a computer program) that are executable by one or more processors.
Of course, the storage medium containing the computer executable instructions provided in the embodiments of the present application is not limited to the generation operation of the interface verification data described above, and may also execute the relevant operations in the generation method of the interface verification data provided in any embodiments of the present application.
EXAMPLE five
The embodiment of the application provides electronic equipment, and the electronic equipment can be integrated with the generation device of the interface verification data provided by the embodiment of the application. Fig. 4 is a schematic structural diagram of an electronic device according to a fifth embodiment of the present application. As shown in fig. 4, the present embodiment provides an electronic device 400, which includes: one or more processors 420; the storage device 410 is configured to store one or more programs, and when the one or more programs are executed by the one or more processors 420, the one or more processors 420 implement the method for generating interface verification data provided in the embodiment of the present application, where the method includes:
responding to a verification data generation request, and acquiring data returned by an interface at least twice within a preset time period;
determining a check target field and check target field content of the interface returned data according to the data returned by the interface at least twice;
and generating verification data according to the verification target field and the verification target field content.
Of course, those skilled in the art can understand that the processor 420 may also implement the technical solution of the interface verification data generation method provided in any embodiment of the present application.
The electronic device 400 shown in fig. 4 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present application.
As shown in fig. 4, the electronic device 400 includes a processor 420, a storage device 410, an input device 430, and an output device 440; the number of the processors 420 in the electronic device may be one or more, and one processor 420 is taken as an example in fig. 4; the processor 420, the storage device 410, the input device 430, and the output device 440 in the electronic apparatus may be connected by a bus or other means, and are exemplified by a bus 450 in fig. 4.
The storage device 410 is a computer-readable storage medium, and can be used to store software programs, computer executable programs, and module units, such as program instructions corresponding to the interface verification data generation method in the embodiment of the present application.
The storage device 410 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function; the storage data area may store data created according to the use of the terminal, and the like. Further, the storage 410 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid state storage device. In some examples, storage 410 may further include memory located remotely from processor 420, which may be connected via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The input means 430 may be used to receive input numbers, character information, or voice information, and to generate key signal inputs related to user settings and function control of the electronic device. The output device 440 may include a display screen, speakers, etc.
The electronic equipment provided by the embodiment of the application can realize the purpose of quickly generating the interface verification data, so that the interface is detected through the interface verification data, and the interface detection efficiency and the detection quality are improved.
The interface verification data generation device, the storage medium and the electronic device provided in the above embodiments may operate the interface verification data generation method provided in any embodiment of the present application, and have a functional module and a beneficial effect corresponding to the operation of the method. For the technical details that are not described in detail in the above embodiments, reference may be made to the method for generating interface verification data provided in any embodiment of the present application.
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present application and the technical principles employed. Those skilled in the art will appreciate that the present application is not limited to the particular embodiments described herein, but is capable of many obvious modifications, rearrangements and substitutions without departing from the scope of the application. Therefore, although the present application has been described in more detail with reference to the above embodiments, the present application is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present application, and the scope of the present application is determined by the scope of the appended claims.

Claims (9)

1. A method for generating interface verification data is characterized by comprising the following steps:
responding to a verification data generation request, and acquiring data returned by an interface at least twice within a preset time period;
determining a check target field and check target field content of the interface returned data according to the data returned by the interface at least twice;
generating verification data according to the verification target field and the content of the verification target field;
determining a check target field and check target field content of the interface returned data according to the data returned by the interface at least twice, including:
carrying out consistency filtering on data returned by the interface at least twice;
determining the fields passing the consistency filtering as checking target fields; determining the fields which do not pass the consistency filtering as filtered fields;
and determining the field content of the verification target field as the verification target field content.
2. The method of claim 1, wherein after generating verification data based on the verification target field and verification target field contents, the method further comprises:
and verifying the data to be verified returned by the interface through the verification data so as to detect the interface.
3. The method according to claim 2, wherein the checking the data to be checked returned from the interface by the checking data to detect the interface comprises:
determining a data content identification position of the data to be verified returned by the interface according to a verification target field of the verification data;
and judging whether the field content in the data content identification position is consistent with the field content of the verification target, and if so, determining that the interface detection result is qualified.
4. The method of claim 3, wherein after determining whether the field content in the data content identification location is consistent with the verification target field content, the method further comprises:
if not, determining that the interface detection result is unqualified, and recording the data to be verified.
5. The method of claim 1, wherein the criteria for the consistency filter comprises: determining at least two fields to be filtered by adopting a preset rule for data returned by the interface at least twice, and if the contents of the corresponding fields to be filtered among different data are the same, determining that the fields to be filtered pass consistency filtering; if not, determining that the field to be filtered does not pass consistency filtering.
6. The method of claim 1, wherein after generating verification data based on the verification target field and verification target field contents, the method further comprises:
storing the verification data into a database; detecting whether an interface parameter updating event exists or not;
and if so, updating the check data stored in the database.
7. An apparatus for generating interface verification data, comprising:
the data acquisition module is used for responding to the check data generation request and acquiring data returned by the interface at least twice within a preset time period;
the verification information determining module is used for determining a verification target field and verification target field content of the interface returned data according to the data returned by the interface at least twice;
the verification data generation module is used for generating verification data according to the verification target field and the verification target field content;
determining a check target field and check target field content of interface return data, including:
carrying out consistency filtering on data returned by the interface at least twice;
determining the fields passing the consistency filtering as verification target fields; determining the fields which do not pass the consistency filtering as filtered fields;
and determining the field content of the verification target field as the verification target field content.
8. A computer-readable storage medium, on which a computer program is stored, which program, when being executed by a processor, carries out a method of generating interface verification data according to any one of claims 1 to 6.
9. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the method for generating interface verification data according to any one of claims 1 to 6 when executing the computer program.
CN201910647207.0A 2019-07-17 2019-07-17 Interface verification data generation method and device, storage medium and electronic equipment Active CN110377471B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910647207.0A CN110377471B (en) 2019-07-17 2019-07-17 Interface verification data generation method and device, storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910647207.0A CN110377471B (en) 2019-07-17 2019-07-17 Interface verification data generation method and device, storage medium and electronic equipment

Publications (2)

Publication Number Publication Date
CN110377471A CN110377471A (en) 2019-10-25
CN110377471B true CN110377471B (en) 2022-08-23

Family

ID=68253747

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910647207.0A Active CN110377471B (en) 2019-07-17 2019-07-17 Interface verification data generation method and device, storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN110377471B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112733083B (en) * 2019-10-28 2023-08-18 中国移动通信集团湖南有限公司 Data verification method, system and device
CN111966815B (en) * 2020-07-03 2023-12-19 北京旷视科技有限公司 Data verification template generation method and device and electronic system
CN111897687B (en) * 2020-08-19 2024-04-26 百度时代网络技术(北京)有限公司 Interface verification method, device, equipment and storage medium
CN115828322A (en) * 2022-11-25 2023-03-21 中电金信软件(上海)有限公司 Method and device for verifying integrity of data storage, electronic equipment and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107403112A (en) * 2017-07-31 2017-11-28 北京京东尚科信息技术有限公司 Data verification method and its equipment
CN108089985A (en) * 2017-12-14 2018-05-29 中国平安人寿保险股份有限公司 Method of calibration, device, equipment and the readable storage medium storing program for executing of interface return parameters
WO2018120722A1 (en) * 2016-12-30 2018-07-05 上海壹账通金融科技有限公司 Asynchronous interface testing method, terminal, device, system, and storage medium
CN108874679A (en) * 2018-06-28 2018-11-23 北京潘达互娱科技有限公司 interface test method and device

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2018120722A1 (en) * 2016-12-30 2018-07-05 上海壹账通金融科技有限公司 Asynchronous interface testing method, terminal, device, system, and storage medium
CN107403112A (en) * 2017-07-31 2017-11-28 北京京东尚科信息技术有限公司 Data verification method and its equipment
CN108089985A (en) * 2017-12-14 2018-05-29 中国平安人寿保险股份有限公司 Method of calibration, device, equipment and the readable storage medium storing program for executing of interface return parameters
CN108874679A (en) * 2018-06-28 2018-11-23 北京潘达互娱科技有限公司 interface test method and device

Also Published As

Publication number Publication date
CN110377471A (en) 2019-10-25

Similar Documents

Publication Publication Date Title
CN110377471B (en) Interface verification data generation method and device, storage medium and electronic equipment
CN111756575B (en) Performance analysis method and device of storage server and electronic equipment
CN111274154A (en) Automatic testing method, device, equipment and storage medium
CN112597014B (en) Automatic test method and device based on data driving, medium and electronic equipment
CN110008129B (en) Reliability test method, device and equipment for storage timing snapshot
CN110088744A (en) A kind of database maintenance method and its system
CN114201408A (en) Regression testing method, device, computer equipment and storage medium
CN111506509A (en) Automatic testing method, device, equipment and storage medium for automobile software unit
CN105279092A (en) Software testing method and apparatus
CN109884533B (en) Method and device for diagnosing battery fault, equipment and storage medium
CN117608903A (en) Method, device, equipment and storage medium for automatically generating test report
CN112148614B (en) Regression testing method and device
CN112506802A (en) Test data management method and system
CN115543234A (en) Log printing method and related device
CN106656684B (en) Grid resource reliability monitoring method and device
CN113238901B (en) Multi-device automatic testing method and device, storage medium and computer device
CN109522217A (en) The internal storage testing method and terminal device of application program
CN115203025A (en) Test defect analysis method and device
CN113849404A (en) Management method, device and storage medium for interface test related information
CN115185819A (en) System testing method, device, equipment and computer readable storage medium
CN103914377A (en) Interface testing method and device
CN110059012B (en) Program test control method, device, storage medium and platform
CN112256578B (en) Management method and system for test cases, electronic equipment and storage medium
CN112346994A (en) Test information correlation method and device, computer equipment and storage medium
CN110120044A (en) Article defects detection method and device, edge device, server

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