CN110806979B - Interface return value checking method, device, equipment and storage medium - Google Patents
Interface return value checking method, device, equipment and storage medium Download PDFInfo
- Publication number
- CN110806979B CN110806979B CN201911052628.5A CN201911052628A CN110806979B CN 110806979 B CN110806979 B CN 110806979B CN 201911052628 A CN201911052628 A CN 201911052628A CN 110806979 B CN110806979 B CN 110806979B
- Authority
- CN
- China
- Prior art keywords
- interface
- verification
- target interface
- configuration item
- target
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 34
- 238000012795 verification Methods 0.000 claims abstract description 92
- 238000004590 computer program Methods 0.000 claims description 5
- 238000012360 testing method Methods 0.000 abstract description 41
- 238000013461 design Methods 0.000 abstract description 14
- 238000011161 development Methods 0.000 abstract description 14
- 238000012423 maintenance Methods 0.000 abstract description 10
- 230000008569 process Effects 0.000 abstract description 5
- 238000004891 communication Methods 0.000 abstract description 3
- 238000012986 modification Methods 0.000 description 13
- 230000004048 modification Effects 0.000 description 13
- 238000013524 data verification Methods 0.000 description 4
- 230000003287 optical effect Effects 0.000 description 4
- 230000005540 biological transmission Effects 0.000 description 3
- 238000010586 diagram Methods 0.000 description 3
- 238000007792 addition Methods 0.000 description 2
- 238000005034 decoration Methods 0.000 description 2
- 238000012217 deletion Methods 0.000 description 2
- 230000037430 deletion Effects 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 230000006870 function Effects 0.000 description 2
- 238000007726 management method Methods 0.000 description 2
- 238000012545 processing Methods 0.000 description 2
- 230000003068 static effect Effects 0.000 description 2
- 238000003491 array Methods 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000011981 development test Methods 0.000 description 1
- 235000019800 disodium phosphate Nutrition 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 230000003993 interaction Effects 0.000 description 1
- 230000002093 peripheral effect Effects 0.000 description 1
- 238000007493 shaping process Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Prevention of errors by analysis, debugging or testing of software
- G06F11/3668—Testing of software
- G06F11/3672—Test management
- G06F11/3688—Test management for test execution, e.g. scheduling of test suites
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Prevention of errors by analysis, debugging or testing of software
- G06F11/3668—Testing of software
- G06F11/3672—Test management
- G06F11/3692—Test management for test results analysis
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/24—Classification techniques
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Computer Hardware Design (AREA)
- Quality & Reliability (AREA)
- Data Mining & Analysis (AREA)
- Life Sciences & Earth Sciences (AREA)
- Artificial Intelligence (AREA)
- Bioinformatics & Cheminformatics (AREA)
- Bioinformatics & Computational Biology (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Evolutionary Biology (AREA)
- Evolutionary Computation (AREA)
- User Interface Of Digital Computer (AREA)
- Debugging And Monitoring (AREA)
Abstract
The invention provides a method, a device, equipment and a storage medium for checking an interface return value, wherein the method comprises the steps of classifying target interfaces according to a check specification of a predefined specification; creating a policy file corresponding to the target interface according to the classification result of the target interface, wherein the policy file is constructed according to the predefined specification; verifying the verification data distributed to the target interface according to the strategy file; and sending the verification result to the user terminal corresponding to the verification data. The invention realizes the verification of the verification data sent by the user terminal in the testing stage, and improves the accuracy of the interface testing; in addition, the invention adopts uniform predefined standard when interface design is carried out in the development stage and interface test is carried out in the test stage, high uniformity is kept in the whole development and test process, and communication cost and maintenance cost in the interface design and interface test are reduced.
Description
Technical Field
The invention relates to the technical field of software interface testing, in particular to a method, a device, equipment and a storage medium for verifying an interface return value.
Background
Interface testing is a test of the interface between components of a test system. The interface test is mainly used for detecting interaction points between external systems and between internal subsystems. The key point of the test is to check the exchange, transmission and control management process of data, the mutual logic dependency relationship between systems and the like. When interface test is performed, it is necessary to verify whether the return value is correct, so as to ensure the stability of the data exchange, transmission and control management process.
In the prior art, the inventor finds that a general interface test only checks a state code, the interface request is considered to be successful if the state code is correct, and the interface request is considered to be failed if the state code is wrong; the technology cannot verify whether the return value of the interface is correct, and if the state code is correct and the return value is wrong, the accuracy of the test result is affected. In addition, the inventor also finds that a verification method for creating a corresponding interface return value according to a document during interface design needs to be established for a specific interface during current interface test, and needs to be created for each interface separately; the technology has no reusability, the cost is higher during interface testing, and the later maintenance and the expansion are not facilitated.
Disclosure of Invention
The present invention is directed to solve at least one of the above technical drawbacks, and in particular, to solve the problem of how to improve the accuracy of interface testing and save the cost of interface testing.
In a first aspect, the present invention provides a method for checking an interface return value, including the following steps: classifying the target interfaces according to a check specification of a predefined specification; creating a strategy file corresponding to the target interface according to the classification result of the target interface, wherein the strategy file is constructed according to the predefined specification; verifying the verification data distributed to the target interface according to the strategy file; and sending the verification result to the user terminal corresponding to the verification data.
In one embodiment, the classifying the target interface according to a check specification of a predefined specification includes the following steps: according to the check specification of the predefined specification, the target interface is divided into at least one category in the group consisting of adding, deleting, modifying, searching, uploading and downloading.
In one embodiment, the creating a policy file corresponding to the target interface according to the classification result of the target interface includes: identifying a verification configuration item according to the classification result of the target interface; and adding the verification configuration item into a policy file corresponding to the target interface.
In one embodiment, the identifying the verification configuration item according to the classification result of the target interface includes the following steps: setting the importance level of the configuration item according to the classification result of the target interface; and identifying the configuration items with the importance levels meeting the preset verification standard as verification configuration items.
In one embodiment, the configuration item includes at least one of the group consisting of type, length, field.
In one embodiment, the verifying the verification data allocated to the target interface according to the policy file includes the following steps: receiving check data sent by a user terminal; determining that the verification data is allocated to the target interface; and verifying the verification data according to the strategy file.
In one embodiment, the predefined specification comprises a JSON Schema.
In a second aspect, the present invention provides an apparatus for checking an interface return value, including the following modules: the classification module is used for classifying the target interfaces according to the check specification of the predefined specification; the creating module is used for creating a strategy file corresponding to the target interface according to the classification result of the target interface, and the strategy file is constructed according to the predefined specification; the verification module is used for verifying the verification data distributed to the target interface according to the strategy file; and the feedback module is used for sending the verification result to the user terminal corresponding to the verification data.
In a third aspect, the present invention provides a computer apparatus comprising: a processor; and a memory configured to store machine readable instructions which, when executed by the processor, cause the processor to perform a method of checking an interface return value as defined in any embodiment of the first aspect.
In a fourth aspect, the present invention provides a computer-readable storage medium, which stores a computer program, where the computer program is used for implementing the method for checking an interface return value according to any embodiment of the first aspect when executed by a processor.
The technical scheme provided by the embodiment of the invention at least has the following technical effects:
(1) When the interface design is carried out in the development stage, the target interface is classified according to the verification specification of the predefined specification, and the strategy file corresponding to the target interface is established according to the classification result of the target interface, wherein the strategy file is constructed according to the predefined specification; when the interface test is carried out in the test stage, the verification data distributed to the target interface is verified according to the strategy file, and the verification result is sent to the user terminal corresponding to the verification data. The invention checks the data (interface return value) sent by the user terminal in the testing stage, thereby effectively improving the accuracy of the interface testing; furthermore, the invention adopts uniform predefined standard when interface design is carried out in the development stage and interface test is carried out in the test stage, high uniformity is kept in the whole development and test process, communication cost and maintenance cost in the interface design and interface test are reduced, and the stability of the interface is improved.
(2) The method comprises the steps of presetting a predefined standard for checking an interface return value in a development stage based on the interface return value, classifying target interfaces according to the predefined standard, creating a strategy file corresponding to the target interfaces according to classification results of the target interfaces, and constructing the strategy file according to the predefined standard; the target interfaces are classified, the same strategy file is adopted for the target interfaces of the same class, the cost of interface design and interface test is reduced, and later maintenance is facilitated.
Additional aspects and advantages of the invention will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention.
Drawings
The foregoing and/or additional aspects and advantages of the present invention will become apparent and readily appreciated from the following description of the embodiments, taken in conjunction with the accompanying drawings of which:
fig. 1 is a flowchart of a method for checking an interface return value according to a first embodiment of the present invention;
fig. 2 is another flowchart of a method for checking an interface return value according to an embodiment of the present invention;
fig. 3 is a block diagram of a checking apparatus for interface return values according to a second embodiment of the present invention;
fig. 4 is another block diagram of an apparatus for checking an interface return value according to a second embodiment of the present invention;
fig. 5 is a physical structure diagram of a computer device according to a third embodiment of the present invention.
Detailed Description
Reference will now be made in detail to embodiments of the present invention, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to the same or similar elements or elements having the same or similar function throughout. The embodiments described below with reference to the drawings are illustrative only and should not be construed as limiting the invention.
As used herein, the singular forms "a", "an", "the" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will be further understood that the terms "comprises" and/or "comprising," when used in this specification, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof. It will be understood that when an element is referred to as being "connected" or "coupled" to another element, it can be directly connected or coupled to the other element or intervening elements may also be present. Further, "connected" or "coupled" as used herein may include wirelessly connected or wirelessly coupled. As used herein, the term "and/or" includes all or any element and all combinations of one or more of the associated listed items.
It will be understood by those skilled in the art that, unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs. It will be further understood that terms, such as those defined in commonly used dictionaries, should be interpreted as having a meaning that is consistent with their meaning in the context of the prior art and will not be interpreted in an idealized or overly formal sense unless expressly so defined herein.
Example one
As shown in fig. 1, the method for checking an interface return value according to the embodiment of the present invention includes the following steps:
s001: the target interfaces are classified according to a check specification of a predefined specification.
S002: and creating a policy file corresponding to the target interface according to the classification result of the target interface, wherein the policy file is constructed according to the predefined specification.
S003: and verifying the verification data distributed to the target interface according to the strategy file.
S004: and sending the verification result to the user terminal corresponding to the verification data.
In the embodiment of the present invention, an execution subject is taken as an example for description, but the execution subject is not limited thereto, and other computer devices that can execute the method provided in the embodiment of the present invention should also be considered as the protection scope of the present invention.
In the embodiment of the present invention, the predefined specification is determined based on the format of the interface return value, and assuming that the system adopts an http protocol and the format of the interface return value includes a JSON format, the predefined specification is preferably a JSON Schema. The following description of the embodiments of the present invention takes the predefined specification JSON Schema as an example, but the present invention is not limited to the chosen predefined specification, and other methods that may occur to those skilled in the art without departing from the principle of the present invention should be regarded as the protection scope of the present invention.
In step S001, classifying the target interface according to a verification specification of a predefined specification, specifically including: according to the check specification of the predefined specification, the target interface is divided into at least one category in the group consisting of adding, deleting, modifying, searching, uploading and downloading. The checking specification of the JSON Schema adopts a general specification which is adapted to each interface of the system. And when the target interface is classified, under the condition of adapting to the verification specification, the target interface is classified based on the specification, the rule and the type. Specifically, the target interface may be divided into at least one category in a group consisting of add, delete, modify, find, upload, and download, that is, the target interface may be divided into one category or a plurality of categories; for example, the target interface may be classified in the category "modified"; it can also be divided in categories "modify" and "upload"; in the embodiment of the present invention, preferably, the target interface is divided into only one of the categories according to the verification specification, such as the category "modification". The addition, deletion, modification, search, upload and download are part of the divisible categories, and those skilled in the art can list other categories according to the verification specification of the JSON Schema or the parameters of the target interface, which are not listed one by one. In one possible embodiment, classifying the target interface includes the following two cases: (1) Firstly, defining a target interface to enable the target interface to have specific parameters, and classifying the target interface according to a verification specification; (2) Firstly, classifying the target interfaces according to a check specification, and defining the classified target interfaces.
In step S002, creating a policy file corresponding to the target interface according to the classification result of the target interface, wherein the policy file is constructed according to the predefined specification; specifically, a policy file constructed according to the JSON Schema and corresponding to the target interface is created for the classification result of the target interface in step S001, where the policy file is a JSON Schema file. For example, if the target interface is classified into the category "modification", a corresponding first JSON Schema file is created for the target interface of which the classification result is "modification"; if the target interface is classified into the category of uploading, a corresponding second JSON Schema file is created for the target interface of which the classification result is uploading; in one embodiment, the first JSON Schema file is different from the second JSON Schema file. In the embodiment of the invention, if the corresponding JSON Schema file is established in the category divided by the target interface, the existing JSON Schema file is directly called according to the classification result of the target interface; for example: the existing storage is provided with a JSON Schema file A with the category of 'modification' and a JSON Schema file B with the category of 'uploading'; if the target interface is divided into the categories of 'modification', directly calling a JSON Schema file A; if the target interface is divided into the categories of 'modification' and 'uploading', directly calling one of the JSON Schema file A and the JSON Schema file B; and a new JSON Schema file does not need to be additionally created, which is beneficial to reducing the cost of interface design.
In a preferred embodiment, as shown in fig. 2, step S002 creates a policy file corresponding to the target interface according to the classification result of the target interface, wherein the policy file is constructed according to the predefined specification; the method comprises the following steps:
s101: and identifying the verification configuration item according to the classification result of the target interface.
S102: and adding the verification configuration item into a policy file corresponding to the target interface.
Further, the step S101 includes the steps of:
setting the importance level of the configuration item according to the classification result of the target interface; and identifying the configuration items with the importance levels meeting the preset verification standard as verification configuration items.
Wherein the configuration item comprises at least one of a group consisting of a type, a length, and a field.
The target interfaces may be classified into at least one category of the group consisting of add, delete, modify, find, upload, download, each category having a corresponding level of importance for the configuration items in the interface return value. In the embodiment of the present invention, a corresponding importance level is set for each category for a configuration item, and whether a preset verification standard identified as a verification configuration item is satisfied is determined according to the importance level, which is exemplified by referring to the following table 1:
TABLE 1 relationship between different classes of configuration items, importance levels, and verification configuration items
As shown in table 1, for the category "modification", the configuration item at least includes a type, a field, and a length, where the importance level of the type is high, the importance level of the field is low, and the importance level of the length is medium, and when the preset verification criterion is that the importance level of the configuration item is high, the verification configuration item with the category "modification" is the type. For the category "search", the configuration item at least includes a type, a field and a length, wherein the importance level of the type is high, the importance level of the field is high, and the importance level of the length is low, and when the preset check standard is that the importance level of the configuration item is high, the check configuration item with the category "search" is the type and the field. As can be seen from the relationships among the contents listed in table 1, such as categories, configuration items, importance levels, verification configuration items, etc., the same category has at least one configuration item; each configuration item has its corresponding level of importance; the importance levels of different configuration items in the same category may be the same; the importance level of at least one configuration item in the same category is high.
In combination with the content in table 1, in the embodiment of the present invention, if the classification result of the target interface is that the target interface is classified into the category "modification", the identified verification configuration item is a type; if the classification result of the target interface is that the target interface is classified in the category 'search', the identified checking configuration item comprises two items of type and field.
The above description is only given as an example, and the configuration items included in different categories and the importance levels of the configuration items can be adjusted according to actual situations. In addition, the preset check criteria are set based on the importance level of the configuration item, and may be set to be high, medium or higher (including medium or high) and the like.
In the embodiment of the present invention, the configuration items listed above are only part of a list, and in the JSON Schema, the configuration items include a maximum value maximum, a minimum value minimum, and the like in addition to a type, a length, and a field required, and are not listed one by one here.
In step S102, the verification configuration item is added to the policy file corresponding to the target interface, that is, the verification configuration item identified in step S101 is added to the JSON Schema file corresponding to the target interface. For example, the following steps are carried out: the type in the configuration item represents that the type of the specified return value is one of number/shaping integer, string, object, array, borolean and null; the following exemplifies a manner of adding the check configuration item to the JSON Schema file, for the check configuration item as a type:
number type: generally, fields such as id, number and the like returned by the interface are all digital types, and in the embodiment of the present invention, the following manner may be adopted by preferably using a JSON Schema:
{"type":"number"}
if the check configuration item includes a maximum value and a minimum value besides the type, the range of the number needs to be verified, and the maximum value and the minimum value are added to limit on the basis of the above manner:
the character string type: the use of the character string type in the interface design involves multiple types, for example, text, picture address, URL, etc. all adopt the character string type, in the embodiment of the present invention, it is preferable to use JSON Schema to verify the character string type in the following manner:
{"type":"string"}
if the check configuration item includes rule restrictions, length restrictions, and the like in addition to the type, the following manner can be written:
formatting (e.g., URL): { "type": string "," format ": url" }
Regular matching: { "type": string "," pattern "\\ \ d + }
The object type: generally, object types are relatively complex, in the embodiment of the present invention, a JSON Schema is preferably used to describe an object type, and the following manner may be adopted:
an object is described, having attributes aa and bb, which are numbers and strings:
when some fields are described to be filled, required is added, and the fields are an array, wherein the fields are filled:
in the above, for the case that the check configuration item is a number type, a character string type, and an object type, for example, and the other check configuration items are other types or other configuration items, a person skilled in the art may refer to the above example, and add the check configuration item to the JSON Schema file in a corresponding manner in an embodiment of the present invention, preferably using the JSON Schema.
In step S003, verifying the verification data allocated to the target interface according to the policy file, specifically including: receiving check data sent by a user terminal; determining that the check data is allocated to the target interface; and verifying the verification data according to the strategy file.
In the embodiment of the invention, in the test stage, after the interface test case is created, a request is sent through the user terminal, the request carries the check data, correspondingly, the server receives the check data sent by the user terminal, at the moment, the server determines the allocated interface according to the request and the corresponding check data, and if the check data are determined to be allocated to the target interface, the check data are checked according to the JSON Schema file corresponding to the target interface. In the embodiment of the invention, when the interface is designed in the development stage, the set JSON Schema file can be directly used in the interface test in the test stage without a method for checking according to the configuration of the target interface. And the configured JSON Schema file is suitable for different classification results of the target interface and is different.
Wherein, the verifying the verification data distributed to the target interface according to the policy file further comprises the following steps:
if the data verification is successful, executing a request sent by the user terminal; and if the data verification fails, capturing error data.
In the embodiment of the invention, if the data verification is successful, the verification result is marked as successful; and if the data verification fails, identifying the verification result as failure.
In step S004, sending the verification result to the user terminal corresponding to the verification data, which specifically includes: returning a result of successful verification to the user terminal corresponding to the verification data; or, returning the result of failed verification and/or error data to the user terminal corresponding to the verification data. The user terminal comprises at least one of arrays consisting of an external system and internal subsystems.
In an embodiment of the present invention, the first aspect: the JSON Schema file can be used for checking the returned value of the interface, and the accuracy of the interface test is improved. In a second aspect: preferably, the step S001 and the step S002 are completed when the interface design is performed in the development stage, that is, the creation of the JSON Schema file is completed when the interface is designed, and the step S003 and the step S004 are completed when the interface test is performed in the test stage, that is, the JSON Schema file created in the development stage is directly used for verifying the verification data when the interface is tested; the JSON Schema is uniformly adopted in the two stages, JSON Schema files created in the interface design can be directly used in the interface test, so that the whole development test process is integrated, a document is not required to be explained according to the parameter transmission rule created in the interface design in the interface test, and a verification method is created separately for a target interface. The communication cost and the maintenance cost during interface design and interface test are effectively reduced. In one possible embodiment, steps S001, S002, S003, and S004 can be performed during the interface test in the test phase. In a third aspect: based on the interface return value, presetting a check interface return value to adopt a JSON Schema in a development stage, classifying the target interface according to the check specification of the JSON Schema, and creating a JSON Schema file corresponding to the target interface according to the classification result of the target interface; when the JSON Schema files corresponding to each category are stored, the JSON Schema files corresponding to the corresponding categories can be directly called according to the classification result of the target interface, the JSON Schema files do not need to be created again, and the cost of interface design, interface test and later maintenance is reduced. When the interface is changed in a development stage, a later maintenance stage and a later expansion stage, the changed interface is directly classified according to the verification specification of the JSON Schema, and the JSON Schema file corresponding to the changed interface is called according to the classification result, so that the development, later maintenance and expansion cost can be saved. In the fourth aspect: and identifying a verification configuration item according to a classification result of the target interface, adding the corresponding verification configuration item when the JSON Schema file is created, and directly changing the verification configuration item of the JSON Schema file corresponding to the interface when the interface is changed in a development stage, a later maintenance stage and a later expansion stage without changing the code level, so that the development, later maintenance and expansion cost is saved.
Example two
As shown in fig. 3, in order to further explain the method for checking an interface return value according to the first embodiment of the present invention, a modularization of the method is described, and an apparatus 30 for checking an interface return value is provided, which includes the following modules:
a classification module 31, configured to classify the target interface according to a verification specification of a predefined specification;
a creating module 32, configured to create a policy file corresponding to the target interface according to the classification result of the target interface, where the policy file is constructed according to the predefined specification;
the verification module 33 is configured to verify the verification data allocated to the target interface according to the policy file;
and the feedback module 34 is configured to send the verification result to the user terminal corresponding to the verification data.
Wherein, the classification module 31 comprises the following units:
and the classification unit is used for classifying the target interface into at least one category in a group consisting of addition, deletion, modification, search, upload and download according to the verification specification of the predefined specification.
As shown in fig. 4, the creating module 32 includes the following units:
and an identifying unit 41, configured to identify the verification configuration item according to the classification result of the target interface.
And the configuration unit 42 is configured to add the verification configuration item to the policy file corresponding to the target interface.
Wherein, the identification unit 41 comprises the following sub-units:
and the setting subunit is used for setting the importance level of the configuration item according to the classification result of the target interface.
And the identification subunit is used for identifying the configuration item with the importance level meeting the preset verification standard as the verification configuration item.
Specifically, the configuration item includes at least one of the group consisting of a type, a length, and a field.
Wherein, the verification module 33 includes the following units:
and the receiving unit is used for receiving the verification data sent by the user terminal.
A determining unit, configured to determine that the check data is allocated to the target interface.
And the verification unit is used for verifying the verification data according to the strategy file.
Specifically, the predefined specification includes a JSON Schema.
EXAMPLE III
An embodiment of the present invention provides a computer device, including: a processor; and a memory configured to store machine readable instructions that, when executed by the processor, cause the processor to perform a method of verifying an interface return value as described in embodiment one.
As shown in fig. 5, the computer apparatus 1000 shown in fig. 5 includes: a processor 1001 and a memory 1003. Where processor 1001 is connected to memory 1003, such as by bus 1002. Optionally, the computer device 1000 may also include a transceiver 1004. It should be noted that the transceiver 1004 is not limited to one in practical application, and the structure of the computer device 1000 is not limited to the embodiment of the present invention.
The Processor 1001 may be a CPU (Central Processing Unit), a general-purpose Processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array) or other Programmable logic device, a transistor logic device, a hardware component, or any combination thereof. Which may implement or perform the various illustrative logical methods, modules, and circuits described in connection with the disclosure. The processor 1001 may also be a combination of computing functions, e.g., comprising one or more microprocessors, DSPs and microprocessors, and the like.
The Memory 1003 may be a ROM (Read Only Memory) or other type of static storage device that can store static information and instructions, a RAM (Random Access Memory) or other type of dynamic storage device that can store information and instructions, an EEPROM (Electrically Erasable Programmable Read Only Memory), a CD-ROM (Compact Disc Read Only Memory) or other optical Disc storage, optical Disc storage (including Compact Disc, laser Disc, optical Disc, digital versatile Disc, blu-ray Disc, etc.), a magnetic Disc storage medium or other magnetic storage device, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer, but is not limited to these.
The memory 1003 is used for storing application codes for implementing the present invention and is controlled by the processor 1001. The processor 1001 is configured to execute application program codes stored in the memory 1003 to implement the contents shown in the foregoing method embodiments.
Example four
The embodiment of the invention provides a computer-readable storage medium, which stores a computer program, and the computer program is used for realizing the method for checking the interface return value according to the first embodiment when being executed by a processor.
In addition, functional units in the embodiments of the present invention may be integrated into one processing module, or each unit may exist alone physically, or two or more units are integrated into one module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode. The integrated module, if implemented in the form of a software functional module and sold or used as a separate product, may also be stored in a computer-readable storage medium.
The storage medium mentioned above may be a read-only memory, a magnetic or optical disk, etc.
The foregoing is only a partial embodiment of the present invention, and it should be noted that, for those skilled in the art, various modifications and decorations can be made without departing from the principle of the present invention, and these modifications and decorations should also be regarded as the protection scope of the present invention.
Claims (6)
1. A method for checking an interface return value is characterized by comprising the following steps:
classifying the target interface according to a check specification of a predefined specification, including: dividing the target interface into at least one category in a group consisting of adding, deleting, modifying, searching, uploading and downloading according to a check specification of a predefined specification;
creating a policy file corresponding to the target interface according to the classification result of the target interface, wherein the policy file comprises: setting the importance level of a configuration item according to the classification result of the target interface, identifying the configuration item with the importance level meeting a preset verification standard as a verification configuration item, and adding the verification configuration item into a strategy file corresponding to the target interface; the policy file is constructed according to the predefined specification; the configuration item comprises at least one of a group consisting of type, length, field;
verifying the verification data distributed to the target interface according to the strategy file;
and sending the verification result to the user terminal corresponding to the verification data.
2. The method for verifying the interface return value according to claim 1, wherein the step of verifying the verification data allocated to the target interface according to the policy file comprises the following steps:
receiving check data sent by a user terminal;
determining that the check data is allocated to the target interface;
and verifying the verification data according to the strategy file.
3. A method for checking an interface return value according to claim 1 or 2, wherein the predefined specification comprises a JSON Schema.
4. The device for checking the interface return value is characterized by comprising the following modules:
the classification module is used for classifying the target interface according to the check specification of the predefined specification, and comprises: dividing the target interface into at least one category in a group consisting of adding, deleting, modifying, searching, uploading and downloading according to a check specification of a predefined specification;
the creating module is used for creating a strategy file corresponding to the target interface according to the classification result of the target interface, and comprises the following steps: setting the importance level of a configuration item according to the classification result of the target interface, identifying the configuration item with the importance level meeting a preset verification standard as a verification configuration item, and adding the verification configuration item into a strategy file corresponding to the target interface; the policy file is constructed according to the predefined specification; the configuration item comprises at least one of a group consisting of a type, a length, a field;
the verification module is used for verifying the verification data distributed to the target interface according to the strategy file;
and the feedback module is used for sending the verification result to the user terminal corresponding to the verification data.
5. A computer device, comprising:
a processor;
and a memory configured to store machine readable instructions that, when executed by the processor, cause the processor to perform a method of checking an interface return value of any of claims 1-3.
6. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, is adapted to carry out a method of checking an interface return value according to any one of claims 1 to 3.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911052628.5A CN110806979B (en) | 2019-10-31 | 2019-10-31 | Interface return value checking method, device, equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911052628.5A CN110806979B (en) | 2019-10-31 | 2019-10-31 | Interface return value checking method, device, equipment and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN110806979A CN110806979A (en) | 2020-02-18 |
CN110806979B true CN110806979B (en) | 2023-04-07 |
Family
ID=69489811
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201911052628.5A Active CN110806979B (en) | 2019-10-31 | 2019-10-31 | Interface return value checking method, device, equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110806979B (en) |
Families Citing this family (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112148540B (en) * | 2020-08-27 | 2023-03-24 | 云账户技术(天津)有限公司 | Interface parameter checking method and device, electronic equipment and readable storage medium |
CN112698883A (en) * | 2020-12-29 | 2021-04-23 | 平安普惠企业管理有限公司 | Configuration data processing method, device, terminal and storage medium |
CN114969822A (en) * | 2022-06-09 | 2022-08-30 | 湖南快乐阳光互动娱乐传媒有限公司 | A request invocation defense method and related equipment |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102243608A (en) * | 2010-05-13 | 2011-11-16 | 方兴 | Software security test method based on global data structure description |
CN102487345A (en) * | 2010-12-06 | 2012-06-06 | 普天信息技术研究院有限公司 | A device, system and method for testing network performance parameters |
CN105373469A (en) * | 2014-08-25 | 2016-03-02 | 广东金赋信息科技有限公司 | Interface based software automation test method |
CN107729243A (en) * | 2017-10-12 | 2018-02-23 | 上海携程金融信息服务有限公司 | API automated testing method, system, equipment and storage medium |
CN108399273A (en) * | 2018-01-15 | 2018-08-14 | 北京航空航天大学 | Artificial intelligence program person writes the decision decomposition method of digital aircraft source code |
CN109558316A (en) * | 2018-11-21 | 2019-04-02 | 武汉风行在线技术有限公司 | A kind of HTTP interface mobilism parameter test method of Test Strategy automatic configuration |
CN110069449A (en) * | 2019-03-20 | 2019-07-30 | 平安科技(深圳)有限公司 | Document handling method, device, computer equipment and storage medium |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20170124497A1 (en) * | 2015-10-28 | 2017-05-04 | Fractal Industries, Inc. | System for automated capture and analysis of business information for reliable business venture outcome prediction |
-
2019
- 2019-10-31 CN CN201911052628.5A patent/CN110806979B/en active Active
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102243608A (en) * | 2010-05-13 | 2011-11-16 | 方兴 | Software security test method based on global data structure description |
CN102487345A (en) * | 2010-12-06 | 2012-06-06 | 普天信息技术研究院有限公司 | A device, system and method for testing network performance parameters |
CN105373469A (en) * | 2014-08-25 | 2016-03-02 | 广东金赋信息科技有限公司 | Interface based software automation test method |
CN107729243A (en) * | 2017-10-12 | 2018-02-23 | 上海携程金融信息服务有限公司 | API automated testing method, system, equipment and storage medium |
CN108399273A (en) * | 2018-01-15 | 2018-08-14 | 北京航空航天大学 | Artificial intelligence program person writes the decision decomposition method of digital aircraft source code |
CN109558316A (en) * | 2018-11-21 | 2019-04-02 | 武汉风行在线技术有限公司 | A kind of HTTP interface mobilism parameter test method of Test Strategy automatic configuration |
CN110069449A (en) * | 2019-03-20 | 2019-07-30 | 平安科技(深圳)有限公司 | Document handling method, device, computer equipment and storage medium |
Non-Patent Citations (5)
Title |
---|
24765-2010 - ISO/IEC/IEEE International Standard - Systems and software engineering -- Vocabulary.《IEEE Std 610.12-1990》.2010,第1-418页. * |
孙宝华等.面向电力系统数据接口的消息队列系统.《信息技术》.2019,第43卷(第43期),第154-158页. * |
聂南.基于XML的组件接口验证与测试.《中国博士学位论文全文数据库 信息科技辑》.2009,第I138-15页. * |
陶金.SPI接口在车门控制模块中的应用.《微型电脑应用》.2010,第26卷(第26期),第18-20+23+67页. * |
马雪怀.嵌入式系统的接口测试策略.《马雪怀》.2015,第11卷(第11期),第65-68页. * |
Also Published As
Publication number | Publication date |
---|---|
CN110806979A (en) | 2020-02-18 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN111104392B (en) | Database migration method and device, electronic equipment and storage medium | |
CN110806979B (en) | Interface return value checking method, device, equipment and storage medium | |
CN111290742A (en) | Parameter verification method and device, electronic equipment and readable storage medium | |
CN107832062B (en) | Program updating method and terminal equipment | |
CN114281793A (en) | Data verification method, device and system | |
CN111475402B (en) | Program function testing method and related device | |
CN110113393A (en) | A kind of information push method, device, electronic equipment and medium | |
CN112035471A (en) | Transaction processing method and computer equipment | |
CN104767761B (en) | A kind of cloud storage platform access control method and device | |
CN108776665B (en) | Data processing method and device | |
CN117493309A (en) | Standard model generation method, device, equipment and storage medium | |
CN111008873A (en) | User determination method and device, electronic equipment and storage medium | |
CN114968864B (en) | Verification environment construction method, chip verification method and system | |
CN116257438A (en) | Updating method of interface test case and related equipment | |
CN111338869A (en) | Configuration parameter management method, device, device and storage medium | |
CN115237444A (en) | Version number-based concurrency control method, apparatus, device and storage medium | |
CN111984666A (en) | Database access method and device, computer readable storage medium and computer equipment | |
WO2024114524A1 (en) | Database access method and apparatus, and storage medium | |
CN113342647A (en) | Test data generation method and device | |
CN105989021A (en) | Document processing method and device | |
CN110781182A (en) | Automatic coding method and device for check logic and computer equipment | |
CN113342275B (en) | Method, apparatus and computer readable storage medium for accessing data at block link points | |
CN116431354A (en) | Resource management method, device, electronic equipment and storage medium | |
CN113364875A (en) | Method, apparatus and computer readable storage medium for accessing data at block link points | |
CN110347691B (en) | Certificate type verification method, certificate type verification 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 | ||
CB02 | Change of applicant information |
Address after: 801-2, floor 8, building 3, No. 22, Ronghua Middle Road, Beijing Economic and Technological Development Zone, Daxing District, Beijing Applicant after: Wanghai Kangxin (Beijing) Technology Co.,Ltd. Address before: Room 07, Room 2, Building B, 12 Hongda North Road, Beijing Daxing District, Beijing Applicant before: BEIJING NEUSOFT VIEWHIGH TECHNOLOGY Co.,Ltd. |
|
CB02 | Change of applicant information | ||
GR01 | Patent grant | ||
GR01 | Patent grant |