CN115629958A - Universal field level automatic checking method and device for different service interfaces - Google Patents

Universal field level automatic checking method and device for different service interfaces Download PDF

Info

Publication number
CN115629958A
CN115629958A CN202211097401.4A CN202211097401A CN115629958A CN 115629958 A CN115629958 A CN 115629958A CN 202211097401 A CN202211097401 A CN 202211097401A CN 115629958 A CN115629958 A CN 115629958A
Authority
CN
China
Prior art keywords
field
data type
response data
response
determining
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211097401.4A
Other languages
Chinese (zh)
Inventor
朱文豪
李俊
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Qichacha Technology Co ltd
Original Assignee
Qichacha 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 Qichacha Technology Co ltd filed Critical Qichacha Technology Co ltd
Priority to CN202211097401.4A priority Critical patent/CN115629958A/en
Publication of CN115629958A publication Critical patent/CN115629958A/en
Pending legal-status Critical Current

Links

Images

Classifications

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

Abstract

The present disclosure relates to a method, apparatus, computer device, storage medium and computer program product for universal field level automatic verification for different service interfaces. The method comprises the following steps: inputting test data to a service interface to be tested, and outputting a response result comprising a field through the service interface to be tested, wherein the field comprises a field name and a field numerical value; determining a response data type corresponding to the field name, wherein the response data type is obtained by classifying the field name according to the data format characteristics of the field; determining a check rule matched with the response data type; and checking the field value according to the checking rule to obtain a testing result of the service interface to be tested. By adopting the method, the manual workload can be reduced, and the efficiency of interface testing can be improved.

Description

Universal field level automatic checking method and device for different service interfaces
Technical Field
The present disclosure relates to the field of interface testing technologies, and in particular, to a method and an apparatus for automatic checking of a universal field level for different service interfaces, a computer device, and a storage medium.
Background
The test case generally comprises test input, execution conditions and expected results written by a writer, the test input is input to the service interface to be tested under the execution conditions, the result output by the service interface to be tested is compared with the expected results, and the performance index of the service interface to be tested is judged.
In the traditional technology, a writer needs to write test input, execution conditions and expected results manually according to a test purpose and a service interface to be tested, so that the workload is large and the efficiency is low.
Disclosure of Invention
In view of the foregoing, there is a need to provide a method, an apparatus, a computer device, a storage medium, and a computer program product for universal field-level automatic verification for different service interfaces, which can reduce workload efficiency.
In a first aspect, an embodiment of the present disclosure provides a general field-level automatic checking method for different service interfaces. The method comprises the following steps:
inputting test data into a service interface to be tested, and outputting a response result comprising a field through the service interface to be tested, wherein the field comprises a field name and a field numerical value;
determining a response data type corresponding to the field name, wherein the response data type is obtained by classifying the field name according to the data format characteristics of the field;
determining a check rule matched with the response data type;
and checking the field value according to the checking rule to obtain a testing result of the service interface to be tested.
In one embodiment, the manner for acquiring the association relationship between the response data type and the check rule includes:
acquiring a historical interface response result and a response data type in a preset historical time period;
and determining the association relationship between the response data type and the check rule according to the historical response result.
In one embodiment, the determining an association relationship between a response data type and a check rule according to the historical response result includes:
acquiring data format characteristics of fields corresponding to the response data types;
and determining a corresponding check rule according to the data format characteristics.
In one embodiment, the determining the response data type corresponding to the field name includes:
acquiring the matching degree of the field of the response result and the field of a preset response data type;
and determining the preset response data type with the matching degree larger than a preset threshold value as a response data type corresponding to the field name of the response result.
In one embodiment, the setting mode of the check rule includes at least one of regular expression matching and check method function.
In a second aspect, an embodiment of the present disclosure further provides a general field level automatic checking device for different service interfaces. The device comprises:
the input module is used for inputting test data to a service interface to be tested and outputting a response result comprising a field through the service interface to be tested, wherein the field comprises a field name and a field numerical value;
the first determining module is used for determining a response data type corresponding to the field name, wherein the response data type is obtained by classifying the field name according to the data format characteristics of the field;
the second determining module is used for determining a checking rule matched with the type of the response data;
and the checking module is used for checking the field value according to the checking rule to obtain a testing result of the service interface to be tested.
In one embodiment, the module for obtaining the association relationship between the response data type and the check rule includes:
the acquisition module is used for acquiring a historical interface response result and a response data type in a preset historical time period;
and the determining submodule is used for determining the association relationship between the response data type and the checking rule according to the historical response result.
In one embodiment, the determining sub-module includes:
the acquisition module is used for acquiring the data format characteristics of the fields corresponding to the response data types;
and the determining module is used for determining the corresponding check rule according to the data format characteristics.
In one embodiment, the determining module includes:
the acquisition module is used for acquiring the matching degree of the field of the response result and the field of the preset response data type;
and the determining submodule is used for determining that the preset response data type with the matching degree larger than a preset threshold is the response data type corresponding to the field name of the response result.
In one embodiment, the setting module of the check rule includes at least one of a regular expression matching unit and a check method function unit.
In a third aspect, an embodiment of the present disclosure further provides a computer device. The computer device comprises a memory storing a computer program and a processor implementing the steps of the method according to any of the embodiments of the present disclosure when executing the computer program.
In a fourth aspect, the disclosed embodiments also provide a computer-readable storage medium. The computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of the method of any of the embodiments of the present disclosure.
In a fifth aspect, the disclosed embodiments also provide a computer program product. The computer program product comprising a computer program that when executed by a processor implements the steps of the method of any of the embodiments of the present disclosure.
According to the embodiment of the disclosure, when the interface is tested, test data is input to the service interface to be tested, a response result including a field is output through the service interface to be tested, a corresponding response data type is determined according to the name of the field, a corresponding check rule is determined, the field data is tested according to the check rule, and a test result of the interface is obtained, so that the corresponding check rule is directly obtained according to the field of the response result of the service interface to be tested, verification is performed according to the characteristics of the output field of the interface, testing of the output field is realized, a corresponding expected result does not need to be manually compiled, automatic verification of the test result of the interface is realized, workload is greatly reduced, and efficiency of interface testing is improved.
Drawings
FIG. 1 is a diagram of an application environment of a generic field-level auto-verification method for different traffic interfaces in one embodiment;
FIG. 2 is a flow diagram illustrating a general field-level automatic verification method for different traffic interfaces in one embodiment;
FIG. 3 is a flowchart illustrating an exemplary manner of obtaining an association between a response data type and a verification rule according to an embodiment;
FIG. 4 is a flow chart illustrating a general field-level automatic verification method for different service interfaces in another embodiment;
FIG. 5 is a block diagram of a generic field level auto-checking device for different traffic interfaces in one embodiment;
FIG. 6 is a diagram illustrating an internal structure of a computer device according to an embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present disclosure more clearly understood, the embodiments of the present disclosure are described in further detail below with reference to the accompanying drawings and the embodiments. It is to be understood that the specific embodiments described herein are merely illustrative of the embodiments of the disclosure and that no limitation to the embodiments of the disclosure is intended.
The general field-level automatic checking method for different service interfaces provided by the embodiment of the disclosure can be applied to an application environment as shown in fig. 1. Wherein the terminal 102 communicates with the server 104 via a network. The data storage system may store data that the server 104 needs to process. The data storage system may be integrated on the server 104, or may be located on the cloud or other network server. The terminal 102 may be, but not limited to, various personal computers, notebook computers, smart phones, tablet computers, internet of things devices, and portable wearable devices, and the internet of things devices may be smart speakers, smart televisions, smart air conditioners, smart car-mounted devices, and the like. The portable wearable device can be a smart watch, a smart bracelet, a head-mounted device, and the like. The server 104 may be implemented as a stand-alone server or as a server cluster comprised of multiple servers.
In an embodiment, as shown in fig. 2, a general field-level automatic checking method for different service interfaces is provided, which is described by taking the application of the method to the terminal in fig. 1 as an example, and includes the following steps:
step S210, inputting test data into a service interface to be tested, and outputting a response result comprising a field through the service interface to be tested, wherein the field comprises a field name and a field numerical value;
the interface test is a test for testing interfaces among system components, and is mainly used for detecting interaction points between an external system and a system and between internal subsystems. The key point of the test is to check the exchange of data, transfer and control management processes, mutual logic dependency relationship between systems and the like.
In the embodiment of the disclosure, when the interface needs to be tested, the test data is input to the service interface to be tested, and the response result is output through the service interface to be tested. The test data can be preset according to the actual application scene and the interface type. In one example, the test data may be derived from an artificial rule or an artificial intelligence model output. The response result output by the service interface to be tested comprises fields, and the fields comprise field names and field values. In one example, one column of the two-dimensional table is referred to as a field, and each name of each column in the table in the database is a field name and the record in the field column is a field value.
Step S220, determining a response data type corresponding to the field name, wherein the response data type is obtained by classifying the field name according to the data format characteristics of the field;
in the embodiment of the disclosure, after the response result of the service interface to be tested is obtained, the response data type of the service interface to be tested is determined according to the field name corresponding to the response result, wherein the response data type is obtained by dividing in advance. When the response data types are divided, the field names are classified according to the data format characteristics of the fields, in general, different field names may correspond to the same or similar data format characteristics, and when the corresponding data format characteristics are the same or the similarity meets the preset requirement, the fields corresponding to the field names are divided into one type of response data types. When the response data type corresponding to the field name is determined, the field name may be obtained directly according to the corresponding relationship between the field name and the response data type, or may be obtained by analyzing and determining the specific content of the response result.
Step S230, determining a verification rule matched with the response data type;
in the embodiment of the present disclosure, after the response data type is obtained, a check rule matched with the response data type is determined, where in this embodiment, the check rule is a rule for determining a field value of the response result. In one example, the check rule is determined according to data characteristics of the field, and different check rules may be applied to different application scenarios. Because the characteristics of the format and the like of the field numerical values of the same type of response data type have the common point, the verification rule corresponding to the type of response data type can be set according to the characteristic common point of the same type of response data type, and the corresponding relation exists between the verification rule and the type of response data.
Step S240, verifying the field value according to the verification rule to obtain a test result of the service interface to be tested.
In the embodiment of the disclosure, the field value of the response result is verified according to the verification rule, so as to obtain the test result of the service interface to be tested. In this embodiment, the check rule is a rule for determining a field value of the response result. When testing, judging whether the field value accords with the check rule, if so, considering the field value to be correct, namely the interface response is normal, and considering the test result of the service interface to be tested to be a pass test; if the field value does not accord with the check rule, the field value at the moment is considered to be wrong, namely the interface response at the moment is abnormal, and the test of the service interface to be tested at the moment can be considered to be a failed test. In one example, after the test result is obtained, the test result is sent to a tester, and in the case that the test fails, detailed information of the abnormal field value can be sent to the tester, so that the follow-up tester can conveniently perform problem troubleshooting.
According to the embodiment of the disclosure, when the interface is tested, test data is input to the service interface to be tested, a response result including a field is output through the service interface to be tested, a corresponding response data type is determined according to the name of the field, a corresponding check rule is determined, the field data is tested according to the check rule, and a test result of the interface is obtained, so that the corresponding check rule is directly obtained according to the field of the response result of the service interface to be tested, verification is performed according to the characteristics of the output field of the interface, testing of the output field is realized, a corresponding expected result does not need to be manually compiled, automatic verification of the test result of the interface is realized, workload is greatly reduced, and efficiency of interface testing is improved.
In an embodiment, as shown in fig. 3, the manner of obtaining the association relationship between the response data type and the check rule includes:
step S310, obtaining a historical interface response result and a response data type in a preset historical time period;
step S320, determining an association relationship between the response data type and the verification rule according to the historical response result.
In the embodiment of the disclosure, when the verification rule is set, a historical interface response result and a response data type in a preset historical time period are obtained, wherein the preset historical time period is usually determined according to an actual application scene, and the response data type can be obtained by judging according to detailed information of the historical interface response result. In an example, a historical interface response result corresponding to a service interface to be tested may be obtained, where other interfaces that are the same as or have similarity meeting a preset requirement as the service interface to be tested are determined according to data such as the interface type of the service interface to be tested, and historical interface response results and corresponding response data types of the other interfaces are obtained, where the other interfaces in this example are interfaces that pass testing, and the historical interface response data may be interface response results within a preset historical time period. And determining a corresponding check rule according to the field of the historical interface response result, wherein the obtained check rule is matched with the response data type, so that the association relation between the response data type and the check rule is obtained.
According to the embodiment of the disclosure, the verification rule is determined through the historical interface response data, the corresponding output tone is determined without manually determining the test input data, and the efficiency of interface test is improved; meanwhile, the reliability and the accuracy of the check rule are ensured, so that the reliability of the test of the service interface to be tested in the subsequent interface test process is ensured, and the accuracy of the test result is ensured.
In one embodiment, the determining the association relationship between the response data type and the check rule according to the historical response result includes:
acquiring data format characteristics of a field corresponding to the response data type;
and determining a corresponding check rule according to the data format characteristics.
In the embodiment of the disclosure, when the verification rule is determined according to the historical response result, the data format characteristic of the field corresponding to the response data type is obtained, and the corresponding verification rule is determined according to the data format characteristic. For example, when the response data type is a time type, the data format characteristics of the corresponding field may include that the field format is a year, month, and day, and then the corresponding check rule may be set to a year, month, and day format.
According to the embodiment of the invention, the corresponding check rule is determined according to the data format characteristics of the field corresponding to the response data type, so that the accuracy and the reliability of the check rule are ensured, and the accuracy of the subsequent interface test is further improved.
In one embodiment, the determining the response data type corresponding to the field name includes:
obtaining the matching degree of the field of the response result and the field of a preset response data type;
and determining the preset response data type with the matching degree larger than a preset threshold value as a response data type corresponding to the field name of the response result.
In the embodiment of the present disclosure, when the response data type is determined, and when there is no corresponding relationship between the field name and the preset response data type, the matching degree between the field of the response result and the field of the preset response data type is obtained, where the number of the preset response data types may be one or more. And determining the preset response data type with the matching degree larger than the preset threshold as the response data type corresponding to the field name. In an example, the preset threshold may be set in advance according to an actual application scenario, or after all preset response data types are directly matched, the highest matching degree is used as the preset threshold, and the corresponding preset response data type is used as the response data type corresponding to the field name of the response result.
According to the embodiment of the disclosure, when the response result does not have the corresponding response data type, the response data type is directly determined according to the matching degree of the response result and the corresponding response data type, so that the embodiment can be applied to more scenes, the accuracy of the test result is ensured, the workload is further reduced, and the efficiency of the interface test is improved.
In one embodiment, the setting mode of the check rule includes at least one of regular expression matching and check method function.
In the embodiment of the present disclosure, a Regular Expression, also called a Regular Expression (Regular Expression), is a text pattern, which includes common characters (e.g., letters between a to z) and special characters (called meta characters), wherein the Regular Expression can describe and match a series of character strings matching a certain syntax rule by using a single character string. In this embodiment, a check rule may be set through the regular expression, and whether the field value of the response result conforms to the regular expression is determined, thereby determining the interface test result. And a corresponding checking method function can be set according to the format characteristics of the field, and the field value of the response result is judged by using the corresponding checking method function. In one example, the final verification rule may also be obtained by combining multiple setting manners.
According to the embodiment of the invention, the calibration rule is set through the regular expression matching and calibration method function, the normalization and the reliability of the calibration rule are ensured, the calibration rule setting efficiency is improved, and the accuracy and the safety of the subsequent interface test are further ensured.
Fig. 4 is a schematic diagram illustrating a general field-level automatic checking method for different service interfaces according to an exemplary embodiment, and referring to fig. 4, first, field names (i.e., field names) involved in response results of the interfaces are summarized and sorted to obtain the field names and corresponding meanings, and different data types are classified according to the data types. In one example, the response data of the interface may be json data. In another example, when data types are divided, the division is performed according to data meaning and data format characteristics, for example, update, createdate can be classified as time type data, name, personname, etc. can be classified as name type data. After the data types are obtained, because each data type generally has certain identical characteristics, the characteristic rules of the data types can be abstracted out and used as the universal check rules of the data types. In one example, time type data, if it is, would typically satisfy a common time format, such as time of year, month, day, hour, minute, second; if the data is of a gender type, the data can satisfy common gender formats, such as male, female and unknown. According to the abstracted feature rules, corresponding verification rules are constructed, and in one example, the verification rules can be implemented by using a regular expression matching mode or writing a verification method function. In the interface testing process, interface response data are obtained, traversal is carried out on the interface response data, key value pairs of field names (namely field names) and field values (namely field values) of the interface response data are obtained, the type of the data to which the response data belong is judged through the field names, the field values are verified by obtaining the verification rules of the type, and the testing result of the interface is output according to the verification result.
In one example, if an uncategorized strange field name is encountered, the data type to which the field name belongs may also be inferred by the rule that a large portion (e.g., 80% of the data) of its field value conforms to a certain type of data type.
In one example, in addition to abstracting the type rule building test rule by field name meaning, the rule building test rule may also be extracted by the type of data (e.g., int, string, float, borolean, json format string). For example, if a value corresponding to a field is int type all the time, it should not suddenly change to string type, or if a value corresponding to a field is a character string in json format all the time, it should not suddenly meet the json format.
In one example, in addition to the above-mentioned abstracted rules, there may be other rules based on field value feature extraction, wherein the rules based on field value feature extraction may include, but are not limited to, no field value repetition, ascending field value order, descending field value order, and the like. For example, if there is a piece of list data in the json data, then no duplicate value should be present for each id value in the json list, or if the json data is in a default descending order then the id field or createdate field in the json list should be in a field value descending order.
According to the embodiment, the field name containing rule, the field value type rule and the field value list rule are abstracted from the response data according to the fields to construct the test case, so that the field level verification can be carried out on the response data without concerning the input parameters of the request, the problem that interface transmission parameters and test data need to be prepared elaborately when the traditional interface test case is compiled is solved, and the coverage rate and the compiling efficiency of the interface test case are effectively improved.
It should be understood that, although the steps in the flowcharts of the figures are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least some of the steps in the figures may include multiple steps or multiple stages, which are not necessarily performed at the same time, but may be performed at different times, which are not necessarily performed in sequence, but may be performed alternately or at least partially in sequence with other steps or other steps.
Based on the same inventive concept, the embodiment of the present disclosure further provides a general field level automatic verification apparatus for different service interfaces, which is used for implementing the above related general field level automatic verification method for different service interfaces. The implementation scheme for solving the problem provided by the apparatus is similar to the implementation scheme described in the method above, so the specific limitations in one or more embodiments of the general field-level automatic checking apparatus for different service interfaces provided below may refer to the limitations in the above general field-level automatic checking method for different service interfaces, and are not described herein again.
In one embodiment, as shown in fig. 5, there is provided a general field level automatic checking apparatus for different service interfaces, including:
an input module 510, configured to input test data to a service interface to be tested, and output a response result including a field through the service interface to be tested, where the field includes a field name and a field value;
a first determining module 520, configured to determine a response data type corresponding to the field name, where the response data type is obtained by classifying the field name according to a data format characteristic of the field;
a second determining module 530, configured to determine a check rule matching the response data type;
the checking module 540 is configured to check the field value according to the checking rule, so as to obtain a test result of the service interface to be tested.
In one embodiment, the module for obtaining the association relationship between the response data type and the check rule includes:
the acquisition module is used for acquiring a historical interface response result and a response data type in a preset historical time period;
and the determining submodule is used for determining the association relationship between the response data type and the check rule according to the historical response result.
In one embodiment, the determining sub-module includes:
the acquisition module is used for acquiring the data format characteristics of the fields corresponding to the response data types;
and the determining module is used for determining the corresponding checking rule according to the data format characteristics.
In one embodiment, the determining module includes:
the acquisition module is used for acquiring the matching degree of the field of the response result and the field of the preset response data type;
and the determining submodule is used for determining that the preset response data type with the matching degree larger than a preset threshold is the response data type corresponding to the field name of the response result.
In one embodiment, the setting module of the verification rule comprises at least one of a regular expression matching unit and a verification method function unit.
The modules in the above-mentioned general field level automatic checking device for different service interfaces may be implemented wholly or partially by software, hardware and their combination. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as shown in fig. 6. The computer device includes a processor, a memory, and a network interface connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The database of the computer equipment is used for storing data such as interface output results, check rules and the like. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement a generic field-level automatic verification method for different traffic interfaces.
Those skilled in the art will appreciate that the configuration shown in fig. 6 is a block diagram of only a portion of the configuration associated with embodiments of the present disclosure, and does not constitute a limitation of the computing devices to which embodiments of the present disclosure may be applied, and that a particular computing device may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
In one embodiment, a computer device is further provided, which includes a memory and a processor, the memory stores a computer program, and the processor implements the steps of the above method embodiments when executing the computer program.
In an embodiment, a computer-readable storage medium is provided, on which a computer program is stored which, when being executed by a processor, carries out the steps of the above-mentioned method embodiments.
In an embodiment, a computer program product is provided, comprising a computer program which, when being executed by a processor, carries out the steps of the above-mentioned method embodiments.
It should be noted that, the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, presented data, etc.) related to the embodiments of the present disclosure are information and data authorized by the user or sufficiently authorized by each party.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, databases, or other media used in the embodiments provided in the disclosure may include at least one of non-volatile and volatile memory. The nonvolatile Memory may include Read-Only Memory (ROM), magnetic tape, floppy disk, flash Memory, optical Memory, high-density embedded nonvolatile Memory, resistive Random Access Memory (ReRAM), magnetic Random Access Memory (MRAM), ferroelectric Random Access Memory (FRAM), phase Change Memory (PCM), graphene Memory, and the like. Volatile Memory can include Random Access Memory (RAM), external cache Memory, and the like. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM), among others. The databases involved in the various embodiments provided by the embodiments of the present disclosure may include at least one of relational and non-relational databases. The non-relational database may include, but is not limited to, a block chain based distributed database, and the like. The processors referred to in the embodiments provided in the disclosure may be general processors, central processing units, graphics processors, digital signal processors, programmable logic devices, data processing logic devices based on quantum computing, etc., without being limited thereto.
All possible combinations of the technical features in the above embodiments may not be described for the sake of brevity, but should be considered as being within the scope of the present disclosure as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express a few implementations of the embodiments of the present disclosure, and the descriptions thereof are specific and detailed, but not construed as limiting the scope of the claims of the embodiments of the present disclosure. It should be noted that, for those skilled in the art, variations and modifications can be made without departing from the concept of the embodiments of the present disclosure, and these are all within the scope of the embodiments of the present disclosure. Therefore, the protection scope of the embodiments of the present disclosure should be subject to the appended claims.

Claims (10)

1. A method for universal field level automatic verification for different service interfaces, the method comprising:
inputting test data into a service interface to be tested, and outputting a response result comprising a field through the service interface to be tested, wherein the field comprises a field name and a field numerical value;
determining a response data type corresponding to the field name, wherein the response data type is obtained by classifying the field name according to the data format characteristics of the field;
determining a check rule matched with the response data type;
and checking the field value according to the checking rule to obtain a testing result of the service interface to be tested.
2. The method of claim 1, wherein responding to the manner of obtaining the association relationship between the data type and the check rule comprises:
acquiring a historical interface response result and a response data type in a preset historical time period;
and determining the association relationship between the response data type and the check rule according to the historical response result.
3. The method of claim 1, wherein determining the association between the response data type and the check rule according to the historical response result comprises:
acquiring data format characteristics of a field corresponding to the response data type;
and determining a corresponding check rule according to the data format characteristics.
4. The method of claim 1, wherein determining the response data type corresponding to the field name comprises:
acquiring the matching degree of the field of the response result and the field of a preset response data type;
and determining the preset response data type with the matching degree larger than a preset threshold value as the response data type corresponding to the field name of the response result.
5. The method according to claim 1, wherein the setting mode of the check rule comprises at least one of regular expression matching and check method function.
6. An apparatus for universal field-level automatic verification for different traffic interfaces, the apparatus comprising:
the system comprises an input module, a test module and a test module, wherein the input module is used for inputting test data to a service interface to be tested and outputting a response result comprising fields through the service interface to be tested, and the fields comprise field names and field values;
the first determining module is used for determining a response data type corresponding to the field name, wherein the response data type is obtained by classifying the field name according to the data format characteristics of the field;
the second determining module is used for determining a check rule matched with the response data type;
and the checking module is used for checking the field value according to the checking rule to obtain a testing result of the service interface to be tested.
7. The apparatus of claim 6, wherein the module for obtaining the association relationship between the data type and the check rule comprises:
the acquisition module is used for acquiring a historical interface response result and a response data type in a preset historical time period;
and the determining submodule is used for determining the association relationship between the response data type and the check rule according to the historical response result.
8. A computer device comprising a memory and a processor, the memory storing a computer program, wherein the processor when executing the computer program implements the steps of the generic field level automatic checking method for different traffic interfaces of any of claims 1 to 5.
9. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the generic field-level automatic checking method for different traffic interfaces of any one of claims 1 to 5.
10. A computer program product comprising a computer program, characterized in that the computer program, when being executed by a processor, implements the steps of the generic field-level automatic checking method for different traffic interfaces of any of claims 1 to 5.
CN202211097401.4A 2022-09-08 2022-09-08 Universal field level automatic checking method and device for different service interfaces Pending CN115629958A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211097401.4A CN115629958A (en) 2022-09-08 2022-09-08 Universal field level automatic checking method and device for different service interfaces

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211097401.4A CN115629958A (en) 2022-09-08 2022-09-08 Universal field level automatic checking method and device for different service interfaces

Publications (1)

Publication Number Publication Date
CN115629958A true CN115629958A (en) 2023-01-20

Family

ID=84903302

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211097401.4A Pending CN115629958A (en) 2022-09-08 2022-09-08 Universal field level automatic checking method and device for different service interfaces

Country Status (1)

Country Link
CN (1) CN115629958A (en)

Similar Documents

Publication Publication Date Title
CN110472068B (en) Big data processing method, equipment and medium based on heterogeneous distributed knowledge graph
CN114139209B (en) Information anti-theft method and system applied to big data of business user
CN110674360B (en) Tracing method and system for data
CN110019116B (en) Data tracing method, device, data processing equipment and computer storage medium
CN110046155B (en) Method, device and equipment for updating feature database and determining data features
US11308130B1 (en) Constructing ground truth when classifying data
CN113110843A (en) Contract generation model training method, contract generation method and electronic equipment
CN116155597A (en) Access request processing method and device and computer equipment
CN111124883A (en) Test case library introduction method, system and equipment based on tree form
CN115629958A (en) Universal field level automatic checking method and device for different service interfaces
CN114490415A (en) Service testing method, computer device, storage medium, and computer program product
CN114416805B (en) Data checking method and device, computer equipment and storage medium
CN111680112B (en) Data analysis method and device
CN110196877B (en) Data display method, device, computer equipment and storage medium
CN116362230A (en) Parameter verification method, device and computer equipment storable medium
CN117370160A (en) Code auditing method, apparatus, computer device, storage medium and program product
CN116881164A (en) Verification and correction method, device and equipment for test data in financial information system
CN116401323A (en) Index data processing method and device and computer equipment
CN117708151A (en) Data processing method and device and computer equipment
CN116962054A (en) Data processing method, device, computer equipment and storage medium
CN117453561A (en) Test script calling method, device, computer equipment and storage medium
CN116610703A (en) Data query method, device, computer equipment and storage medium
CN117331789A (en) Log generation method, device, computer equipment and storage medium
CN117349131A (en) System error information display method and device and computer equipment
CN117435185A (en) Code generation method, device, computer equipment and storage medium

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