CN111552633A - Interface abnormal call testing method and device, computer equipment and storage medium - Google Patents
Interface abnormal call testing method and device, computer equipment and storage medium Download PDFInfo
- Publication number
- CN111552633A CN111552633A CN202010235133.2A CN202010235133A CN111552633A CN 111552633 A CN111552633 A CN 111552633A CN 202010235133 A CN202010235133 A CN 202010235133A CN 111552633 A CN111552633 A CN 111552633A
- Authority
- CN
- China
- Prior art keywords
- interface
- test
- data
- target
- information
- 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
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Preventing errors by testing or debugging software
- G06F11/3668—Software testing
- G06F11/3672—Test management
- G06F11/3684—Test management for test design, e.g. generating new test cases
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Preventing errors by testing or debugging software
- G06F11/3668—Software testing
- G06F11/3672—Test management
- G06F11/3688—Test 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 embodiment of the application discloses an abnormal call testing method and device of an interface, computer equipment and a storage medium, and relates to the technical field of data testing. The method comprises the following steps: reading historical operation data; analyzing historical operation data, and extracting interface calling information and user operation behavior information; importing interface calling information and user operation behavior information into a Jmeter; generating an interactive interface through Jenkins; receiving test configuration information, and generating a target test case based on the test configuration information; and executing the target test case to perform interface exception calling test. The method can conveniently realize the test of the abnormal calling of the interface only by manually operating the whole process of the service once by a tester, is suitable for testing various service scenes, has high reusability, reduces manual operation, greatly improves the test efficiency, and can better fit the operation habit of a real user based on the test case generated by analyzing the data of the operation behavior of the user.
Description
Technical Field
The present application relates to the field of data testing technologies, and in particular, to a method and an apparatus for testing an abnormal call of an interface, a computer device, and a storage medium.
Background
In the service flow, the software technology service is mainly divided into a front-end system and a back-end system, and scenes such as weak network, broken network or DNS hijacking of the front end are usually encountered in the interaction process of the two systems, so that the back end cannot normally return a result to the front end after receiving a request of the front end and completing processing. At this time, if the front end clicks the button for submitting or updating again, the data of the order and the flow state of the order may be abnormal, and the business flow cannot be continued normally.
For such problem scenarios, an integrated automatic testing tool is lacking at present, and all front-end and back-end interactive testing scenarios can be covered during regression testing. The tester needs to perform manual testing on important nodes in a series of service flows such as service application information updating, service application submission, application result approval and the like, and can obtain a test result after configuring a series of network parameters, and the compiled test case is difficult to be attached to a real user operation, so that the test efficiency is low.
Disclosure of Invention
The technical problem to be solved by the embodiments of the present application is to provide a method, an apparatus, a computer device and a storage medium for testing an abnormal call of an interface, so as to reduce manual operations in a testing process, and make a generated test case closer to an operation habit of a real user.
In order to solve the above technical problem, an embodiment of the present application provides a method for testing an abnormal call of an interface, which adopts the following technical solutions:
an abnormal call test method of an interface comprises the following steps:
reading historical operation data related to a target service, wherein an executed complete interface calling process is recorded in the historical operation data;
analyzing the historical operation data, and extracting interface calling information and user operation behavior information captured in the interface calling process;
importing the interface calling information and the user operation behavior information into a Jmeter integrated into Jenkins;
generating an interactive interface for configuring an interface to call a test flow through Jenkins;
receiving test configuration information fed back by a target test user according to the interactive interface, and generating a target test case which accords with the interface calling test flow based on the test configuration information;
and executing the target test case to perform interface exception calling test.
In order to solve the above technical problem, an embodiment of the present application further provides an interface abnormal call testing apparatus, which adopts the following technical solutions:
an interface exception call testing apparatus comprising:
the data reading module is used for reading historical operation data related to the target service, and an executed complete interface calling process is recorded in the historical operation data;
the data analysis module is used for analyzing the historical operation data and extracting interface calling information and user operation behavior information captured in the interface calling process;
the information import module is used for importing the interface calling information and the user operation behavior information into a meter integrated into Jenkins;
the interface generation module is used for generating an interaction interface direction for configuring an interface to call a test flow through Jenkins;
the case generating module is used for receiving test configuration information fed back by a target test user according to the interactive interface and generating a target test case which accords with the interface calling test flow based on the test configuration information;
and the interface test module is used for executing the target test case to perform interface exception calling test.
In order to solve the above technical problem, an embodiment of the present application further provides a computer device, which adopts the following technical solutions:
a computer device comprising a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the interface abnormal call test method according to any one of the above technical solutions.
In order to solve the above technical problem, an embodiment of the present application further provides a computer-readable storage medium, which adopts the following technical solutions:
a computer readable storage medium, having stored thereon a computer program which, when executed by a processor, implements the steps of an interface exception call test method according to any one of the preceding claims.
Compared with the prior art, the embodiment of the application mainly has the following beneficial effects:
the embodiment of the application discloses an abnormal call testing method and device of an interface, computer equipment and a storage medium, wherein the abnormal call testing method of the interface reads and records historical operation data of an executed complete interface call flow; analyzing historical operation data, and extracting interface calling information and user operation behavior information captured in an interface calling process; importing interface calling information and user operation behavior information into a Jmeter integrated into Jenkins; then generating an interactive interface for configuring an interface to call a test flow through Jenkins; after receiving test configuration information fed back by a target test user according to the interactive interface, generating a target test case which accords with an interface calling test flow based on the test configuration information; and finally executing the target test case to perform interface exception calling test. The method can conveniently realize the test of the abnormal calling of the interface by using the configured automatic test platform only by manually operating the whole process of the service once by a tester, is suitable for testing various service scenes, has high reusability, greatly improves the test efficiency while reducing manual operation, and can better attach the test case generated based on data analysis of user operation behaviors to the operation habits of real users.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the embodiments will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings without creative efforts.
FIG. 1 is a diagram of an exemplary system architecture to which embodiments of the present application may be applied;
FIG. 2 is a flowchart of an embodiment of a method for testing an interface for an abnormal call in an embodiment of the present application;
FIG. 3 is a schematic structural diagram of an embodiment of an interface abnormal call testing apparatus according to an embodiment of the present application;
fig. 4 is a schematic structural diagram of an embodiment of a computer device in an embodiment of the present application.
Detailed Description
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein in the description of the present application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application.
It is noted that the terms "comprises," "comprising," and "having" and any variations thereof in the description and claims of this application and the drawings described above are intended to cover non-exclusive inclusions. For example, a process, method, system, article, or apparatus that comprises a list of steps or elements is not limited to only those steps or elements listed, but may alternatively include other steps or elements not listed, or inherent to such process, method, article, or apparatus. In the claims, the description and the drawings of the specification of the present application, relational terms such as "first" and "second", and the like, may be used solely to distinguish one entity/action/object from another entity/action/object without necessarily requiring or implying any actual such relationship or order between such entities/actions/objects.
Reference herein to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the application. The appearances of the phrase in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. It is explicitly and implicitly understood by one skilled in the art that the embodiments described herein can be combined with other embodiments.
In order to make the technical solutions of the present application better understood, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the relevant drawings in the embodiments of the present application.
As shown in fig. 1, the system architecture 100 may include a first terminal device 101, a second terminal device 102, a third terminal device 103, a network 104, and a server 105. The network 104 is used to provide a medium of communication links between the first terminal device 101, the second terminal device 102, the third terminal device 103 and the server 105. Network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few.
The user may use the first terminal device 101, the second terminal device 102 and the third terminal device 103 to interact with the server 105 through the network 104 to receive or send messages or the like. Various communication client applications, such as a web browser application, a shopping application, a search application, an instant messaging tool, a mailbox client, social platform software, and the like, may be installed on the first terminal device 101, the second terminal device 102, and the third terminal device 103.
The first terminal device 101, the second terminal device 102 and the third terminal device 103 may be various electronic devices having display screens and supporting web browsing, including but not limited to smart phones, tablet computers, e-book readers, MP3 players (Moving Picture Experts Group Audio Layer III, motion Picture Experts compression standard Audio Layer 3), MP4 players (Moving Picture Experts Group Audio Layer IV, motion Picture Experts compression standard Audio Layer 4), laptop portable computers, desktop computers, and the like.
The server 105 may be a server that provides various services, such as a background server that provides support for pages displayed on the first terminal apparatus 101, the first terminal apparatus 102, and the third terminal apparatus 103.
It should be noted that the method for testing an abnormal call of an interface provided in the embodiment of the present application is generally executed by a server/terminal device, and accordingly, the apparatus for testing an abnormal call of an interface is generally disposed in the server/terminal device.
It should be understood that the number of terminal devices, networks, and servers in fig. 1 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
With continuing reference to FIG. 2, a flowchart of one embodiment of a method for testing an interface for abnormal calls as described in embodiments of the present application is shown. The abnormal call testing method of the interface comprises the following steps:
step 201: and reading historical operation data about the target service, wherein a complete executed interface calling process is recorded in the historical operation data.
Before the step is executed, a test user needs to manually operate a complete whole flow related to the target service, so that the server captures user data related to the flow through an auxiliary tool such as a packet capturing tool in the process of responding to the user operation and executing the flow, and the captured user data is recorded as historical operation data. It can be understood that a complete whole flow of the target service is included in one complete interface call flow.
Step 202: and analyzing the historical operation data, and extracting interface calling information and user operation behavior information captured in the interface calling process.
In the application, the test case is generated mainly according to two main data in the historical operation data, namely interface calling information and user operation behavior information.
The interface calling information is data related to specific interface calling operation in historical operation data. When recording historical operation data, a tester captures contents related to interface calling in the whole target business process through a charles capture tool, captures and exports operation information for submitting and synchronizing all order information in the process, and records interfaces and interface types related in the operation process. The interface types can be identified and distinguished according to the interface usage, such as interfaces divided into application information updating, application information submitting, loan application submitting and the like.
In a specific embodiment, after the operation information is derived, login information can be configured, and a specific verification mode is set for an access way of the operation information. For example, the login information may include: login account, login password, token authentication, session authentication and the like. The operation information is historical operation data, and when the historical operation data is read, verification and right confirmation are required to be carried out through information modes such as an account and a password.
The user operation behavior information refers to data which are acquired through the buried point and relate to user operation contents in the information capturing process, and is used for assisting the generation of the test case, so that the generated test case can be closer to the actual operation of the user. The buried point can be understood as an event detection deployment, which is a record of user behavior processes and results in order to meet the requirements of quick, efficient and rich data application. The user operation behavior information comprises: clicking, sliding, inputting text, page jumping, and not operating browsing time and closing windows after opening.
In some embodiments of the present application, the step 201 comprises: and reading a json structure file which stores historical operation data about the target service.
The step 202 comprises: analyzing the json structure file to obtain the historical operation data;
and identifying the historical operation data according to a preset interface identifier and a preset behavior identifier, and extracting interface calling information and user operation behavior information from the historical operation data.
In the embodiment, the historical operation data captured by the packet capture tool is recorded and stored in the form of a json structure file. JSON (JavaScript Object Notation) is a lightweight data exchange format. The Json format records data in a key-value mode, is very visual and concise, is easy to read and write by people, is easy to analyze and generate by a machine, and can effectively improve the network transmission efficiency.
For the historical operation data stored in the json interface file, an interface identifier can be set for the interface calling information in advance, and a behavior identifier can be set for the user operation behavior information in advance. Therefore, the json structure file is read and then analyzed, so that the identification can be more conveniently carried out according to the interface identification and the behavior identification, and the interface calling information and the user operation behavior information which are captured in advance are respectively extracted from the historical operation data.
In some embodiments of the present application, the method for testing an interface by exception call further includes: and analyzing the user operation behavior information, and dividing the user operation behavior information into user dimension information used for representing single user operation behavior and interaction dimension information used for representing integral user retention degree.
The user operation information is divided into two dimensions, namely the user dimension and the interaction dimension, so that the user operation information is divided more specifically, and the user behavior can be analyzed more conveniently and the behavior habit of the user can be known more clearly. And the user dimension information in the user dimension is used for representing the operation behavior of a single user, and the interaction dimension information in the interaction dimension is used for representing the retention degree of the whole user according to the statistical information.
Wherein, the user dimension information comprises: the input time of each input information item, the modification times of the information items, each input result, the retention time of the whole page and the like; the interaction dimension information comprises: the number of views per page, the number of clicks per button in the page, etc.
Step 203: and importing the interface calling information and the user operation behavior information into a Jmeter integrated into Jenkins.
Jmeter is a tool for stress and performance testing of software that can be used to generate interface test cases. Jenkins is an open-source and expandable continuous integration platform, a plurality of plug-ins can be installed and deployed on Jenkins, and a series of tasks can be conveniently executed through the plug-ins, such as deployment of a Jmeter service for interface testing.
And the interface calling information and the user operation behavior information are jointly imported into a Jmeter which is deployed to jenkins, so that the generated test case can accord with the test scene called by the current interface and is closer to the operation habit of the user.
Step 204: and generating an interactive interface for configuring the interface to call the test flow through Jenkins.
A page is provided for a test user to configure interface calling information of an interface test case through Jenkins, and real data collected by a previous buried point can be displayed on the page so as to be referred by a tester during configuration. The calling information of a single interface can be configured, and during specific configuration, the default value in each interface configuration item can be set as the corresponding interface request type, request header and other specific configuration information captured and packaged in the previous complete interface calling process in advance, and if the specific configuration information needs to be modified according to the current test requirement, the default value is directly edited and modified and then stored.
When configuring, a tester can first select an interface to be called to configure an interface calling link of a test case to be generated, and then configure configuration item information of each interface in the interface calling link, thereby completing information configuration of a complete interface calling test flow. For example, for an interface call test flow of a specific service logic, A, B, C, D, E, F six interfaces are selected, the call sequence of ABCDEF is used to specify the interface call link, and the waiting time between the interface calls is set.
In a specific embodiment of the present application, an interface call flow corresponding to a specific service is set to satisfy that the number of interface calls is 5 and the interface call sequence is ABCDE. Since the user front-end network is likely to have repeated calls or abnormal calls of the interface to cause system processing exception, we need to implement interface test for these abnormal scenarios.
If the abnormal calling test of the interface flow is needed, an interface abnormal calling link with missing information such as ABDE can be configured; if the abnormal calling test of the repeated calling of the interface is needed, an abnormal calling link of the interface caused by simulating the subjective backspacing of a user, such as ABCDEE, can be configured; in particular, an interface call link of an incomplete flow such as ABC can be generated according to information such as user retention rate caught by a buried point.
Step 205: and receiving test configuration information fed back by a target test user according to the interactive interface, and generating a target test case which accords with the interface call test flow based on the test configuration information.
After the server receives the test configuration information configured by the tester and related to the interface calling test flow, the target test case which accords with the test configuration information can be generated conveniently through the Jmeter. Specifically, the server generates the target test case in a form of generating a Jmeter script.
In this embodiment of the application, the electronic device (for example, the server/terminal device shown in fig. 1) on which the interface abnormal call test method operates may receive the test configuration information in a wired connection manner or a wireless connection manner. It should be noted that the wireless connection means may include, but is not limited to, a 3G/4G connection, a WiFi connection, a bluetooth connection, a WiMAX connection, a Zigbee connection, a uwb (ultra wideband) connection, and other wireless connection means now known or developed in the future.
Step 206: and executing the target test case to perform interface exception calling test.
When the interface abnormal calling test is carried out, the Jenkins drive is used for executing the Jmeter script for testing, and finally, a tester can judge whether a system error caused by the interface abnormal calling exists or not through data acquired in the testing process.
In some embodiments of the present application, before step 206, the method for testing the interface by exception call further comprises:
setting log monitoring for a target business process;
acquiring keywords which correspond to each interface in a monitoring log of the complete interface calling process and indicate that a processing result is normal;
and generating an interface keyword set according to the keywords.
In the embodiment of the application, the test result of the abnormal call of the interface is assisted to be checked in a log monitoring mode. When a complete interface calling flow is executed in advance to generate historical operation data about a target service, log monitoring is established, keywords which respectively correspond to each interface and are used for indicating that a processing result is normal are captured from a monitoring log obtained by the log monitoring, and all the obtained keywords are collected to generate an interface keyword set which is stored in a server database.
In a further specific embodiment, the step 206 further includes:
reading an interface keyword set, and acquiring a target keyword corresponding to an interface related to the target test case in the interface keyword set;
acquiring a monitoring log for executing the target test case, executing log retrieval in the monitoring log according to the target keyword, and generating a log test report according to a retrieval result;
and judging whether the interface calling test flow corresponding to the target test case is normally processed and finished or not based on the log test report.
And simultaneously, executing the target test case for testing, and synchronously outputting a log test report through log monitoring. When the log test report is generated, firstly, an interface corresponding to the target test case is determined to call an interface involved in the test flow, then a target keyword is found in an interface keyword set according to the interface, then the target keyword is used as a retrieval condition to query in the generated monitoring log, and according to the queried log content, a tester can be assisted to judge whether the server normally processes the service scene simulated by the target test case.
In some embodiments of the present application, the method for testing an interface by exception call further includes:
when the target test case is executed to carry out interface abnormal calling test, a data query instruction is generated based on the interface calling flow;
executing the data query instruction, and querying the current data state of the service data related to the interface calling process in the database;
and generating a data updating result according to the current data state of the service data and sending the data updating result to the target test user so as to judge whether the current data state is abnormal or not by the target test user.
Due to the fact that data generated after the target test case is executed is updated, when whether the data is abnormally updated or not is judged, for example, whether application information is abnormally updated or not, whether order states are normal or not, whether loan flow and borrowing data are wrong or not and the like are judged, the data can not be automatically judged by a server generally, and manual judgment needs to be carried out by target testers. Therefore, after the interface abnormal calling test is executed, the server automatically generates a data query instruction, and synchronously outputs a data update result to a target user by responding to the data query instruction to query the data update result of the service data so as to judge whether the current data state of the service data is abnormal or not. Specifically, the data query instruction may be generated by a pre-configured database query script, and the database query script is automatically activated after executing the target test case to configure the data query instruction related to the interface call flow.
In some embodiments of the present application, after step 206, the method for testing the interface by exception call further comprises:
determining expected result data of the target test case, and acquiring actual output data of the target test case;
and comparing the actual output data with the expected result data, and generating a test report according to the result of data comparison.
After a target test case is generated, evaluating the target test case to determine expected result data when the target test case is tested, comparing actual output data with the expected result data after actual test is executed to obtain actual output data of the test, judging whether the actual output data is matched with the expected result data, generating a test report for a tester to check and analyze the test result to determine the expected result data of the target test case, and acquiring the actual output data of the target test case;
and comparing the actual output data with the expected result data, and generating a test report according to the result of data comparison.
According to the interface abnormal calling test method, only the whole process of the service is manually operated once by a tester, the test for the interface abnormal calling can be conveniently realized by using the configured automatic test platform, the method is suitable for testing various service scenes, the reusability is high, the test efficiency is greatly improved while the manual operation is reduced, and the test case generated based on the data analysis of the user operation behavior can be well attached to the operation habit of a real user.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by a computer program, which can be stored in a computer-readable storage medium, and can include the processes of the embodiments of the methods described above when the computer program is executed. The storage medium may be a non-volatile storage medium such as a magnetic disk, an optical disk, a Read-Only Memory (ROM), or a Random Access Memory (RAM).
It should be understood that, although the steps in the flowcharts of the figures are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and may be performed in other orders unless explicitly stated herein. Moreover, at least a portion of the steps in the flow chart of the figure may include multiple sub-steps or multiple stages, which are not necessarily performed at the same time, but may be performed at different times, which are not necessarily performed in sequence, but may be performed alternately or alternately with other steps or at least a portion of the sub-steps or stages of other steps.
With further reference to fig. 3, fig. 3 is a schematic structural diagram of an embodiment of a device for invoking an exception test for an interface described in an embodiment of the present application. As an implementation of the method shown in fig. 2, the present application provides an embodiment of an interface exception call testing apparatus, where the embodiment of the apparatus corresponds to the embodiment of the method shown in fig. 2, and the apparatus may be specifically applied to various electronic devices.
As shown in fig. 3, the apparatus for testing an interface abnormal call according to this embodiment includes:
a data reading module 301; the method is used for reading historical operation data about a target service, and a complete interface calling flow executed is recorded in the historical operation data.
A data parsing module 302; and the historical operation data is analyzed, and interface calling information and user operation behavior information captured in the interface calling process are extracted from the historical operation data.
An information import module 303; and the method is used for importing the interface calling information and the user operation behavior information into a Jmeter integrated into Jenkins.
An interface generation module 304; and generating an interactive interface for configuring the interface to call the test flow through Jenkins.
A use case generation module 305; and the target test case is used for receiving the test configuration information fed back by the target test user according to the interactive interface and generating a target test case which accords with the interface calling test flow based on the test configuration information.
The interface test module 306 is configured to execute the target test case to perform an interface exception invoking test.
In some embodiments of the present application, the data reading module 301 is configured to read a json structure file storing historical operation data about a target service; the data analysis module 302 is configured to analyze the json structure file to obtain the historical operation data; and identifying the historical operation data according to a preset interface identifier and a preset behavior identifier, and extracting interface calling information and user operation behavior information from the historical operation data.
In some embodiments of the present application, the data parsing module 302 further comprises: and dimension division sub-modules. The dimension division submodule is used for analyzing the user operation behavior information and dividing the user operation behavior information into user dimension information used for representing single user operation behavior and interaction dimension information used for representing integral user retention degree.
In some embodiments of the present application, the interface exception call testing module further comprises: and a log monitoring module. The log monitoring module is used for setting log monitoring for a target service process; acquiring keywords which correspond to each interface in a monitoring log of the complete interface calling process and indicate that a processing result is normal; and generating an interface keyword set according to the keywords.
In a further specific embodiment, the interface test module 306 includes: and a test result judgment submodule. The test result judgment submodule is used for reading an interface keyword set and acquiring a target keyword corresponding to an interface related to the target test case in the interface keyword set; acquiring a monitoring log for executing the target test case, executing log retrieval in the monitoring log according to the target keyword, and generating a log test report according to a retrieval result; and judging whether the interface calling test flow corresponding to the target test case is normally processed and finished or not based on the log test report.
In some embodiments of the present application, the interface exception call testing module further comprises: and a data query module. The data query module is used for generating a data query instruction based on the interface calling flow when the target test case is executed to carry out interface abnormal calling test; executing the data query instruction, and querying the current data state of the service data related to the interface calling process in the database; and generating a data updating result according to the current data state of the service data and sending the data updating result to the target test user so as to judge whether the current data state is abnormal or not by the target test user.
In some embodiments of the present application, the interface exception call testing module further comprises: and a data comparison module. The data comparison module is used for determining expected result data of the target test case and acquiring actual output data of the target test case; and comparing the actual output data with the expected result data, and generating a test report according to the result of data comparison.
The test device is called to the anomaly of interface, only need the full flow of tester manual operation business once, just can utilize the automatic test platform of configuration to conveniently realize the test of calling to the interface anomaly to be applicable to the test to multiple business scene, the reusability is high, has greatly promoted efficiency of software testing when having reduced manual operation, moreover based on carry out the operation habit that the test case that data analysis generated can paste real user better to user's operation behavior.
In order to solve the technical problem, an embodiment of the present application further provides a computer device. Referring to fig. 4, fig. 4 is a block diagram of a basic structure of a computer device according to the present embodiment.
The computer device 6 comprises a memory 61, a processor 62, a network interface 63 communicatively connected to each other via a system bus. It is noted that only a computer device 6 having components 61-63 is shown, but it is understood that not all of the shown components are required to be implemented, and that more or fewer components may be implemented instead. As will be understood by those skilled in the art, the computer device is a device capable of automatically performing numerical calculation and/or information processing according to a preset or stored instruction, and the hardware includes, but is not limited to, a microprocessor, an Application Specific Integrated Circuit (ASIC), a Programmable Gate Array (FPGA), a Digital Signal Processor (DSP), an embedded device, and the like.
The computer device can be a desktop computer, a notebook, a palm computer, a cloud server and other computing devices. The computer equipment can carry out man-machine interaction with a user through a keyboard, a mouse, a remote controller, a touch panel or voice control equipment and the like.
The memory 61 includes at least one type of readable storage medium including a flash memory, a hard disk, a multimedia card, a card type memory (e.g., SD or DX memory, etc.), a Random Access Memory (RAM), a Static Random Access Memory (SRAM), a Read Only Memory (ROM), an Electrically Erasable Programmable Read Only Memory (EEPROM), a Programmable Read Only Memory (PROM), a magnetic memory, a magnetic disk, an optical disk, etc. In some embodiments, the memory 61 may be an internal storage unit of the computer device 6, such as a hard disk or a memory of the computer device 6. In other embodiments, the memory 61 may also be an external storage device of the computer device 6, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a flash Card (FlashCard), and the like, which are provided on the computer device 6. Of course, the memory 61 may also comprise both an internal storage unit of the computer device 6 and an external storage device thereof. In this embodiment, the memory 61 is generally used for storing an operating system installed in the computer device 6 and various application software, such as program codes of an interface exception call test method. Further, the memory 61 may also be used to temporarily store various types of data that have been output or are to be output.
The processor 62 may be a Central Processing Unit (CPU), controller, microcontroller, microprocessor, or other data Processing chip in some embodiments. The processor 62 is typically used to control the overall operation of the computer device 6. In this embodiment, the processor 62 is configured to execute the program code stored in the memory 61 or process data, for example, execute the program code of the interface exception call test method.
The network interface 63 may comprise a wireless network interface or a wired network interface, and the network interface 63 is typically used for establishing a communication connection between the computer device 6 and other electronic devices.
The embodiment of the application discloses a computer device, when carrying out the functional test of data propelling movement through the computer program that treater execution memory was saved, need not to establish the task through the front end operation, can realize the unusual test requirement of transferring of big batch interface, and reduce the consumption of test time, promote the efficiency of functional test, can also conveniently carry out the pressure test at the in-process that carries out the data propelling movement test, the problem that appears when can also conveniently analyzing the test when judging the propelling movement result of data through the log, and fix a position the problem that appears in the testing process.
The present application further provides another embodiment, which is to provide a computer-readable storage medium storing an interface abnormal call test program, where the interface abnormal call test program is executable by at least one processor to cause the at least one processor to execute the steps of the interface abnormal call test method as described above.
The calculation and storage medium provided by the embodiment of the application can realize abnormal calling test requirements on large-batch interfaces without establishing a task through front-end operation when executing a function test of data pushing of a stored computer program, reduce the consumption of test time, improve the efficiency of the function test, conveniently perform pressure test in the process of performing the data pushing test, conveniently analyze the problems appearing in the test when judging the pushing result of data through logs, and position the problems appearing in the test process.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solutions of the present application may be embodied in the form of a software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal device (such as a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present application.
In the above embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the modules is merely a logical division, and other divisions may be realized in practice, for example, a plurality of modules or components may be combined or integrated into another system, or some features may be omitted, or not executed.
The modules or components may or may not be physically separate, and the components shown as modules or components may or may not be physical modules, may be located in one place, or may be distributed over a plurality of network elements. Some or all of the modules or components can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
The present application is not limited to the above-mentioned embodiments, the above-mentioned embodiments are preferred embodiments of the present application, and the present application is only used for illustrating the present application and not for limiting the scope of the present application, it should be noted that, for a person skilled in the art, it is still possible to make several improvements and modifications to the technical solutions described in the foregoing embodiments or to make equivalent substitutions for some technical features without departing from the principle of the present application. All equivalent structures made by using the contents of the specification and the drawings of the present application can be directly or indirectly applied to other related technical fields, and the same should be considered to be included in the protection scope of the present application.
It is to be understood that the above-described embodiments are merely illustrative of some, but not restrictive, of the broad invention, and that the appended drawings illustrate preferred embodiments of the invention and do not limit the scope of the invention. This application is capable of embodiments in many different forms and is provided for the purpose of enabling a thorough understanding of the disclosure of the application. Although the present application has been described in detail with reference to the foregoing embodiments, it will be apparent to one skilled in the art that the present application may be practiced without modification or with equivalents of some of the features described in the foregoing embodiments. All other embodiments that can be obtained by a person skilled in the art based on the embodiments in this application without any creative effort and all equivalent structures made by using the contents of the specification and the drawings of this application can be directly or indirectly applied to other related technical fields and are within the scope of protection of the present application.
Claims (10)
1. An abnormal call test method for an interface is characterized by comprising the following steps:
reading historical operation data related to a target service, wherein an executed complete interface calling process is recorded in the historical operation data;
analyzing the historical operation data, and extracting interface calling information and user operation behavior information captured in the interface calling process;
importing the interface calling information and the user operation behavior information into a Jmeter integrated into Jenkins;
generating an interactive interface for configuring an interface to call a test flow through Jenkins;
receiving test configuration information fed back by a target test user according to the interactive interface, and generating a target test case which accords with the interface calling test flow based on the test configuration information;
and executing the target test case to perform interface exception calling test.
2. The method for testing an interface according to claim 1, wherein the step of reading the historical operation data on the target service comprises: reading a json structure file storing historical operation data about a target service;
the step of analyzing the historical operation data and extracting interface calling information and user operation behavior information captured in the interface calling process comprises the following steps:
analyzing the json structure file to obtain the historical operation data;
and identifying the historical operation data according to a preset interface identifier and a preset behavior identifier, and extracting interface calling information and user operation behavior information from the historical operation data.
3. The interface exception call testing method of claim 1, further comprising: and analyzing the user operation behavior information, and dividing the user operation behavior information into user dimension information used for representing single user operation behavior and interaction dimension information used for representing integral user retention degree.
4. The method according to claim 1, wherein before the step of executing the target test case for interface exception call testing, the method further comprises:
setting log monitoring for a target business process;
acquiring keywords which correspond to each interface in a monitoring log of the complete interface calling process and indicate that a processing result is normal;
and generating an interface keyword set according to the keywords.
5. The method according to claim 4, wherein the step of executing the target test case to perform the interface abnormal call test further comprises:
reading an interface keyword set, and acquiring a target keyword corresponding to an interface related to the target test case in the interface keyword set;
acquiring a monitoring log for executing the target test case, executing log retrieval in the monitoring log according to the target keyword, and generating a log test report according to a retrieval result;
and judging whether the interface calling test flow corresponding to the target test case is normally processed and finished or not based on the log test report.
6. The interface exception call testing method of claim 1, further comprising:
when the target test case is executed to carry out interface abnormal calling test, a data query instruction is generated based on the interface calling flow;
executing the data query instruction, and querying the current data state of the service data related to the interface calling process in the database;
and generating a data updating result according to the current data state of the service data and sending the data updating result to the target test user so as to judge whether the current data state is abnormal or not by the target test user.
7. The method according to claim 1, wherein after the step of executing the target test case to perform the interface abnormal call test, the method further comprises:
determining expected result data of the target test case, and acquiring actual output data of the target test case;
and comparing the actual output data with the expected result data, and generating a test report according to the result of data comparison.
8. An interface exception call testing apparatus, comprising:
the data reading module is used for reading historical operation data related to the target service, and an executed complete interface calling process is recorded in the historical operation data;
the data analysis module is used for analyzing the historical operation data and extracting interface calling information and user operation behavior information captured in the interface calling process;
the information import module is used for importing the interface calling information and the user operation behavior information into a meter integrated into Jenkins;
the interface generation module is used for generating an interactive interface for configuring an interface to call a test flow through Jenkins;
the case generating module is used for receiving test configuration information fed back by a target test user according to the interactive interface and generating a target test case which accords with the interface calling test flow based on the test configuration information;
and the interface test module is used for executing the target test case to perform interface exception calling test.
9. A computer device comprising a memory and a processor, wherein the memory has stored therein a computer program which when executed by the processor implements the steps of an interface exception call test method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that a computer program is stored on the computer-readable storage medium, which computer program, when being executed by a processor, carries out the steps of an interface of any one of claims 1-7 for an abnormal call test method.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010235133.2A CN111552633A (en) | 2020-03-27 | 2020-03-27 | Interface abnormal call testing method and device, computer equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010235133.2A CN111552633A (en) | 2020-03-27 | 2020-03-27 | Interface abnormal call testing method and device, computer equipment and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN111552633A true CN111552633A (en) | 2020-08-18 |
Family
ID=72002416
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010235133.2A Pending CN111552633A (en) | 2020-03-27 | 2020-03-27 | Interface abnormal call testing method and device, computer equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111552633A (en) |
Cited By (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112035303A (en) * | 2020-09-01 | 2020-12-04 | 腾讯科技(深圳)有限公司 | Data testing method and device, computer and readable storage medium |
CN112269744A (en) * | 2020-10-30 | 2021-01-26 | 深圳壹账通智能科技有限公司 | System abnormity testing method and device, computer equipment and storage medium |
CN112328498A (en) * | 2020-11-27 | 2021-02-05 | 京东数字科技控股股份有限公司 | Service testing method and device, storage medium and electronic device |
CN112685275A (en) * | 2020-12-30 | 2021-04-20 | 北京迈格威科技有限公司 | Algorithm strategy searching method and device, electronic equipment and storage medium |
CN112817857A (en) * | 2021-02-05 | 2021-05-18 | 深圳市世强元件网络有限公司 | Method for automatically monitoring website abnormity based on JMeter and Jenkins and computer equipment |
CN113204395A (en) * | 2021-05-21 | 2021-08-03 | 珠海金山网络游戏科技有限公司 | Service processing method and device |
CN113709448A (en) * | 2021-08-05 | 2021-11-26 | 贵阳朗玛视讯科技有限公司 | IPTV system-based testing device and method |
CN113742250A (en) * | 2021-11-05 | 2021-12-03 | 广州易方信息科技股份有限公司 | Automatic interface testing method and device |
CN114003451A (en) * | 2021-10-27 | 2022-02-01 | 苏州浪潮智能科技有限公司 | Interface test method, device, system and medium |
CN114443343A (en) * | 2022-02-10 | 2022-05-06 | 小马国炬(玉溪)科技有限公司 | Method, device, equipment and storage medium for service interface to feed back abnormal information |
-
2020
- 2020-03-27 CN CN202010235133.2A patent/CN111552633A/en active Pending
Cited By (12)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112035303A (en) * | 2020-09-01 | 2020-12-04 | 腾讯科技(深圳)有限公司 | Data testing method and device, computer and readable storage medium |
CN112035303B (en) * | 2020-09-01 | 2021-08-24 | 腾讯科技(深圳)有限公司 | Data testing method and device, computer and readable storage medium |
CN112269744A (en) * | 2020-10-30 | 2021-01-26 | 深圳壹账通智能科技有限公司 | System abnormity testing method and device, computer equipment and storage medium |
CN112328498A (en) * | 2020-11-27 | 2021-02-05 | 京东数字科技控股股份有限公司 | Service testing method and device, storage medium and electronic device |
CN112685275A (en) * | 2020-12-30 | 2021-04-20 | 北京迈格威科技有限公司 | Algorithm strategy searching method and device, electronic equipment and storage medium |
CN112817857A (en) * | 2021-02-05 | 2021-05-18 | 深圳市世强元件网络有限公司 | Method for automatically monitoring website abnormity based on JMeter and Jenkins and computer equipment |
CN113204395A (en) * | 2021-05-21 | 2021-08-03 | 珠海金山网络游戏科技有限公司 | Service processing method and device |
CN113709448A (en) * | 2021-08-05 | 2021-11-26 | 贵阳朗玛视讯科技有限公司 | IPTV system-based testing device and method |
CN114003451A (en) * | 2021-10-27 | 2022-02-01 | 苏州浪潮智能科技有限公司 | Interface test method, device, system and medium |
CN114003451B (en) * | 2021-10-27 | 2023-08-25 | 苏州浪潮智能科技有限公司 | Interface testing method, device, system and medium |
CN113742250A (en) * | 2021-11-05 | 2021-12-03 | 广州易方信息科技股份有限公司 | Automatic interface testing method and device |
CN114443343A (en) * | 2022-02-10 | 2022-05-06 | 小马国炬(玉溪)科技有限公司 | Method, device, equipment and storage medium for service interface to feed back abnormal information |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN111552633A (en) | Interface abnormal call testing method and device, computer equipment and storage medium | |
CN106844217B (en) | Method and device for embedding point of applied control and readable storage medium | |
CN107436844B (en) | Method and device for generating interface use case aggregate | |
WO2018120721A1 (en) | Method and system for testing user interface, electronic device, and computer readable storage medium | |
CN112597020A (en) | Interface testing method and device, computer equipment and storage medium | |
CN110798445B (en) | Public gateway interface testing method and device, computer equipment and storage medium | |
CN110798440B (en) | Abnormal user detection method, device and system and computer storage medium | |
CN112394908A (en) | Method and device for automatically generating embedded point page, computer equipment and storage medium | |
CN110825618A (en) | Method and related device for generating test case | |
CN109194689B (en) | Abnormal behavior recognition method, device, server and storage medium | |
CN112181835B (en) | Automatic test method, device, computer equipment and storage medium | |
WO2021129335A1 (en) | Operation monitoring method and apparatus, operation analysis method and apparatus | |
CN111666298A (en) | Method and device for detecting user service class based on flink, and computer equipment | |
CN106713011B (en) | Method and system for obtaining test data | |
CN112631924A (en) | Automatic testing method and device, computer equipment and storage medium | |
CN113792341A (en) | Privacy compliance automation detection method, device, equipment and medium for application program | |
CN112286815A (en) | Interface test script generation method and related equipment thereof | |
CN109800099A (en) | A kind of restoring method, storage medium and the terminal device of user's operation behavior | |
CN111475388A (en) | Data push test method and device, computer equipment and storage medium | |
CN110727576B (en) | Web page testing method, device, equipment and storage medium | |
CN112307386A (en) | Information monitoring method, system, electronic device and computer readable storage medium | |
CN112433935A (en) | Test method, test device, electronic equipment and storage medium | |
CN115794545A (en) | Automatic processing method of operation and maintenance data and related equipment thereof | |
CN115291762A (en) | Service item triggering method and device, storage medium and computer equipment | |
CN111786991A (en) | Block chain-based platform authentication login method and related device |
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 |