CN117421255B - Automatic inspection method, device and equipment for interface and storage medium - Google Patents

Automatic inspection method, device and equipment for interface and storage medium Download PDF

Info

Publication number
CN117421255B
CN117421255B CN202311749308.1A CN202311749308A CN117421255B CN 117421255 B CN117421255 B CN 117421255B CN 202311749308 A CN202311749308 A CN 202311749308A CN 117421255 B CN117421255 B CN 117421255B
Authority
CN
China
Prior art keywords
interface
test
inspection
task
plan
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202311749308.1A
Other languages
Chinese (zh)
Other versions
CN117421255A (en
Inventor
马银增
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Bodian Zhihe Technology Co ltd
Original Assignee
Beijing Bodian Zhihe Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Bodian Zhihe Technology Co ltd filed Critical Beijing Bodian Zhihe Technology Co ltd
Priority to CN202311749308.1A priority Critical patent/CN117421255B/en
Publication of CN117421255A publication Critical patent/CN117421255A/en
Application granted granted Critical
Publication of CN117421255B publication Critical patent/CN117421255B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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/3676Test management for coverage analysis
    • 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
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

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 automatic inspection method, device, equipment and storage medium of an interface, wherein a target interface inspection group and a test plan of the target interface inspection group are obtained, a test script is generated according to the test plan, then test data is obtained according to the test script, a configuration file is obtained, and when the execution time of the test plan of the target interface inspection group in a preconfigured interface inspection task is reached, the corresponding test script and the test data are called, so that a test result is generated. According to the method and the device, the test script is automatically generated, the requirement on the code capacity of a test engineer is reduced, the preconfigured interface inspection task comprising the test plan set correspondingly combined according to the characteristics of different interfaces and the types of interface test results is executed, the running state of the multi-dimensional detection interface in the on-line inspection environment can be detected, the on-line inspection time of the interface is shortened, and the on-line inspection efficiency of the interface is high.

Description

Automatic inspection method, device and equipment for interface and storage medium
Technical Field
The application belongs to the technical field of computers, and particularly relates to an automatic inspection method, device, equipment and storage medium of an interface.
Background
The interface is a predefined function for data transfer between systems or programs. The interface test is used for testing the functions of the interface and the performance of the interface, and the interface test can specifically comprise the exchange and transmission of test data, the control and management process, the mutual logic dependency relationship among systems and the like.
When performing interface testing, the testing end typically tests the interface by executing different test cases written by a tester according to the test requirements. This requires the test engineer to have a good encoding capability.
In addition, when the on-line inspection plan is executed, engineers are required to independently edit the test program for each interface, and the time required for completing the interface test is more, so that the inspection efficiency is lower.
Disclosure of Invention
In view of this, the present application provides an automatic inspection method for an interface, so as to solve the problem of low inspection efficiency of the existing interface.
In order to solve the above problems, the present application provides the following solutions:
an automatic inspection method of an interface, comprising:
acquiring a target interface inspection group and a test plan of the target interface inspection group, and generating at least one test script according to the test plan, wherein the test script is used for testing at least one interface;
obtaining test data according to the test script;
responding to an operation instruction of a user, and acquiring a configuration file of a target interface inspection group; the configuration file is used for configuring an online inspection environment of the target interface inspection group;
when the execution time of a test plan of a target interface inspection group in a pre-configured interface inspection task is reached, a corresponding test script and the test data are called, and a test result is generated; the interface inspection task comprises a test plan set which is correspondingly combined according to the characteristics of different interfaces and the types of interface test results.
Optionally, the target interface inspection group is determined according to a preset screening condition, where the preset screening condition includes at least one of an interface service type, an interface priority, and a demander specification.
Optionally, obtaining test data according to the test script includes:
directly acquiring the manually entered test data corresponding to the test script;
or capturing test data according to the test script line.
Optionally, the test plan includes a functional point coverage test, an outlier coverage test, and a limit value coverage test.
Optionally, the interface inspection task includes inspection time, inspection index and alarm mode.
Optionally, also include
Analyzing the test result to judge whether the test plan meets the inspection index;
and when the test plan is judged not to meet the inspection index, notifying a task responsible person in an alarm mode.
Optionally, the method further comprises:
if the task responsible person processes the alarm corresponding to the abnormal test plan before the next inspection cycle, the alarm strategy detects that the alarm is processed, and the new cycle continues to execute the inspection task comprising the abnormal test plan;
if the task responsible person does not process the alarm corresponding to the abnormal test plan before the next inspection cycle, the alarm strategy detects that the alarm is not processed, the alarm is given again, the task responsible person at the upper level of the task responsible person is notified, and the new cycle does not execute the inspection task comprising the abnormal test plan.
An automatic inspection device of an interface, comprising:
the device comprises a first acquisition unit, a second acquisition unit, a third acquisition unit and an execution unit, wherein:
the first acquisition unit acquires the target interface inspection group and a test plan of the target interface inspection group, and generates at least one test script according to the test plan, wherein the test script is used for testing at least one interface;
the second acquisition unit is used for acquiring test data according to the test script;
the third acquisition unit is used for responding to the operation instruction of the user and acquiring the configuration file of the target interface inspection group; the configuration file is used for configuring an online inspection environment of the target interface inspection group;
the execution unit is used for calling a corresponding test script and the test data to generate a test result when the execution time of the test plan of the target interface inspection group in the pre-configured interface inspection task is reached; the interface inspection task comprises a test plan set which is correspondingly combined according to the characteristics of different interfaces and the types of interface test results.
An automatic inspection device of an interface comprises a memory and a processor;
the memory is used for storing instructions;
the processor is configured to execute instructions stored in the memory to implement the automatic inspection method of the interface described in any of the above.
A storage medium having stored thereon a computer program which, when executed by a processor, enables an automatic inspection method of an interface as claimed in any one of the preceding claims.
According to the scheme, the automatic inspection method, the device, the equipment and the storage medium of the interface disclosed by the application acquire the target interface inspection group and the test plan of the target interface inspection group, generate the test script according to the test plan, acquire the test data according to the test script, acquire the configuration file, and call the corresponding test script and the test data when the execution time of the test plan of the target interface inspection group in the preconfigured interface inspection task is reached, so as to generate the test result. According to the method and the device, the test script is automatically generated, the requirement on the code capacity of a test engineer is reduced, the preconfigured interface inspection task comprising the test plan set correspondingly combined according to the characteristics of different interfaces and the types of interface test results is executed, the running state of the multi-dimensional detection interface in the on-line inspection environment can be detected, the on-line inspection time of the interface is shortened, and the on-line inspection efficiency of the interface is high.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings that are required to be used in the embodiments or the description of the prior art will be briefly described below, and it is obvious that the drawings in the following description are only embodiments of the present application, and that other drawings may be obtained according to the provided drawings without inventive effort to a person skilled in the art.
FIG. 1 is a schematic flow chart of an automatic inspection method of an interface provided in the present application;
FIG. 2 is another flow chart of the automatic inspection method of the interface provided by the present application;
FIG. 3 is a flowchart illustrating an exemplary method for automatic inspection of an interface provided herein;
FIG. 4 is a block diagram of the components of the automatic inspection device of the interface provided by the present application;
fig. 5 is a hardware block diagram of the automatic inspection device of the interface provided in the present application.
Detailed Description
The following description of the embodiments of the present application will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are only some, but not all, of the embodiments of the present application. All other embodiments, which can be made by one of ordinary skill in the art without undue burden from the present disclosure, are within the scope of the present disclosure.
The term "including" and variations thereof as used herein are intended to be open-ended, i.e., including, but not limited to. The term "based on" is based at least in part on. The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments. Related definitions of other terms will be given in the description below.
It should be noted that the terms "first," "second," and the like herein are merely used for distinguishing between different devices, modules, or units and not for limiting the order or interdependence of the functions performed by such devices, modules, or units.
It should be noted that references to "one" or "a plurality" in this application are intended to be illustrative rather than limiting, and those of ordinary skill in the art will appreciate that "one or more" is intended to be interpreted as "one or more" unless the context clearly indicates otherwise.
When the conventional interface test executes an online inspection plan, engineers are required to independently edit test programs for all interfaces, the required time is long, and the inspection efficiency is low.
The conventional interface test system only realizes the inspection of a service interface in a test environment, and in a test life cycle closed loop of creating a plan, executing the plan, reporting output and alarming abnormality, database dropping abnormality of the test environment data can occur more or less, so that the online inspection is affected by non-defect problems, such as system dirty data, failure of interface original data and the like, and stability and inspection results are unfavorable for the inspection system. Even if closed loop inspection can be completed, the test environment and the accuracy of test data are uncontrollable factors, and the confidence of the existing inspection system is low.
In order to solve the problems, the application provides an automatic inspection method, device, equipment and storage medium of an interface.
Referring to fig. 1, a flow chart of an automatic inspection method of an interface provided in the present application, as shown in fig. 1, the automatic inspection method of an interface includes the following steps:
step 101, obtaining a target interface inspection group and a test plan of the target interface inspection group, and generating at least one test script according to the test plan, wherein the test script is used for testing at least one interface.
It should be noted that, the target interface inspection group is determined according to preset screening conditions, where the preset screening conditions include at least one of interface service type, interface priority and demander specification, that is, three screening conditions may be used alone or in combination.
For example, when screening is performed for a single service line requirement, screening configuration of interfaces is performed only for different priorities in the single service line; the multi-service line can carry out screening configuration of interfaces under the condition of calling each other; when the demander puts forward a designated interface, the relevant connection port of the designated interface is also used by the screening configuration. The target interface inspection group in the application can be formulated by related personnel performing interface tests.
The test plan contains the business identification of the interface, the English name of the interface, the path of the interface, the description of the interface, the specified test logic and the like. The test plan includes a plurality of test scripts, one of which may be used to test one or more interfaces. It can be understood that the test plan is a set of a series of interface tests, and the set can be a single-interface multi-scenario test, or a business process scenario test, and specifically can include a forward scenario test, a reverse scenario test and a special scenario test.
The test plan includes a functional point coverage test, an abnormal point coverage test, and a limit value coverage test. Exemplary, functional point coverage tests include: whether the editing operation in the form item can be successfully edited; the outlier coverage test includes: in the form editing, filling out abnormal content, and judging whether the editing is successful; the limit value coverage test includes: the boundary value test of form filling checks whether the rear end makes boundary judgment, such as a money amount related scene, and can be particularly used in a money amount sensitive scene and a scene with a comparison of magnitude values.
It should be noted that, when the interfaces are in different interface inspection groups, the execution of the test data needs to be differentiated. For example, the interface inspection group 1 and the interface inspection group 2 are both required to find the content of the current shopping cart, and then execute the next operation, that is, the interface of the shopping cart is inquired to be used once in the interface inspection group 1 and the interface inspection group 2. Therefore, the test data of the inquiry shopping cart interface in the interface inspection group 1 and the interface inspection group 2 need to be distinguished.
If the interface function point is covered by some logic, response judgment under different conditions needs to be written in the test plan. For example, a promotional program, the program has states that are not started, ongoing, paused, ended, deleted. The user may be priced while the activity is in progress, and may not be priced after the activity is completed. Therefore, after the current state of the activity needs to be judged to be written in the test plan, whether prize verification is carried out is judged.
It should be noted that, the test script is automatically generated according to the entered test plan, the test plan is entered into the system, and clicking the "generating script" system generates the test script according to the entered test plan. Specifically, when the interface path in the test plan is recorded, the interface has a unique path, such as/home/root, and the like, the data source contains path information, and the method is used for matching the content to be recorded from the data source.
Optionally, the pre-screened target interface inspection group and the test plan corresponding to the target interface inspection group are input into a test system, and then a test script is automatically generated according to the test plan.
Specifically, the process of determining the target interface inspection group may include: classifying according to service lines of the interfaces; judging the priority of interface test by using the interface as core flow interface in service. For example, the login interface is a high-priority interface, and the page query interface is a medium-priority interface; the priority of the interfaces may also be arranged by a person familiar with the business or by a tester of the corresponding business. The interface with high interface priority is selected most preferentially, and the selected interface group comprises a single interface or a plurality of interfaces with the same dimension. The target interface inspection group is a set of interfaces to be tested, and the testing sequence of the interfaces is arranged according to specific business processes. An interface inspection group can be regarded as a business process and only comprises interfaces related to the business process, and when a plurality of business processes exist, the coverage rate of the interfaces is increased.
And 102, acquiring test data according to the test script.
Since the test plan does not include test data required for the test, the test script generated according to the test plan does not necessarily include test data required for the test, such as data qurey, body, file, and the like, it is necessary to add the test data.
It should be noted that, there are two main methods for acquiring test data, the first is manual entry, and the second is on-line introduction according to the test script. Moreover, the test data corresponding to each test script is different, that is, the test data included in each test plan is different, for example, the login information of the user may be different, which may cause the content of the test data to be different. That is, the test data cannot be generic.
Optionally, the test data corresponding to the test script is manually entered or the desired test data is captured on-line.
The method and the device can separate the test script from the test data. Specifically, the test data is directly supplemented in the recorded test plan, or the online data is directly stripped. Specifically, the online data can be stripped from the kibana, clicking on "export JSON" will generate JSON files according to the entered data. json files are purely data files used in the automation framework in the system. The stripped content from the kibana can be online interface data, the stripped content is copied from the kibana to serve as test data, online captured data can simulate real user operation, and test data errors are avoided.
Step 103, responding to an operation instruction of a user, and acquiring a configuration file of the target interface inspection group; the configuration file is used for configuring an online inspection environment of the target interface inspection group.
It should be noted that the configuration file is used to configure an online inspection environment for the target inspection group. Automated framework execution of the system requires that the online inspection environment be pre-configured via a configuration file.
Optionally, the user may select a configuration file executed by the automation framework on a polling configuration page of the system, and configure an online polling environment through the configuration file.
Specifically, the execution in the automation framework is realized by configuring different configuration files, so that interfaces can be operated in different environments, the purpose of online selection of the operation environments is achieved, and preparation is made for timing inspection tasks. The configuration items of the system configuration file can be env, and can be switched between test and work environments, so that the distinction between a test environment test plan and an online environment test plan is met.
It will be appreciated that upon execution of the test plan, the system will use ini to convert json objects into ini strings, pushing test scripts, test data and configuration files to designated locations in the execution server, i.e., corresponding modules in the automation framework, via message queue requests.
104, when the execution time of the test plan of the target interface inspection group in the pre-configured interface inspection task is reached, calling the corresponding test script and the corresponding test data to generate a test result; the interface inspection task comprises a test plan set which is correspondingly combined according to the characteristics of different interfaces and the types of interface test results.
It should be noted that, the preset interface inspection task may be a test plan set formed by combining different interface characteristics and interface test results, where an online inspection task includes a plurality of test plans, and the online inspection task is a circulation task. Specifically, according to the characteristics of different interfaces, a tester can freely combine the test plans to form an interface inspection task; aiming at the special interface, the method can agree with the returned data index with the execution server, and establish an online inspection task from different dimensions. For example, different test plans may be combined from the result type partitions of the interface.
The on-line inspection task comprises inspection time, inspection indexes and an alarm mode.
For the patrol time:
the on-line inspection task may be selected to be performed at a fixed time, such as on a weekly day of week or daily; the execution time can also be customized, such as once every half hour, a single execution, or permanently valid.
For the inspection index, it may include:
whether the interface is operated successfully;
the interface response total time can check whether detailed information is recorded, if so, the time sequence detailed time is requested, such as DNS (Domain Name System ) resolution, TCP (Transmission Control Protocol, transmission control protocol) connection establishment, content transmission and the like; request header, such as content-type, cookie, host, etc.; return header, e.g., date, connection, vary, etc. When some specific interfaces run and execute, detailed running information needs to be recorded. The presentation mode of the returned data index is agreed with the execution server, and can be directly acquired in the report of the automatic execution framework.
The interface returns a status code and message.
For the alarm mode:
mail notification can be selected to be sent, and a notification template is preset;
a flying book robot notification may be selected;
the notification mode can also be customized.
Optionally, when the execution time of the test plan where the target inspection group is located in the online inspection task is reached, the test script and the test data are called to execute the test plan, and a test result is generated.
It should be noted that, after the task period of the online inspection task is finished, a test report is generated, and a tester can check the current test result or check the future result through a history report.
When the on-line inspection tasks are more, the number of data packets of the test report is increased, and correspondingly, the pressure of the server is increased.
The on-line inspection method of the interface can be developed secondarily on the interface management platform yapi, and the needed interface, time and the interface test point to be concerned by inspection are selected arbitrarily by taking the timing task as the dimension. The interface management module of the platform can provide test scripts and inspection plans related to the interface information. The on-line inspection task comprises an inspection plan list, a plurality of tasks can be simultaneously executed, and a task container on the platform can receive a plurality of timing tasks to execute according to a time rule.
The application can generate test scripts and test data by one key, and can carry out multi-scene combined test on the interface of online inspection, and the used technology can comprise: js, pytest, message queue, distributed system. The js technology is used for standardizing the test script and the test data, so that the use is simple; upgrade pytest to more perfect free test frame, let each module can be clearly combined or split; the message queue can decouple the logic of a plurality of online inspection tasks, so that blocking is avoided; the alarm system adopts a distributed mode, so that the problem can be solved in time.
In addition, the on-line inspection test flow provided by the application is very flexible, for example, the same interface can be arbitrarily combined to generate a test plan, different interfaces are arranged and combined according to the service flow to generate the test plan, and a tester can accurately control the interfaces related to the service to complete the configuration of the test plan in advance.
Specifically, the unified management interface original data in the application can be managed by using a yapi tool; the unified interface calls a data source, allows a user to manually input data, and also allows on-line data to be grabbed in the automatic kibana, so that the data content is consistent with the on-line data, and uncontrollable factors are reduced. And different test time and indexes can be set for different combinations, so that the content of interface test is wider.
In summary, according to the automatic inspection method of the interface disclosed by the application, the target interface inspection group and the test plan of the target interface inspection group are obtained, the test script is generated according to the test plan, then the test data is obtained according to the test script, the configuration file is obtained, and when the execution time of the test plan of the target interface inspection group in the preconfigured interface inspection task is reached, the corresponding test script and the test data are called, and the test result is generated. According to the method and the device, the test script is automatically generated, the requirement on the code capacity of a test engineer is reduced, the preconfigured interface inspection task comprising the test plan set correspondingly combined according to the characteristics of different interfaces and the types of interface test results is executed, the running state of the multi-dimensional detection interface in the on-line inspection environment can be detected, the on-line inspection time of the interface is shortened, and the on-line inspection efficiency of the interface is high.
Referring to fig. 2, another flow chart of the automatic inspection method of the interface provided in the present application, as shown in fig. 2, the automatic inspection method of the interface further includes the following steps:
it should be noted that, the alarm mode provided in the present application includes an alarm rule, and may specifically be a program output according to different priorities and different modes. In the alarm rule, the alarm information can be configured by user definition according to different service lines, priorities of different interfaces or client-specified interfaces in the inspection plan.
Step 201, analyzing the test result to determine whether the test plan meets the inspection index.
And each time the on-line inspection task executes a task period, a test report is correspondingly generated, and the test result is analyzed so as to facilitate adjustment of the test plan. The method mainly comprises the step of analyzing whether a test technology corresponding to a test result meets a preset test index. The test plan of the department group test index is adjusted, the on-line inspection task can be stopped or started by one key, and the fact that the starting and stopping are only appointed for the execution period of the next inspection task is confirmed, and if the current execution period is being executed, the current execution period is not influenced.
And 202, notifying a task responsible person in the alarm mode when the test plan is judged not to meet the inspection index.
Optionally, when the test plan is detected not to meet the preset inspection index, notifying the processor in a preset alarm mode, which can also be called as a task responsible person.
Specifically, if the task responsible person processes the alarm corresponding to the abnormal test plan before the next inspection cycle, the alarm strategy detects that the alarm is processed, and the new cycle continues to execute the inspection task comprising the abnormal test plan; if the task responsible person does not process the alarm corresponding to the abnormal test plan before the next inspection cycle, the alarm strategy detects that the alarm is not processed, the alarm is given again, the task responsible person at the previous stage is informed, and the new cycle does not execute the inspection task comprising the abnormal test plan. The first processor can not process the problem, and timely reminds the former-stage processor, so that the problem is guaranteed to be solved in time.
It should be noted that, if the alarm rule is triggered by the error, it is necessary to determine whether the alarm is needed again through the alarm policy. If the alarm is given or not processed according to the set time, the alarm is given again.
Correspondingly, the online inspection task can adjust the test plan according to the analysis result of the test result. If the test result returns to normal, the test plan continues to be concerned. If the test result returns failure, checking the failure reason, and if the failure reason cannot be directly confirmed, checking the detailed record of the response result.
The specific processing means may include notifying a responsible person of the on-line inspection task, and stopping the task by one key. The task will not be executed in the next inspection cycle; notifying the responsible person of the on-line inspection task, without stopping the on-line inspection task, the task can continue to be executed in the next inspection period, but may cause continuous errors of the following inspection task due to midway data in the last task, and inconsistent with the errors when the errors are reported for the first time. To avoid this, the alarm policy checks whether the last failed task has been processed before the next polling cycle task is executed, confirms that a new code has been submitted, and if a problem is detected to have been attended to, the new polling cycle will continue to execute the polling task. Before the task of the next inspection cycle is executed, the alarm strategy firstly checks the last failed task, if the task is not processed, the inspection task is not continuously executed in a new cycle, the alarm is carried out again, and meanwhile, a previous processor is notified until the fact that the inspection task with the error report is processed is detected, and the inspection task is continuously executed in the new cycle of inspection cycle.
Optionally, referring to fig. 3, an exemplary flowchart of an automatic inspection method for an interface is provided.
And acquiring an interface group to be tested, sorting the access sequence of the interfaces according to the service flow, acquiring interface request data from kibana, editing the expected return result of the interfaces, and finally executing a test plan and checking the result.
It should be noted that, in addition to capturing online data by using kibana, similar products of kibana may be used in the present application, for example: knowi, splenk; agent interception analysis may also be employed, or the data may be constructed manually.
According to the embodiment, the test plan is flexibly written, the cross-business line flow test plan, the single-business workflow test plan and the plurality of single-interface test plans are supported, and in addition, the online data can be captured by using kibana, so that the user behavior is truly simulated. The closed loop scheme of interface test reduces the use threshold, and a user can complete preparation of a test plan by deploying an interface flow, and other interference factors in an interface inspection task are less.
For the automatic inspection method of the interface, the application also provides an automatic inspection device of the interface, and the composition of the device is shown in fig. 4.
A first acquisition unit 10, a second acquisition unit 20, a third acquisition unit 30, and an execution unit 40, wherein:
a first obtaining unit 10, configured to obtain a target interface inspection group and a test plan of the target interface inspection group, and generate at least one test script according to the test plan, where the test script is used to test at least one interface;
a second obtaining unit 20, configured to obtain test data according to a test script;
a third obtaining unit 30, configured to obtain a configuration file of the target interface inspection group in response to an operation instruction of a user; the configuration file is used for configuring an online inspection environment of the target interface inspection group;
the execution unit 40 is configured to invoke a corresponding test script and test data when the execution time of the test plan of the target interface inspection group in the preconfigured interface inspection task is reached, and generate a test result; the interface inspection task comprises a test plan set which is correspondingly combined according to the characteristics of different interfaces and the types of interface test results.
In an embodiment, the target interface routing group in the first obtaining unit 10 is determined according to a preset screening condition, where the preset screening condition includes at least one of an interface service type, an interface priority, and a demander specification.
In an embodiment, the second obtaining unit 20 is specifically configured to:
directly acquiring the manually entered test data corresponding to the test script;
or capturing the test data according to the test script line.
In an embodiment, the test plan in the first acquisition unit 10 includes a function point coverage test, an abnormal point coverage test, and a limit value coverage test.
In one embodiment, the interface inspection tasks in the execution unit 40 include inspection time, inspection index, and alarm mode.
In an embodiment, the device further includes an alarm unit, specifically configured to:
analyzing the test result to judge whether the test plan meets the inspection index;
and when the test plan is judged not to meet the inspection index, notifying a task responsible person in the alarm mode.
In one embodiment, the alarm unit is specifically configured to:
if the task responsible person processes the alarm corresponding to the abnormal test plan before the next inspection cycle, the alarm strategy detects that the alarm is processed, and the new cycle continues to execute the inspection task comprising the abnormal test plan;
if the task responsible person does not process the alarm corresponding to the abnormal test plan before the next inspection cycle, the alarm strategy detects that the alarm is not processed, the alarm is given again, the task responsible person at the upper level of the task responsible person is informed, and the inspection task comprising the abnormal test plan is not executed in a new cycle.
Optionally, the present application further provides an automatic inspection device of an interface, as shown in fig. 5, and the hardware structural block diagram of the automatic inspection device of an interface provided by the present application mainly includes a processor 1 and a memory 3, and at least one processor 1, at least one communication interface 2, at least one memory 3 and at least one communication bus 4.
The memory 3 is used for storing instructions;
the processor 1 is configured to execute the instructions stored in the memory, so as to implement each process flow of the automatic inspection method of the interface.
In addition, the embodiment of the application also provides a storage medium, on which a computer program is stored, and when the computer program is executed by a processor, each processing flow of the automatic inspection method of the interface can be realized.
It should be noted that, in the present specification, each embodiment is described in a progressive manner, and each embodiment is mainly described as different from other embodiments, and identical and similar parts between the embodiments are all enough to be referred to each other.
For convenience of description, the above system or apparatus is described as being functionally divided into various modules or units, respectively. Of course, the functions of each element may be implemented in one or more software and/or hardware elements when implemented in the present application.
From the above description of embodiments, it will be apparent to those skilled in the art that the present application may be implemented in software plus a necessary general purpose hardware platform. Based on such understanding, the technical solutions of the present application may be embodied essentially or in a part contributing to the prior art in the form of a software product, which may be stored in a storage medium, such as a ROM/RAM, a magnetic disk, an optical disk, etc., including several instructions to cause a computer device (which may be a personal computer, a server, or a network device, etc.) to perform the methods described in the embodiments or some parts of the embodiments of the present application.
Finally, it is further noted that relational terms such as first, second, third, fourth, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The foregoing is merely a preferred embodiment of the present application and it should be noted that modifications and adaptations to those skilled in the art may be made without departing from the principles of the present application and are intended to be comprehended within the scope of the present application.

Claims (8)

1. An automatic inspection method of an interface, comprising:
acquiring a target interface inspection group and a test plan of the target interface inspection group, and generating at least one test script according to the test plan, wherein the test script is used for testing at least one interface;
obtaining test data according to the test script;
responding to an operation instruction of a user, and acquiring a configuration file of the target interface inspection group; the configuration file is used for configuring an online inspection environment of the target interface inspection group;
when the execution time of the test plan of the target interface inspection group in the pre-configured interface inspection task is reached, the corresponding test script and the corresponding test data are called, and a test result is generated; the interface inspection task comprises a test plan set correspondingly combined according to the characteristics of different interfaces and the types of interface test results;
the target interface inspection group is determined according to preset screening conditions, wherein the preset screening conditions comprise at least one of interface service types, interface priorities and requirements; when screening is required to be carried out on a single service line, the screening configuration of interfaces is carried out only on different priorities in the single service line; the multi-service line performs screening configuration of interfaces under the condition of calling each other; when the demander puts forward a designated interface, the related connection port of the designated interface is also used by screening configuration;
wherein, the obtaining test data according to the test script includes:
directly acquiring the manually entered test data corresponding to the test script;
or capturing the test data according to the test script line.
2. The automated inspection method of an interface of claim 1, wherein the test plan includes a function point coverage test, an outlier coverage test, and a limit value coverage test.
3. The method according to claim 1, wherein the interface inspection task includes inspection time, inspection index and alarm mode.
4. The method for automatic inspection of an interface of claim 3, further comprising
Analyzing the test result to judge whether the test plan meets the inspection index;
and when the test plan is judged not to meet the inspection index, notifying a task responsible person in the alarm mode.
5. The method for automatic inspection of an interface of claim 4, further comprising:
if the task responsible person processes the alarm corresponding to the abnormal test plan before the next inspection cycle, the alarm strategy detects that the alarm is processed, and the new cycle continues to execute the inspection task comprising the abnormal test plan;
if the task responsible person does not process the alarm corresponding to the abnormal test plan before the next inspection cycle, the alarm strategy detects that the alarm is not processed, the alarm is given again, the task responsible person at the upper level of the task responsible person is informed, and the inspection task comprising the abnormal test plan is not executed in a new cycle.
6. An automatic inspection device of an interface, comprising:
the device comprises a first acquisition unit, a second acquisition unit, a third acquisition unit and an execution unit, wherein:
the first acquisition unit is used for acquiring a target interface inspection group and a test plan of the target interface inspection group, and generating at least one test script according to the test plan, wherein the test script is used for testing at least one interface;
the second acquisition unit is used for acquiring test data according to the test script;
the third obtaining unit is used for responding to an operation instruction of a user and obtaining a configuration file of the target interface inspection group; the configuration file is used for configuring an online inspection environment of the target interface inspection group;
the execution unit is used for calling the corresponding test script and the corresponding test data to generate a test result when the execution time of the test plan of the target interface inspection group in the pre-configured interface inspection task is reached; the interface inspection task comprises a test plan set correspondingly combined according to the characteristics of different interfaces and the types of interface test results;
the target interface inspection group is determined according to preset screening conditions, wherein the preset screening conditions comprise at least one of interface service types, interface priorities and requirements; when screening is required to be carried out on a single service line, the screening configuration of interfaces is carried out only on different priorities in the single service line; the multi-service line performs screening configuration of interfaces under the condition of calling each other; when the demander puts forward a designated interface, the related connection port of the designated interface is also used by screening configuration;
the second obtaining unit is specifically configured to directly obtain the manually entered test data corresponding to the test script; or capturing the test data according to the test script line.
7. An automatic inspection device of an interface is characterized by comprising a memory and a processor;
the memory is used for storing instructions;
the processor is configured to execute instructions stored in the memory to implement the method of automatic inspection of an interface as claimed in any one of claims 1 to 5.
8. A storage medium having stored thereon a computer program which, when executed by a processor, is capable of implementing an automatic inspection method of an interface as claimed in any one of claims 1 to 5.
CN202311749308.1A 2023-12-19 2023-12-19 Automatic inspection method, device and equipment for interface and storage medium Active CN117421255B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311749308.1A CN117421255B (en) 2023-12-19 2023-12-19 Automatic inspection method, device and equipment for interface and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311749308.1A CN117421255B (en) 2023-12-19 2023-12-19 Automatic inspection method, device and equipment for interface and storage medium

Publications (2)

Publication Number Publication Date
CN117421255A CN117421255A (en) 2024-01-19
CN117421255B true CN117421255B (en) 2024-04-09

Family

ID=89532954

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311749308.1A Active CN117421255B (en) 2023-12-19 2023-12-19 Automatic inspection method, device and equipment for interface and storage medium

Country Status (1)

Country Link
CN (1) CN117421255B (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102201934A (en) * 2011-05-05 2011-09-28 中国联合网络通信集团有限公司 Patrolling method and system for centralized management distributed automatic testing
CN111026602A (en) * 2019-10-22 2020-04-17 烽火通信科技股份有限公司 Health inspection scheduling management method and device of cloud platform and electronic equipment
CN112631900A (en) * 2020-12-14 2021-04-09 贝壳技术有限公司 Interface inspection method and device, electronic equipment and storage medium
WO2022016847A1 (en) * 2020-07-21 2022-01-27 国云科技股份有限公司 Automatic test method and device applied to cloud platform
CN116225915A (en) * 2023-02-07 2023-06-06 中电云数智科技有限公司 Automatic testing method and device for private cloud project delivery based on business inspection
CN116860608A (en) * 2023-06-06 2023-10-10 车智互联(北京)科技有限公司 Interface testing method and device, computing equipment and storage medium
CN116881166A (en) * 2023-07-28 2023-10-13 重庆赛力斯新能源汽车设计院有限公司 Method, device and system for generating test script

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11789855B2 (en) * 2021-12-23 2023-10-17 Jpmorgan Chase Bank, N.A. System and method for testing cloud hybrid AI/ML platforms

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102201934A (en) * 2011-05-05 2011-09-28 中国联合网络通信集团有限公司 Patrolling method and system for centralized management distributed automatic testing
CN111026602A (en) * 2019-10-22 2020-04-17 烽火通信科技股份有限公司 Health inspection scheduling management method and device of cloud platform and electronic equipment
WO2022016847A1 (en) * 2020-07-21 2022-01-27 国云科技股份有限公司 Automatic test method and device applied to cloud platform
CN112631900A (en) * 2020-12-14 2021-04-09 贝壳技术有限公司 Interface inspection method and device, electronic equipment and storage medium
CN116225915A (en) * 2023-02-07 2023-06-06 中电云数智科技有限公司 Automatic testing method and device for private cloud project delivery based on business inspection
CN116860608A (en) * 2023-06-06 2023-10-10 车智互联(北京)科技有限公司 Interface testing method and device, computing equipment and storage medium
CN116881166A (en) * 2023-07-28 2023-10-13 重庆赛力斯新能源汽车设计院有限公司 Method, device and system for generating test script

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
基于人工智能的同步测试巡检技术研究;潘峰;吕博;;信息通信技术与政策;20200915(第09期);全文 *

Also Published As

Publication number Publication date
CN117421255A (en) 2024-01-19

Similar Documents

Publication Publication Date Title
US10310968B2 (en) Developing software project plans based on developer sensitivity ratings detected from monitoring developer error patterns
US7664986B2 (en) System and method for determining fault isolation in an enterprise computing system
CN105550113B (en) Web test method and test machine
CN105027108B (en) Example host is configured
CN110138837A (en) Request processing method, device, computer equipment and storage medium
CN109582301A (en) Method for processing business, device, equipment and the medium of task based access control scheduling system
CN110928772A (en) Test method and device
US20040153837A1 (en) Automated testing
TWI255109B (en) Autonomic server farm, method of server failure diagnosis, and self-healing in a server farm
CN108491254A (en) A kind of dispatching method and device of data warehouse
CN108805667A (en) Order flow processing method and system
CN111026602A (en) Health inspection scheduling management method and device of cloud platform and electronic equipment
CN111563014A (en) Interface service performance test method, device, equipment and storage medium
US10891129B1 (en) Decentralized development operations blockchain system
CN113312153B (en) Cluster deployment method and device, electronic equipment and storage medium
CN110275992B (en) Emergency processing method, device, server and computer readable storage medium
CN112799782B (en) Model generation system, method, electronic device and storage medium
CN113051019A (en) Flow task execution control method, device and equipment
CN117422434A (en) Wisdom fortune dimension dispatch platform
CN113407973B (en) Software function authority management method, system, server and storage medium
CN110347735A (en) The data forwarding of configurationization mends processing method, device and readable storage medium storing program for executing extremely
CN117421255B (en) Automatic inspection method, device and equipment for interface and storage medium
CN108173711A (en) Enterprises system data exchange monitoring method
CN116974874A (en) Database testing method and device, electronic equipment and readable storage medium
CN116302989A (en) Pressure testing method and system, storage medium and computer equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant