CN114416557A - Interface checking method and device, storage medium and electronic equipment - Google Patents

Interface checking method and device, storage medium and electronic equipment Download PDF

Info

Publication number
CN114416557A
CN114416557A CN202210056054.4A CN202210056054A CN114416557A CN 114416557 A CN114416557 A CN 114416557A CN 202210056054 A CN202210056054 A CN 202210056054A CN 114416557 A CN114416557 A CN 114416557A
Authority
CN
China
Prior art keywords
interface
target
tested
return
value template
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
CN202210056054.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.)
Shenzhen Ping An Medical Health Technology Service Co Ltd
Original Assignee
Ping An Medical and Healthcare Management Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ping An Medical and Healthcare Management Co Ltd filed Critical Ping An Medical and Healthcare Management Co Ltd
Priority to CN202210056054.4A priority Critical patent/CN114416557A/en
Publication of CN114416557A publication Critical patent/CN114416557A/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/3684Test management for test design, e.g. generating new test cases
    • 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

Landscapes

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

Abstract

The application discloses an interface checking method, an interface checking device, a storage medium and electronic equipment, wherein the method comprises the following steps: determining a plurality of target interfaces to be tested contained in a target test project based on the target test project; acquiring a target return value template corresponding to each target interface to be tested; calling each target interface to be tested by adopting a preset interface calling method based on each target return value template to obtain an actual return result corresponding to each target interface to be tested; and comparing the actual return result corresponding to each target interface to be tested with the expected return result in the corresponding return value template to obtain the check result of each interface. According to the method, the actual return result returned after the interface is called is compared with the initial expected return result which is input in advance, the interface is verified according to the comparison result, and the problems of low verification speed and low efficiency in the prior art are solved.

Description

Interface checking method and device, storage medium and electronic equipment
Technical Field
The present disclosure relates to the field of software testing technologies, and in particular, to a method and an apparatus for interface verification, a storage medium, and an electronic device.
Background
In the existing insurance claim settlement process, a community platform which is in butt joint with a hospital system is usually used for obtaining diagnosis and treatment data of a patient from the hospital system and then feeding the diagnosis and treatment data back to an insurance company, so that the insurance company can conveniently and quickly obtain the diagnosis and treatment data of the patient in a hospital, such as the patient in a hospital, and the like, and can conveniently perform insurance claim settlement based on the diagnosis and treatment data, and therefore, the accurate acquisition of the diagnosis and treatment data is particularly important. Therefore, before the social platform and the hospital system are put into use formally, the patient needs to be verified so as to determine whether the patient can accurately feed back the diagnosis and treatment data of the patient.
However, most of the existing verification methods adopt a manual verification method, that is, an insurance company and a social platform are in butt joint, the insurance company initiates a visit file and a client identity confirmation interface, the social platform pulls the bill, medical record and discharge settlement information of a patient and returns the bill, medical record and discharge settlement information to the insurance company, and then the data correctness is manually verified. However, because the number of on-line hospitals is large, a plurality of systems and a plurality of interfaces are associated, if more than 100 hospitals are on-line simultaneously, manual examination/verification of one hospital will cause the problems of slow examination/verification speed and low efficiency.
Therefore, a method for checking an interface is needed to solve the problems of slow speed and low efficiency of checking/checking the interface in the prior art.
Disclosure of Invention
In view of the above, the present invention provides an interface checking method, an interface checking device, a storage medium and an electronic device, and mainly aims to solve the problems of slow speed and low efficiency of checking/checking an interface in the prior art.
In order to solve the above problem, the present application provides an interface verification method, including:
determining a plurality of target interfaces to be tested contained in a target test project based on the target test project;
acquiring a target return value template corresponding to each target interface to be tested;
calling each target interface to be tested by adopting a preset interface calling method based on each target return value template to obtain an actual return result corresponding to each target interface to be tested;
and comparing the actual return result corresponding to each target interface to be tested with the expected return result in the corresponding return value template to obtain the verification result of each target interface to be tested.
Optionally, before determining a plurality of target interfaces to be tested included in the target test item based on the target test item, the method further includes: configuring a corresponding return value template for each interface to be tested, which specifically comprises the following steps:
obtaining initial expected return results and data labels corresponding to the initial expected return results based on test data;
acquiring an expected return result corresponding to each interface to be tested based on the interface attribute of each interface to be tested;
and configuring a corresponding return value template for each interface to be tested based on the expected return result, the interface tag and the data tag corresponding to each interface to be tested.
Optionally, the obtaining of the target return value template corresponding to each target interface to be tested specifically includes:
and determining a target return value template corresponding to each target interface to be tested based on the interface label of each target interface to be tested.
Optionally, the method further includes: calling each target interface to be tested by adopting a preset interface calling method based on each target return value template, wherein the method specifically comprises the following steps:
acquiring a target test script based on each target return value template and each target interface to be tested;
and calling each target interface to be tested based on the target test script.
Optionally, the comparing the actual return result corresponding to each target interface to be tested with the expected return result in the corresponding return value template to obtain the verification result of each interface to be tested specifically includes: and comparing the actual return result corresponding to the interface label with the expected return result in the corresponding return value template based on each interface label.
Optionally, the method further includes: storing each return value template to a target storage area;
comparing the actual return result corresponding to the interface tag with the expected return result in the corresponding return value template based on each interface tag specifically comprises:
acquiring a return value template corresponding to each actual return result from the target storage area by using a target call instruction based on the corresponding interface tag of each actual return result;
and comparing the actual return result with an expected return result in a return value template corresponding to the actual return result.
In order to solve the above problem, the present application provides an interface verification apparatus, including:
the system comprises a determining module, a judging module and a judging module, wherein the determining module is used for determining a plurality of target interfaces to be tested contained in a target test project based on the target test project;
the acquisition module is used for acquiring a target return value template corresponding to each target interface to be tested;
the calling module is used for calling each target interface to be tested by adopting a preset interface calling method based on each target return value template to obtain an actual return result corresponding to each target interface to be tested;
and the checking module is used for comparing the actual return result corresponding to each target interface to be tested with the expected return result in the corresponding return value template to obtain the checking result of each target interface to be tested.
The interface verification device further comprises a configuration module, and the configuration module is used for: obtaining initial expected return results and data labels corresponding to the initial expected return results based on test data; acquiring an expected return result corresponding to each interface to be tested based on the interface attribute of each interface to be tested; and configuring a corresponding return value template for each interface to be tested based on the expected return result, the interface tag and the data tag corresponding to each interface to be tested.
In order to solve the above problem, the present application provides a storage medium storing a computer program, which when executed by a processor implements the steps of the interface verification method according to any one of the above aspects.
In order to solve the above problem, the present application provides an electronic device, which at least includes a memory and a processor, where the memory stores a computer program, and the processor implements the steps of the interface verification method according to any one of the above embodiments when executing the computer program on the memory.
According to the interface checking method, the device, the storage medium and the electronic equipment, the target return value template corresponding to the target interface to be tested is obtained, therefore, each interface can be called by adopting a preset interface calling method based on the target return value template, so that the actual return result corresponding to each interface can be quickly obtained, the actual return result of each interface can be quickly compared with the expected return result in the return value template corresponding to each interface, namely whether the actual return result returned by each interface is consistent with the expected return result or not is quickly determined, the quick checking of each interface is realized, the checking time of the interface is saved, and the interface checking efficiency is improved.
The foregoing description is only an overview of the technical solutions of the present invention, and the embodiments of the present invention are described below in order to make the technical means of the present invention more clearly understood and to make the above and other objects, features, and advantages of the present invention more clearly understandable.
Drawings
Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiments. The drawings are only for purposes of illustrating the preferred embodiments and are not to be construed as limiting the invention. Also, like reference numerals are used to refer to like parts throughout the drawings. In the drawings:
fig. 1 is a flowchart of an interface verification method according to an embodiment of the present application;
fig. 2 is a flowchart of an interface verification method according to another embodiment of the present application;
fig. 3 is a block diagram of an interface verification apparatus according to another embodiment of the present disclosure.
Detailed Description
Various aspects and features of the present application are described herein with reference to the drawings.
It will be understood that various modifications may be made to the embodiments of the present application. Accordingly, the foregoing description should not be construed as limiting, but merely as exemplifications of embodiments. Those skilled in the art will envision other modifications within the scope and spirit of the application.
The accompanying drawings, which are incorporated in and constitute a part of the specification, illustrate embodiments of the application and, together with a general description of the application given above and the detailed description of the embodiments given below, serve to explain the principles of the application.
These and other characteristics of the present application will become apparent from the following description of preferred forms of embodiment, given as non-limiting examples, with reference to the attached drawings.
It is also to be understood that although the present application has been described with reference to some specific examples, those skilled in the art are able to ascertain many other equivalents to the practice of the present application.
The above and other aspects, features and advantages of the present application will become more apparent in view of the following detailed description when taken in conjunction with the accompanying drawings.
Specific embodiments of the present application are described hereinafter with reference to the accompanying drawings; however, it is to be understood that the disclosed embodiments are merely exemplary of the application, which can be embodied in various forms. Well-known and/or repeated functions and constructions are not described in detail to avoid obscuring the application of unnecessary or unnecessary detail. Therefore, specific structural and functional details disclosed herein are not to be interpreted as limiting, but merely as a basis for the claims and as a representative basis for teaching one skilled in the art to variously employ the present application in virtually any appropriately detailed structure.
The specification may use the phrases "in one embodiment," "in another embodiment," "in yet another embodiment," or "in other embodiments," which may each refer to one or more of the same or different embodiments in accordance with the application.
An embodiment of the present application provides an interface verification method, as shown in fig. 1, which specifically includes the following steps:
step S101: determining a plurality of target interfaces to be tested contained in a target test project based on the target test project;
in the specific implementation process of the step, the target test item specifically refers to a test task for testing each interface of the hospital system or a test task for testing each interface of the social platform system.
Step S102: acquiring a target return value template corresponding to each target interface to be tested;
in the specific implementation process, the target return value template corresponding to each target interface to be tested is determined based on the interface label of each target interface to be tested.
Step S103: calling each target interface to be tested by adopting a preset interface calling method based on each target return value template to obtain an actual return result corresponding to each target interface to be tested;
in the specific implementation process of this step, the calling method may specifically be a target test script, that is, before calling each target interface to be tested, a target test script may be obtained based on each target return value template and each target interface to be tested. Specifically, when the target test script is obtained, the target test script may be written by a jmeter (Java-based stress test tool). The process of obtaining the target test script comprises the following steps: firstly, a request test script is established under a thread group of a jmeter, and a target return value template corresponding to each target test interface is filled in the script to obtain a target test script. The target testing script based on the target calls each target interface to be tested, and the specific implementation process is as follows: firstly, a cycle controller is created, the target test script is moved to the lower part of the cycle controller, and the script is made to run circularly to obtain a corresponding actual return result.
Step S104: and comparing the actual return result corresponding to each target interface to be tested with the expected return result in the corresponding return value template to obtain the verification result of each target interface to be tested.
In the specific implementation process of this step, first, based on the interface tag corresponding to each actual return result, a return value template corresponding to each actual return result is obtained from the target storage area by using a target call instruction. Specifically, firstly: analyzing an actual return result to a target storage area; finding a return value template which is input in advance based on an interface label corresponding to an actual return result, then determining a corresponding expected return result according to the position of the expected return result of the return value template, then comparing the actual return result with the corresponding expected return result to obtain a comparison result whether the actual return result and the expected return result are consistent, if so, obtaining a normal check result of the interface, and if not, obtaining an abnormal check result of the interface.
In this embodiment, by obtaining the target return value template corresponding to the target interface to be tested, each interface can be called by using a predetermined interface calling method based on the target return value template, so as to quickly obtain an actual return result corresponding to each interface, and thus, the actual return result of each interface and an expected return result in the return value template corresponding to each interface can be quickly compared, that is, whether the actual return result returned by each interface is consistent with the expected return result is quickly determined, thereby quickly checking each interface, saving the checking time of the interface, and improving the efficiency of interface checking.
Another embodiment of the present application provides an interface verification method, as shown in fig. 2, including the following steps:
step S201: configuring a corresponding return value template for each interface to be tested;
in the specific implementation process of the step, firstly: initial expected return results and data tags corresponding to each of the initial expected return results are obtained based on test data. The test data may specifically be invoice data reimbursed by the patient, the test data/invoice data includes several field information and data information corresponding to each field information, for example, the field information may include hospital name, patient name, examination fee, assay fee, treatment fee, and the like; the data information includes: hospital a corresponding to the hospital name field, zhang san corresponding to the patient name, and so on. The initial expected return result specifically refers to data information corresponding to each field in the test data, for example, if the hospital name field corresponds to hospital a, the obtained initial expected result is hospital a; if the patient name field corresponds to Zhang III, obtaining the initial expected return result Zhang III under the patient name field; the data information corresponding to the bed fee amount field is 200.00 yuan, and the initial expected return result of the obtained bed fee amount field is 200.00 yuan. In particular implementations, the field information may also include examination fees, assay fees, treatment fees, operation fees, nursing fees, material fees, etc. according to the patient examination items. In the specific implementation process of this step, a batch of test data as described above may be pre-entered, each initial expected return result corresponding to the test data and the data tag corresponding to each initial expected return result are obtained, and the initial expected return result is stored in the target storage area, where the initial expected return result has the data tag. The data tag is used to uniquely characterize the test data, and may be, for example, a patient identification number, a name, etc. in the test data.
Secondly, the method comprises the following steps: and acquiring an expected return result corresponding to each interface to be tested based on the interface attribute of each interface to be tested. The interface attribute is determined according to the test item, that is, different test items correspond to different interface attributes, and the types of data returned by the interfaces with different interface attributes are different. For example, the interface attribute of each interface in the test item of the hospital system is a first attribute, and the data type returned by each interface under the first attribute can be a digital type; and for example, the interface attribute of each interface in the test item of the social platform system is a second attribute, and the data type returned by each interface under the second attribute can be a character type. In the specific implementation process of the step, after the initial expected return result is obtained, the target data type can be determined according to the interface attribute of each interface to be tested, and then each initial expected return result is converted into an expected return result corresponding to the target data type according to the target data type. And then determining at least one expected return result corresponding to each interface from each expected return result according to the target field information corresponding to each interface, namely the data information corresponding to which fields are returned by each interface user. That is, for example, the interface a corresponds to a visit archive interface, and the target field information corresponding to the visit archive interface is the basic information of the patient, including field information such as patient name, patient identification number, patient sex, birth date, contact telephone, contact address, etc.; the interface B corresponds to a bill interface, and the field information corresponding to the bill interface comprises hospital names, hospital numbers, patient names, departments, beds, categories (departments), total expenses, hospital stay days, projects (western medicine fees, material fees, examination fees), and the like. Therefore, according to the first attribute of the interface A, the expected return result of the corresponding numerical type of the field information such as the patient name, the patient identification number, the patient sex, the birth date, the contact telephone, the contact address and the like can be configured to the interface A, so that the expected return result corresponding to the interface A is obtained. Similarly, according to the second attribute of the interface B, field information such as hospital name, hospital number, patient name, department, bed, category (department), total cost, hospital stay number, item (western medicine cost, material cost, examination cost), and the like, and the expected return result of the corresponding character type can be configured to the interface B, thereby obtaining the expected return result corresponding to the interface B. In this embodiment, the hospital system may further include, for example, a case interface, a discharge settlement interface, and the like.
And thirdly: and configuring a corresponding return value template for each interface to be tested based on the expected return result, the interface tag and the data tag corresponding to each interface to be tested. That is, after the expected return result corresponding to each interface is obtained, the corresponding data tag may be determined according to the expected return result, and then the interface tag of the interface and the field information corresponding to the interface are further combined to obtain the return value template corresponding to the interface. In specific implementation, for the same interface, an expected return result set corresponding to each test data may be obtained based on several test data, and then multiple return value templates containing different expected return result sets may be configured and obtained according to each expected return result set and a data tag corresponding to each set. In this step, a json format (JavaScript Object notification, which is a lightweight data exchange format) may be used as the return value template, data between the interfaces is transmitted in the json format, and the return value template includes field information corresponding to the expected result. In this embodiment, return value template formats (field information and data types of data information) corresponding to the interface to be tested in the hospital system and the interface to be tested in the social platform system are different, for example, for the field information of the patient name, the data type corresponding to the social platform interface is the first type, and may be the name specifically; the data type corresponding to the hospital system interface is a second data type, which may be aa01 specifically.
In the specific implementation process of the step, after the corresponding return value template is configured for each interface to be tested, the return value template can be stored in the target storage area, and a foundation is laid for subsequently acquiring the return value template from the target storage area, comparing actual return results based on expected return results in the return value template, and checking whether the interface to be tested is abnormal.
Step S202: determining a plurality of target interfaces to be tested contained in a target test project based on the target test project;
in the specific implementation process of the step, the target test item specifically refers to a test task for testing each interface of the hospital system or a test task for testing each interface of the social platform system.
Step S203: acquiring a target return value template corresponding to each target interface to be tested;
in the specific implementation process, the target return value template corresponding to each target interface to be tested is determined based on the interface label of each target interface to be tested. Specifically, the target return value template may be acquired from a predetermined target storage location.
Step S204: calling each target interface to be tested by adopting a preset interface calling method based on each target return value template to obtain an actual return result corresponding to each target interface to be tested;
in the specific implementation process of this step, the calling method may specifically be a target test script, that is, before calling each target interface to be tested, a target test script may be obtained based on each target return value template and each target interface to be tested. Specifically, when the target test script is obtained, the target test script may be written by a jmeter (Java-based pressure test tool), a request test script is first created under a thread group of the jmeter, and a target return value template corresponding to each target test interface is filled in the script, so as to obtain the target test script. The target return value template comprises the data label of the test data, so that each interface to be tested can be called based on the target test script to obtain the actual return result returned by each interface to be tested aiming at the data label. Calling each target interface to be tested based on the target test script, wherein the specific implementation process comprises the following steps: firstly, a cycle controller is created, the target test script is moved to the lower part of the cycle controller, and the script is made to run circularly, so that the actual return result corresponding to the data label is obtained. For example: the expected return result corresponding to the hospital name field is hospital a, a # (hospital a) is input on the target test script, the hospital a is the expected return result, the data label corresponding to the hospital a is, for example, the identification number 0000001 of the patient, then the script is made to run circularly, and the actual return result such as the hospitalization fee, the medical fee and the like fed back by each target test interface for the identification number 0000001 of the patient is obtained. In this embodiment, the expected return result in the return value template may be specifically identified by the # () identifier, and the expected return result in the parentheses only needs to be modified according to the test data in each test. When the expected return result is entered, only the concerned field information can be entered, for example, only three field information in the N fields need to be concerned, where N is an integer greater than or equal to 0, then only the expected return result of the three field information is entered, and the other fields not entered with the expected return result are not compared, so that the comparison efficiency is improved.
Step S205: and comparing the actual return result corresponding to each target interface to be tested with the expected return result in the corresponding return value template to obtain the verification result of each target interface to be tested.
In the specific implementation process of the step, firstly, based on an interface tag corresponding to each actual return result, a return value template corresponding to each actual return result is acquired from the target storage area by using a target call instruction; the target call instruction may specifically be a call statement in the target test script. Specifically, firstly: analyzing an actual return result to a target storage area; based on the interface tag corresponding to the actual result, the positions of the return value template and the expected return result entered in advance in step S201 are found, specifically, the positions of the return value template and the expected result may be obtained from the target storage area, and then the actual return result is parsed. And finally, comparing the actual return result with an expected return result in the return value template corresponding to the actual return result. For example, when the expected return result is hospital a and the actual return result is hospital B, it indicates that the expected return result does not match the actual return result, and it is determined that the interface to be tested that returns the actual return result is abnormal. For another example, when the expected returned result corresponding to the hospital name field is hospital B, the expected returned result corresponding to the patient name field is zhang san, the expected returned result corresponding to the hospital expense field is 10000 yuan, and the actual returned result is consistent with the expected returned result, it is indicated that the corresponding interface to be tested is normal, and the corresponding data can be accurately returned. If the actual return result corresponding to the hospital name field and the patient name field is the same as the expected return result, and the actual return result corresponding to the hospitalization fee field is 5000 yuan and is inconsistent with the expected return result, it is necessary to mark that the actual return result of the hospitalization fee does not accord with the expected return result, and the verification result of the interface to be tested is abnormal. By marking inconsistent fields, concerned fields can be identified clearly, so that a tester can know clearly which field information returned by which interfaces is correct and which field information returned by which interfaces is wrong, problems can be searched in a targeted manner, and a foundation is laid for subsequently correcting and debugging the system interfaces.
In this embodiment, by obtaining the target return value template corresponding to the target interface to be tested, each interface can be called by using a predetermined interface calling method based on the target return value template, so as to quickly obtain an actual return result corresponding to each interface, and thus, the actual return result of each interface and an expected return result in the return value template corresponding to each interface can be quickly compared, that is, whether the actual return result returned by each interface is consistent with the expected return result is quickly determined, thereby quickly checking each interface, saving the checking time of the interface, and improving the efficiency of interface checking.
Another embodiment of the present application provides an interface verification apparatus, as shown in fig. 3, including:
the determining module 1: the system comprises a plurality of target to-be-tested interfaces, a plurality of test modules and a test module, wherein the target to-be-tested interfaces are contained in a target test project;
the acquisition module 2 is used for acquiring a target return value template corresponding to each target interface to be tested;
the calling module 3 is used for calling each target interface to be tested by adopting a preset interface calling method based on each target return value template to obtain an actual return result corresponding to each target interface to be tested;
and the checking module 4 is used for comparing the actual return result corresponding to each target interface to be tested with the expected return result in the corresponding return value template to obtain the checking result of each target interface to be tested.
The interface checking apparatus in this embodiment further includes a configuration module, where the configuration module is configured to: obtaining initial expected return results and data labels corresponding to the initial expected return results based on test data; acquiring an expected return result corresponding to each interface to be tested based on the interface attribute of each interface to be tested; and configuring a corresponding return value template for each interface to be tested based on the expected return result, the interface tag and the data tag corresponding to each interface to be tested.
The interface checking apparatus in this embodiment further includes a configuration module, where the configuration module is configured to: configuring a corresponding return value template for each interface to be tested before determining a plurality of target interfaces to be tested contained in a target test project based on the target test project; the configuration module is specifically configured to: obtaining initial expected return results and data labels corresponding to the initial expected return results based on test data; acquiring an expected return result corresponding to each interface to be tested based on the interface attribute of each interface to be tested; and configuring a corresponding return value template for each interface to be tested based on the expected return result, the interface tag and the data tag corresponding to each interface to be tested.
In a specific implementation process of this embodiment, the obtaining module is specifically configured to: and determining a target return value template corresponding to each target interface to be tested based on the interface label of each target interface to be tested.
In a specific implementation process of this embodiment, the calling module is specifically configured to: acquiring a target test script based on each target return value template and each target interface to be tested; and calling each target interface to be tested based on the target test script.
In a specific implementation process of this embodiment, the verification module is specifically configured to: and comparing the actual return result corresponding to the interface label with the expected return result in the corresponding return value template based on each interface label.
In a specific implementation process of this embodiment, the verification apparatus further includes a storage module, where the storage module is configured to: storing each return value template to a target storage area; the verification module is specifically configured to: acquiring a return value template corresponding to each actual return result from the target storage area by using a target call instruction based on the corresponding interface tag of each actual return result; and comparing the actual return result with an expected return result in a return value template corresponding to the actual return result.
Another embodiment of the present application provides a storage medium storing a computer program which, when executed by a processor, performs the method steps of:
step one, determining a plurality of target to-be-tested interfaces contained in a target test project based on the target test project;
step two, acquiring a target return value template corresponding to each target interface to be tested;
calling each target interface to be tested by adopting a preset interface calling method based on each target return value template to obtain an actual return result corresponding to each target interface to be tested;
and step four, comparing the actual return result corresponding to each target interface to be tested with the expected return result in the corresponding return value template to obtain the verification result of each target interface to be tested.
The specific implementation process of the above method steps can refer to the above embodiment of any interface verification method, and this embodiment is not repeated herein.
In this embodiment, by obtaining the target return value template corresponding to the target interface to be tested, each interface can be called by using a predetermined interface calling method based on the target return value template, so as to quickly obtain an actual return result corresponding to each interface, and thus, the actual return result of each interface and an expected return result in the return value template corresponding to each interface can be quickly compared, that is, whether the actual return result returned by each interface is consistent with the expected return result is quickly determined, thereby quickly checking each interface, saving the checking time of the interface, and improving the efficiency of interface checking.
Another embodiment of the present application provides an electronic device, at least including a memory and a processor, where the memory stores a computer program thereon, and the processor implements the following method steps when executing the computer program on the memory:
step one, determining a plurality of target to-be-tested interfaces contained in a target test project based on the target test project;
step two, acquiring a target return value template corresponding to each target interface to be tested;
calling each target interface to be tested by adopting a preset interface calling method based on each target return value template to obtain an actual return result corresponding to each target interface to be tested;
and step four, comparing the actual return result corresponding to each target interface to be tested with the expected return result in the corresponding return value template to obtain the verification result of each target interface to be tested.
The specific implementation process of the above method steps can refer to the above embodiment of any interface verification method, and this embodiment is not repeated herein.
In this embodiment, by obtaining the target return value template corresponding to the target interface to be tested, each interface can be called by using a predetermined interface calling method based on the target return value template, so as to quickly obtain an actual return result corresponding to each interface, and thus, the actual return result of each interface and an expected return result in the return value template corresponding to each interface can be quickly compared, that is, whether the actual return result returned by each interface is consistent with the expected return result is quickly determined, thereby quickly checking each interface, saving the checking time of the interface, and improving the efficiency of interface checking.
The above embodiments are only exemplary embodiments of the present application, and are not intended to limit the present application, and the protection scope of the present application is defined by the claims. Various modifications and equivalents may be made by those skilled in the art within the spirit and scope of the present application and such modifications and equivalents should also be considered to be within the scope of the present application.

Claims (10)

1. An interface verification method, comprising:
determining a plurality of target interfaces to be tested contained in a target test project based on the target test project;
acquiring a target return value template corresponding to each target interface to be tested;
calling each target interface to be tested by adopting a preset interface calling method based on each target return value template to obtain an actual return result corresponding to each target interface to be tested;
and comparing the actual return result corresponding to each target interface to be tested with the expected return result in the corresponding return value template to obtain the verification result of each target interface to be tested.
2. The method of claim 1, wherein prior to determining a number of target test interfaces contained in a target test item based on the target test item, the method further comprises: configuring a corresponding return value template for each interface to be tested, which specifically comprises the following steps:
obtaining initial expected return results and data labels corresponding to the initial expected return results based on test data;
acquiring an expected return result corresponding to each interface to be tested based on the interface attribute of each interface to be tested;
and configuring a corresponding return value template for each interface to be tested based on the expected return result, the interface tag and the data tag corresponding to each interface to be tested.
3. The method of claim 2, wherein the obtaining of the target return value template corresponding to each of the target to-be-tested interfaces specifically comprises:
and determining a target return value template corresponding to each target interface to be tested based on the interface label of each target interface to be tested.
4. The method of claim 1, wherein said calling each of said target interfaces to be tested based on each of said target return value templates using a predetermined interface calling method comprises:
acquiring a target test script based on each target return value template and each target interface to be tested;
and calling each target interface to be tested based on the target test script.
5. The method of claim 2, wherein comparing the actual return result corresponding to each target interface to be tested with the expected return result in the corresponding return value template to obtain the verification result of each interface to be tested, specifically comprises: and comparing the actual return result corresponding to the interface label with the expected return result in the corresponding return value template based on each interface label.
6. The method of claim 5, wherein the method further comprises: storing each return value template to a target storage area;
comparing the actual return result corresponding to the interface tag with the expected return result in the corresponding return value template based on each interface tag specifically comprises:
acquiring a return value template corresponding to each actual return result from the target storage area by using a target call instruction based on the corresponding interface tag of each actual return result;
and comparing the actual return result with an expected return result in a return value template corresponding to the actual return result.
7. A device for verifying data correctness, comprising:
the system comprises a determining module, a judging module and a judging module, wherein the determining module is used for determining a plurality of target interfaces to be tested contained in a target test project based on the target test project;
the acquisition module is used for acquiring a target return value template corresponding to each target interface to be tested;
the calling module is used for calling each target interface to be tested by adopting a preset interface calling method based on each target return value template to obtain an actual return result corresponding to each target interface to be tested;
and the checking module is used for comparing the actual return result corresponding to each target interface to be tested with the expected return result in the corresponding return value template to obtain the checking result of each target interface to be tested.
8. The apparatus of claim 7, further comprising a configuration module to: obtaining initial expected return results and data labels corresponding to the initial expected return results based on test data; acquiring an expected return result corresponding to each interface to be tested based on the interface attribute of each interface to be tested; and configuring a corresponding return value template for each interface to be tested based on the expected return result, the interface tag and the data tag corresponding to each interface to be tested.
9. A storage medium, characterized in that the storage medium stores a computer program, which when executed by a processor implements the steps of the interface verification method according to any one of the preceding claims 1 to 6.
10. An electronic device, characterized by at least comprising a memory, a processor, said memory having a computer program stored thereon, said processor, when executing the computer program on said memory, implementing the steps of the interface verification method according to any of the preceding claims 1-6.
CN202210056054.4A 2022-01-18 2022-01-18 Interface checking method and device, storage medium and electronic equipment Pending CN114416557A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210056054.4A CN114416557A (en) 2022-01-18 2022-01-18 Interface checking method and device, storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210056054.4A CN114416557A (en) 2022-01-18 2022-01-18 Interface checking method and device, storage medium and electronic equipment

Publications (1)

Publication Number Publication Date
CN114416557A true CN114416557A (en) 2022-04-29

Family

ID=81273729

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210056054.4A Pending CN114416557A (en) 2022-01-18 2022-01-18 Interface checking method and device, storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN114416557A (en)

Similar Documents

Publication Publication Date Title
CN107665171B (en) Automatic regression testing method and device
CN104111885A (en) Method and device for verifying interface test results
CN110162420B (en) Data auxiliary positioning method and device, computer equipment and storage medium
CN111124894B (en) Code coverage rate processing method and device and computer equipment
CN111737148A (en) Automatic regression testing method and device, computer equipment and storage medium
CN110750434A (en) Interface testing method and device, electronic equipment and computer readable storage medium
CN114388082A (en) Method and device for checking medical scientific research data
CN113220322A (en) Test software updating method, electronic device and storage medium
JP2018041514A (en) Shared data definition supporting system, supporting device of the same, and program
CN114416557A (en) Interface checking method and device, storage medium and electronic equipment
CN112446442A (en) Sample analysis system, information matching method and computer storage medium
CN112306876B (en) Automatic flow chart generation method and device, computer equipment and storage medium
CN111078549B (en) Code coverage rate processing method and device and computer equipment
CN111008147B (en) Application program testing method, terminal and computer readable storage medium
CN113656318A (en) Software version testing method and device and computer equipment
CN112346994A (en) Test information correlation method and device, computer equipment and storage medium
CN113505159B (en) Data detection method, device and equipment
CN114817067B (en) Automatic mock testing method and device
CN112529039B (en) Method and device for checking material information of main board and storage medium
CN112559362B (en) Automatic testing method and testing device for dynamic user interface
CN115203616A (en) Element positioning method and element positioning device
CN115033437A (en) Automatic proofreading method, system and medium for USB interface connection equipment
CN117743269A (en) Bus description file error correction processing method and device, electronic equipment and storage medium
CN116010283A (en) Test case repairing method, device, computer equipment and storage medium
CN113360491A (en) Data quality inspection method, data quality inspection device, electronic 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
TA01 Transfer of patent application right

Effective date of registration: 20220531

Address after: 518000 China Aviation Center 2901, No. 1018, Huafu Road, Huahang community, Huaqiang North Street, Futian District, Shenzhen, Guangdong Province

Applicant after: Shenzhen Ping An medical and Health Technology Service Co.,Ltd.

Address before: Room 12G, Area H, 666 Beijing East Road, Huangpu District, Shanghai 200001

Applicant before: PING AN MEDICAL AND HEALTHCARE MANAGEMENT Co.,Ltd.

TA01 Transfer of patent application right