CN113419968B - Application testing method and device, electronic equipment and storage medium - Google Patents

Application testing method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN113419968B
CN113419968B CN202110961538.9A CN202110961538A CN113419968B CN 113419968 B CN113419968 B CN 113419968B CN 202110961538 A CN202110961538 A CN 202110961538A CN 113419968 B CN113419968 B CN 113419968B
Authority
CN
China
Prior art keywords
tampering
target
test
data
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.)
Active
Application number
CN202110961538.9A
Other languages
Chinese (zh)
Other versions
CN113419968A (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 Dajia Internet Information Technology Co Ltd
Original Assignee
Beijing Dajia Internet Information 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 Dajia Internet Information Technology Co Ltd filed Critical Beijing Dajia Internet Information Technology Co Ltd
Priority to CN202110961538.9A priority Critical patent/CN113419968B/en
Publication of CN113419968A publication Critical patent/CN113419968A/en
Application granted granted Critical
Publication of CN113419968B publication Critical patent/CN113419968B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

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

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 method comprises the steps of intercepting target response data of an application to be tested corresponding to a current test request, wherein the current test request is any one test request in a target number of test requests to a target test interface corresponding to the application to be tested, the target number is equal to the target tampering frequency, and the target tampering frequency is determined based on the field number in the target response data and the type number corresponding to multiple abnormal test types; determining current field data which is not tampered based on preset tampering information corresponding to multiple abnormal test types in the target response data; tampering the current field data based on target tampering information which is not used for tampering the current field data to obtain tampering response data; and sending the tampering response data to the application to be tested, and acquiring a test result. By utilizing the embodiment of the disclosure, the operation complexity of the test can be reduced, and the test comprehensiveness and efficiency are improved.

Description

Application testing method and device, electronic equipment and storage medium
Technical Field
The present disclosure relates to the field of internet technologies, and in particular, to an application testing method and apparatus, an electronic device, and a storage medium.
Background
With the development of internet technology, various network applications are increasing, and the testing requirements of application clients are becoming more and more important. In the related art, the information is often transmitted through proxy tools such as: and the Charles tool and the like are used for intercepting the sent and returned requests, analyzing and testing the returned request data of the server side, and verifying whether the client side crashes or displays abnormity when different request data are returned. However, in the related art, each test data needs to be manually changed, which is time-consuming and labor-consuming, and is easy to miss test, resulting in the problems of complicated test operation, low test efficiency and accuracy, and the like in the related art.
Disclosure of Invention
The present disclosure provides an application test method, an application test apparatus, an electronic device, and a storage medium, so as to at least solve the problems of complex test operation and low test efficiency and accuracy in the related art. The technical scheme of the disclosure is as follows:
according to a first aspect of the embodiments of the present disclosure, there is provided an application testing method, including:
intercepting target response data of a current test request corresponding to an application to be tested, wherein the current test request is any one-time test request in a target number of test requests performed on a target test interface corresponding to the application to be tested, the target number is equal to a target tampering frequency, and the target tampering frequency is determined based on the number of fields in the target response data and the number of types corresponding to multiple abnormal test types;
determining current field data in the target response data, wherein the current field data are field data which are not tampered based on any preset tampering information corresponding to the multiple abnormal test types in the target response data;
tampering the current field data in the target response data based on the target tampering information to obtain tampering response data; the target tampering information is any preset tampering information which is not used for tampering the current field data and is in preset tampering information corresponding to the multiple abnormal test types;
and sending the tampering response data to the application to be tested, and acquiring a test result generated by the application to be tested based on the tampering response data.
Optionally, in a case that the current test request is a test request sent for the first time in the target number of test requests, after intercepting target response data of the to-be-tested application corresponding to the current test request, the method further includes:
acquiring the number of fields in the target response data and the number of types corresponding to the multiple abnormal test types;
and generating the target tampering times according to the field number and the type number.
Optionally, the target response data includes a plurality of field data arranged according to a preset field test sequence, and the determining of the current field data in the target response data includes:
acquiring historical tampering times corresponding to the target response data from preset response test information, wherein the preset response test information records response identification information of the tampered response data and the corresponding historical tampering times;
dividing the historical tampering times by the type number to obtain a target merchant;
taking the target quotient as the number of historical test field data in the target response data, wherein the historical test field data is field data which is tampered based on preset tampering information corresponding to the multiple abnormal test types;
and determining the current field data from the target response data according to the number of the historical test field data and the preset field test sequence.
Optionally, the preset tampering information corresponding to the multiple abnormal test types is multiple preset tampering information arranged according to a preset test type sequence; the method further comprises the following steps:
acquiring historical tampering times corresponding to the target response data from preset response test information, wherein the preset response test information records response identification information of the tampered response data and the corresponding historical tampering times;
performing modular operation processing on the historical tampering times and the type number to obtain the testing times corresponding to the current field data;
and determining the target tampering information from the preset tampering information which is arranged according to a preset test type sequence based on the test times corresponding to the current field data.
Optionally, after intercepting target response data of the application to be tested corresponding to the current test request, the method further includes:
inquiring target response identification information corresponding to the target response data in preset response test information, wherein the preset response test information records response identification information of tampered response data and corresponding historical tampering times;
acquiring historical tampering times corresponding to the target response identification information from the preset response test information under the condition that the target response identification information is inquired in the preset response test information;
and under the condition that the historical tampering times corresponding to the target response identification information are less than the target tampering times, executing the step of determining the current field data in the target response data.
Optionally, the method further includes:
adding the target response identification information and the initial tampering times corresponding to the target response identification information in the preset response test information under the condition that the target response identification information is not inquired in the preset response test information;
wherein the number of initial tampering is zero.
Optionally, after the current field data in the target response data is tampered based on the target tampering information to obtain tampering response data, the method further includes:
and updating the historical tampering times corresponding to the target response identification information in the preset response test information.
Optionally, the method further includes:
monitoring log data corresponding to the application to be tested;
and generating an abnormal analysis result based on the log data under the condition that the test result indicates that the application to be tested runs abnormally.
According to a second aspect of the embodiments of the present disclosure, there is provided an application testing apparatus including:
the target response data interception module is configured to execute target response data intercepting of a current test request corresponding to an application to be tested, wherein the current test request is any one test request in a target number of test requests performed on a target test interface corresponding to the application to be tested, the target number is equal to a target tampering frequency, and the target tampering frequency is determined based on the number of fields in the target response data and the number of types corresponding to multiple abnormal test types;
a current field data determining module configured to perform determining current field data in the target response data, where the current field data is field data that has not been tampered with based on any preset tampering information corresponding to the plurality of anomaly test types in the target response data;
the tampering module is configured to tamper the current field data in the target response data based on target tampering information to obtain tampering response data; the target tampering information is any preset tampering information which is not used for tampering the current field data and is in preset tampering information corresponding to the multiple abnormal test types;
and the test result acquisition module is configured to send the tampering response data to the application to be tested and acquire a test result generated by the application to be tested based on the tampering response data.
Optionally, in a case that the current test request is a test request sent for the first time in the target number of test requests, the apparatus further includes:
the data acquisition module is configured to execute the steps of acquiring the field quantity in the target response data and the type quantity corresponding to the multiple abnormal test types after intercepting the target response data of the application to be tested corresponding to the current test request;
and the target tampering times generation module is configured to generate the target tampering times according to the field number and the type number.
Optionally, the target response data includes a plurality of field data arranged according to a preset field test sequence, and the current field data determining module includes:
a history tampering frequency obtaining unit configured to obtain history tampering frequency corresponding to the target response data from preset response test information, wherein the preset response test information records response identification information of tampered response data and corresponding history tampering frequency;
the calculation processing unit is configured to divide the historical tampering times by the type number to obtain a target quotient;
a quantity determination unit configured to execute a process of taking the target quotient as a quantity of historical test field data in the target response data, the historical test field data being field data that has been tampered based on preset tampering information corresponding to the plurality of abnormal test types;
a current field data determining unit configured to perform determining the current field data from the target response data according to the number of the historical test field data and the preset field test order.
Optionally, the preset tampering information corresponding to the multiple abnormal test types is multiple preset tampering information arranged according to a preset test type sequence; the device further comprises:
a second data obtaining unit configured to perform obtaining of a history tampering number corresponding to the target response data from preset response test information in which response identification information of the tampered response data and a corresponding history tampering number are recorded;
the modulus operation processing unit is configured to execute modulus operation processing on the historical tampering times and the type number to obtain testing times corresponding to the current field data;
a target tampering information determining unit configured to perform determining the target tampering information from the plurality of preset tampering information arranged in a preset test type order based on the number of tests corresponding to the current field data.
Optionally, the apparatus further comprises:
the target response identification information query module is configured to execute querying of target response identification information corresponding to the target response data in preset response test information after intercepting the target response data corresponding to the current test request of the application to be tested, wherein the preset response test information records response identification information of tampered response data and corresponding historical tampering times;
a history tampering frequency obtaining module configured to obtain a history tampering frequency corresponding to the target response identification information from the preset response test information, in a case where the target response identification information is queried in the preset response test information;
the current field data determination module is further configured to execute the step of determining the current field data in the target response data if the historical tampering number corresponding to the target response identification information is less than the target tampering number.
Optionally, the apparatus further comprises:
a test information adding module configured to add the target response identification information and the initial tampering times corresponding to the target response identification information in the preset response test information under the condition that the target response identification information is not queried in the preset response test information;
wherein the number of initial tampering is zero.
Optionally, the apparatus further comprises:
and the historical tampering frequency updating module is configured to update the historical tampering frequency corresponding to the target response identification information in the preset response test information after the current field data in the target response data is tampered based on the target tampering information to obtain tampering response data.
Optionally, the apparatus further comprises:
the log data detection module is configured to monitor log data corresponding to the application to be tested;
and the abnormal analysis result generation module is configured to execute generation of an abnormal analysis result based on the log data under the condition that the test result indicates that the application to be tested runs abnormally.
According to a third aspect of the embodiments of the present disclosure, there is provided an electronic apparatus including: a processor; a memory for storing the processor-executable instructions; wherein the processor is configured to execute the instructions to implement the method of any of the first aspects above.
According to a fourth aspect of embodiments of the present disclosure, there is provided a computer-readable storage medium, wherein instructions, when executed by a processor of an electronic device, enable the electronic device to perform the method of any one of the first aspects of the embodiments of the present disclosure.
According to a fifth aspect of the embodiments of the present disclosure, there is provided a computer program product containing instructions which, when run on a computer, cause the computer to perform the method of any one of the first aspects of the embodiments of the present disclosure.
The technical scheme provided by the embodiment of the disclosure at least brings the following beneficial effects:
the total testing times determined by combining the field number in the target response data and the type number corresponding to the multiple abnormal testing types can effectively avoid missing testing, the comprehensiveness of the testing is improved, and the current field data which is not tampered based on the preset tampering corresponding to the multiple abnormal testing types is automatically tampered with the corresponding target tampering information in the testing process, so that the testing operation complexity can be greatly reduced, and the testing efficiency and accuracy are improved.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the disclosure and are not to be construed as limiting the disclosure.
FIG. 1 is a schematic diagram illustrating an application environment in accordance with an illustrative embodiment;
FIG. 2 is a flow diagram illustrating a method of application testing in accordance with an exemplary embodiment;
FIG. 3 is a flow diagram illustrating another application testing method in accordance with an exemplary embodiment;
FIG. 4 is a flow diagram illustrating a determination of current field data in target response data in accordance with an exemplary embodiment;
FIG. 5 is a flow diagram illustrating a method of determining targeted tampering information, according to an example embodiment;
FIG. 6 is a block diagram illustrating an application testing apparatus according to an exemplary embodiment;
FIG. 7 is a block diagram illustrating an electronic device for application testing in accordance with an exemplary embodiment.
Detailed Description
In order to make the technical solutions of the present disclosure better understood by those of ordinary skill in the art, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings.
It should be noted that the terms "first," "second," and the like in the description and claims of the present disclosure and in the above-described drawings are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the disclosure described herein are capable of operation in sequences other than those illustrated or otherwise described herein. The implementations described in the exemplary embodiments below are not intended to represent all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present disclosure, as detailed in the appended claims.
It should be noted that, the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for presentation, analyzed data, etc.) referred to in the present disclosure are information and data authorized by the user or sufficiently authorized by each party.
Referring to fig. 1, fig. 1 is a schematic diagram illustrating an application environment according to an exemplary embodiment, which may include a client 100, a test terminal 200, and a server 300, as shown in fig. 6.
In an alternative embodiment, the client 100 may run an application to be tested. The testing terminal 200 may be used to test an application to be tested. The server 300 may be a background server corresponding to the application to be tested.
In an alternative embodiment, the client 100 and the testing end 200 may include, but are not limited to, smart phones, desktop computers, tablet computers, notebook computers, smart speakers, digital assistants, Augmented Reality (AR)/Virtual Reality (VR) devices, smart wearable devices, and other types of electronic devices. Optionally, the operating system running on the electronic device may include, but is not limited to, an android system, an IOS system, linux, windows, and the like.
In an optional embodiment, the server 300 may be an independent physical server, may also be a server cluster or a distributed system formed by a plurality of physical servers, and may also be a cloud server providing basic cloud computing services such as a cloud service, a cloud database, cloud computing, a cloud function, cloud storage, a Network service, cloud communication, a middleware service, a domain name service, a security service, a CDN (Content Delivery Network), a big data and artificial intelligence platform, and the like.
In this embodiment, the client 100, the testing terminal 200, and the server 300 may be directly or indirectly connected through wired or wireless communication, and the disclosure is not limited herein.
Fig. 2 is a flowchart illustrating an application testing method for a test terminal, as shown in fig. 2, according to an exemplary embodiment, including the following steps.
In step S201, target response data of the application to be tested corresponding to the current test request is intercepted.
In an alternative embodiment, the connection between the testing end and the client running the application to be tested may be established in advance. In a specific embodiment, the IP of the client may be set as the IP of the test end, and the port of the client is set as 8080, so that the test end can intercept the response data received by the client. In an alternative embodiment, the application to be tested of the client may be triggered to send a corresponding test request to the server through the test interface. Specifically, the test interface may be a data transmission interface corresponding to an operation function to be tested in the application to be tested.
In a specific embodiment, a corresponding test script can be set in advance by combining with actual test requirements, and when a test is required, the corresponding test request is triggered to be sent based on the test script, so that the test request is automatically sent, and the convenience and the efficiency of the test are improved.
In this embodiment of the present specification, for any test interface of an application to be tested, a target number of test requests may be repeatedly triggered, and optionally, the target number of test requests may be sequentially sent to the server. Specifically, the current test request may be any one of the target number of test requests to the target test interface corresponding to the application to be tested, and specifically, the target test interface may be any one of the test interfaces corresponding to the application to be tested.
In an optional embodiment, the test end may intercept all response data sent to the client; in a specific embodiment, a preset interception method may be called to perform an interception operation of the response data. Optionally, the domain name recognition may be performed on the response data sent to the client to identify target response data fed back by the server corresponding to the application to be tested. Optionally, in a case that the domain name information identified in the response data is the domain name information corresponding to the server, the response data may be used as the target response data. Specifically, the target response data is data returned to the application to be tested after the server corresponding to the application to be tested processes the current test request.
In an optional embodiment, in a case where it is determined that the intercepted response data is response data returned by a server corresponding to the application to be tested, data format identification may be further performed on the intercepted response data, and accordingly, in a case where the data format of the response data is a target data format, the response data may be used as the target response data. Specifically, the target data format may be a preset data format that needs to be tested. Specifically, the target data format may be set in combination with actual test requirements, and in a specific embodiment, the target data format may include, but is not limited to, json format.
In a specific embodiment, the number of the targets is equal to the number of target tampering times, and the number of target tampering times may be determined based on the number of fields in the target response data and the number of types corresponding to the multiple types of exception tests. Optionally, the target tampering frequency may be determined after intercepting target response data of a test request sent for the first time in test requests corresponding to the target test interface, and correspondingly, in a case that the current test request is a test request sent for the first time in a target number of test requests, after intercepting target response data of a to-be-tested application corresponding to the current test request, the method may further include:
acquiring the field quantity in the target response data and the type quantity corresponding to various abnormal test types;
and generating the target tampering times according to the field number and the type number.
In a specific embodiment, the response data often has a plurality of fields, each field in the target response data can be tampered, and the abnormal condition caused by each field can be mastered, so that the test comprehensiveness can be improved, and the stability of subsequent application can be ensured. Correspondingly, the same test request of the same test interface can be triggered for multiple times, and then certain field data in corresponding target response data can be tampered every time.
In this embodiment, the division of the single field data may be determined in combination with the data format of the target response data, and the field data is divided by the minimum data unit corresponding to the data format. In a specific embodiment, for example, the json-formatted target response data is taken as an example, the minimum data unit is a key-value pair, and accordingly, one key-value pair may correspond to one field data.
In a particular embodiment, the number of target tampers may be the total number of tests performed on the target test interface. Specifically, the multiple abnormal test types may correspond to multiple abnormal situations occurring in the field data; optionally, in order to ensure that each field data in the target response data is tested in combination with multiple exception test types, a product of the number of fields (number of fields) of the field data in the target response data and the number of types corresponding to the multiple exception test types may be used as the target tampering number.
In the above embodiment, the total number of tests is generated by combining the number of the fields and the number of the types corresponding to the multiple types of abnormal tests, so that the comprehensiveness of the tests can be effectively improved, and the stability of subsequent applications is further improved.
In step S203, the current field data in the target response data is determined.
In a specific embodiment, the current field data is any field data that has not been tampered with based on preset tampering information corresponding to multiple anomaly test types in the target response data. Specifically, when a certain field data is not tampered based on all preset tampering information in the preset tampering information corresponding to the multiple abnormal test types, the field data can be used as the current field data.
In a specific embodiment, the preset tampering information corresponding to the multiple abnormal test types may be configuration contents of the field data under the abnormal condition corresponding to the multiple abnormal test types, in a specific embodiment, it is assumed that a certain target test interface corresponds to 10 abnormal test types, and the configuration contents of the field data under the abnormal condition corresponding to the 10 abnormal test types include: key is null, value is null character string, value is null array, value is null dictionary, value is long floating point type decimal, value is true, value is false, value is null array, value is long int type. Correspondingly, key-empty, value-empty string, value-empty array, value-empty dictionary, value-long floating-point decimal, value-true, value-false, value-empty tuple, and value-long int may be used as the preset tampering information corresponding to the above multiple exception test types.
In an optional embodiment, after intercepting the target response data of the application to be tested corresponding to the current test request, as shown in fig. 3, the method may further include the following steps:
in step S209, target response identification information corresponding to the target response data is queried in the preset response test information;
in step S211, when the target response identification information is queried in the preset response test information, obtaining a history tampering number corresponding to the target response identification information from the preset response test information;
accordingly, in step S203, when the history tampering number corresponding to the target response identification information is smaller than the target tampering number, the step of determining the current field data in the target response data is performed.
In a specific embodiment, the preset response test information records response identification information of the tampered response data and corresponding historical tampering times. Specifically, the response identification information of the response data may be identification information for identifying response data corresponding to different test interfaces, and optionally, the response identification information may be a Uniform Resource Locator (URL) corresponding to the response data. In an optional embodiment, the response identification information of the response data and the corresponding historical tampering times may be recorded in the form of key value pairs, specifically, the response identification information may be a key, and the historical tampering times may be a value.
In a specific embodiment, when the historical tampering frequency corresponding to the target response identification information is less than the target tampering frequency, it may be determined that all abnormal conditions corresponding to the target test interface have not been tested, and accordingly, the step of determining the current field data in the target response data may be performed, so that the target test interface may be continuously tested. On the contrary, when the historical tampering times corresponding to the target response identification information are larger than or equal to the target tampering times, the target response data can be directly returned to the application to be tested.
In the embodiment, whether the target response data needs to be tampered continuously or not can be accurately identified by combining the preset response test information and the target tampering frequency, and the test accuracy is improved on the basis of ensuring the test comprehensiveness.
In an optional embodiment, the method may further include:
and under the condition that the target response identification information is not inquired in the preset response test information, adding the target response identification information and the initial tampering times corresponding to the target response identification information in the preset response test information.
In a specific embodiment, when the target response identification information is not queried in the preset response test information, it may be determined that the target test interface corresponding to the target response data has not been tested, and correspondingly, the target response identification information and the corresponding initial tampering number may be added to the preset response test information, where specifically, the initial tampering number may be zero.
In the above embodiment, the response identification information of the tampered response data and the corresponding historical tampering times are recorded in combination with the preset response test information, so that the test progress can be accurately mastered, and the test accuracy is further improved.
In an optional embodiment, any preset tampering information which is not based on multiple abnormal test types and corresponds to the target response data can be randomly selected from the target response data, and the tampered field data is used as the current field data. Correspondingly, the corresponding relation between the field data which is used for recording the tampering in the target response data and the preset tampering information which is used for tampering the field data can be maintained, and the field data which is tampered based on the preset tampering information which is not corresponding to the abnormal test types can be conveniently determined.
In another alternative embodiment, the target response data may include a plurality of field data arranged according to a preset field test sequence, and as shown in fig. 4, the determining the current field data in the target response data may include the following steps:
in step S2031, the history tampering frequency corresponding to the target response data is acquired from the preset response test information.
In step S2033, the number of times of history tampering is divided by the number of types to obtain the target quotient.
In step S2035, the target quotient is set as the number of history test field data in the target response data.
In step S2037, the current field data is determined from the target response data based on the number of the historical test field data and the preset field test order.
In a specific embodiment, the target response identification information of the target response data may be combined to obtain the historical tampering times corresponding to the target response data from the preset response test information.
In this embodiment of the present specification, the preset field test sequence may be a sequence in which field data in the target response data is tampered. In a specific embodiment, the preset field test order may be an arrangement order of fields in the target response data. Correspondingly, each field can be successively tampered with in combination with the arrangement of the field data in the target response data.
In a specific embodiment, the historical test field data may be field data that has been tampered with based on preset tampering information corresponding to multiple abnormal test types. In a specific embodiment, assuming that the historical tampering number is 46 and the number of types is 10, correspondingly, the target quotient may be 4, and correspondingly, it may be determined that the first 4 fields of data in the target response data have been tampered with in combination with preset tampering information corresponding to multiple anomaly test types. Accordingly, the 5 th field data in the target response data may be taken as the current field data.
In the above embodiment, in a scenario where field data in target response data are tested in sequence according to a preset field test sequence, historical tampering times and type numbers corresponding to the target response data can be combined, historical test field data tampered with by combining preset tampering information corresponding to multiple abnormal test types can be quickly and accurately determined, and then the field data which needs to be tampered at present can be accurately positioned, so that the test accuracy and the test efficiency are improved.
In step S205, based on the target tampering information, current field data in the target response data is tampered to obtain tampering response data.
In a specific embodiment, the target tampering information may be any preset tampering information that is not used for tampering the current field data, among preset tampering information corresponding to multiple abnormal test types. In a specific embodiment, it is assumed that the key is null, which is the target tampering information, and accordingly, the key of the current field data in the target response data may be set to null, so as to tamper the current field data, and further obtain the tampering response data. In a specific embodiment, a preset tampering method may be called to perform the tampering operation.
In an optional embodiment, any preset tampering information that is not used for tampering the current field data may be randomly selected from the preset tampering information corresponding to the multiple anomaly test types, and the selected preset tampering information is used as the target tampering information. Correspondingly, a corresponding relation between the field data which is used for recording the tampering in the target response data and the preset tampering information which is used for tampering the field data can be maintained, and further the target tampering information which is not used for tampering the current field data can be conveniently determined.
In an optional embodiment, the preset tampering information corresponding to the plurality of abnormal test types is a plurality of preset tampering information arranged according to a preset test type sequence; the above method may further comprise: specifically, as shown in fig. 5, the step of determining the target tampering information may include the following steps:
in step S501, a history tampering number corresponding to the target response data is obtained from the preset response test information;
in step S503, performing modulo operation on the historical tampering times and the type number to obtain the testing times corresponding to the current field data;
in step S505, target tampering information is determined from a plurality of preset tampering information arranged in a preset test type order based on the number of tests corresponding to the current field data.
In a specific embodiment, the preset test type sequence may be a tampering sequence of preset tampering information of a plurality of abnormal test types when any field data is tampered.
In a specific embodiment, the modulo operation processing on the historical tampering times and the type number to obtain the test times corresponding to the current field data may include: and calculating a remainder obtained by dividing the historical tampering times by the type number, and taking the remainder as the testing times corresponding to the current field data.
In a specific embodiment, the value obtained by adding one to the test times corresponding to the current field data may be a sequence of the target tampering information in a plurality of preset tampering information arranged according to a preset test type sequence.
In the embodiment, the number of times that the current field data has been tested can be accurately determined by combining the historical tampering times and the type number corresponding to the target response data, and the target tampering information that needs to be used for tampering the current field data at present can be quickly and accurately located by combining the tampering sequence corresponding to the preset tampering information of a plurality of abnormal test types, so that the test accuracy and the test efficiency are improved.
In an optional embodiment, after tampering the current field data in the target response data based on the target tampering information to obtain the tampering response data, the method may further include:
and updating the historical tampering times corresponding to the target response identification information in the preset response test information.
In a specific embodiment, the historical tampering times corresponding to the target response identification information in the preset response test information may be increased by one, so as to update the historical tampering times corresponding to the target response data.
In the embodiment, after tampering, the accuracy of the test progress can be ensured by updating the historical tampering times in time, and the test accuracy is further improved.
In step S207, tamper response data is sent to the application to be tested, and a test result generated by the application to be tested based on the tamper response data is obtained.
In a specific embodiment, the test result may characterize an operating state of the application to be tested after receiving the tamper response data. Specifically, after the tamper response data is sent to the application to be tested, the running state of the application to be tested after the tamper response data is received can be monitored, and then the test result is obtained. In a specific embodiment, when the running state is abnormal, the corresponding test result may be that the application to be tested runs abnormally; otherwise, under the condition that the running state is not abnormal, the corresponding test result can be that the application to be tested runs normally.
In an optional embodiment, the method may further include:
monitoring log data corresponding to the application to be tested;
and under the condition that the test result indicates that the application to be tested runs abnormally, generating an abnormal analysis result based on the log data.
In a specific embodiment, the exception analysis result may be data that can characterize that the application to be tested has an exception in the log data, and accordingly, the application to be tested may be improved in combination with the exception analysis, so that after the subsequent application to be tested is formally online, even if response data corresponding to multiple exception test types is returned to the application to be tested, the situation that the application to be tested runs short does not occur.
In the embodiment, by detecting the log data corresponding to the application to be tested, the abnormal reason can be conveniently analyzed by combining the log data under the condition that the application to be tested is abnormal, and then the abnormal condition can be quickly positioned and repaired.
According to the technical scheme provided by the embodiment of the specification, the total testing times determined by combining the field number in the target response data and the type number corresponding to the multiple abnormal testing types in the specification can effectively avoid missing testing, the comprehensiveness of the testing is improved, and the current field data which is not tampered based on the preset tampering corresponding to the multiple abnormal testing types is automatically tampered with the corresponding target tampering information in the testing process, so that the testing operation complexity can be greatly reduced, and the testing efficiency and accuracy are improved.
FIG. 6 is a block diagram illustrating an application testing device according to an exemplary embodiment. Referring to fig. 6, the apparatus includes:
the target response data intercepting module 610 is configured to execute the process of intercepting target response data of a current test request corresponding to an application to be tested, wherein the current test request is any one test request in a target number of test requests performed on a target test interface corresponding to the application to be tested, the target number is equal to the target tampering frequency, and the target tampering frequency is determined based on the number of fields in the target response data and the number of types corresponding to multiple abnormal test types;
a current field data determining module 620 configured to determine current field data in the target response data, where the current field data is any field data that has not been tampered based on preset tampering information corresponding to the plurality of abnormal test types in the target response data;
the tampering module 630 is configured to tamper the current field data in the target response data based on the target tampering information, so as to obtain tampering response data; the target tampering information is any preset tampering information which is not used for tampering the current field data and is in the preset tampering information corresponding to the multiple abnormal test types;
and the test result obtaining module 640 is configured to execute sending the tamper response data to the application to be tested, and obtain a test result generated by the application to be tested based on the tamper response data.
Optionally, in a case that the current test request is a test request sent for the first time in the target number of test requests, the apparatus further includes:
the data acquisition module is configured to acquire the number of fields in the target response data and the number of types corresponding to multiple abnormal test types after intercepting the target response data of the application to be tested corresponding to the current test request;
and the target tampering times generation module is configured to generate the target tampering times according to the field number and the type number.
Optionally, the target response data includes a plurality of field data arranged according to a preset field test sequence, and the current field data determining module 620 includes:
a history tampering frequency obtaining unit configured to obtain history tampering frequencies corresponding to the target response data from preset response test information, wherein the preset response test information records response identification information of the tampered response data and the corresponding history tampering frequencies;
the calculation processing unit is configured to divide the historical tampering times by the type number to obtain a target quotient;
the quantity determining unit is configured to execute the step of taking the target quotient as the quantity of historical test field data in the target response data, wherein the historical test field data are field data which are tampered based on preset tampering information corresponding to multiple abnormal test types;
and a current field data determination unit configured to perform determination of current field data from the target response data according to the number of the historical test field data and a preset field test order.
Optionally, the preset tampering information corresponding to the multiple abnormal test types is multiple preset tampering information arranged according to a preset test type sequence; the above-mentioned device still includes:
the second data acquisition unit is configured to acquire the historical tampering times corresponding to the target response data from preset response test information, and the preset response test information records response identification information of the tampered response data and the corresponding historical tampering times;
the modular operation processing unit is configured to execute modular operation processing on the historical tampering times and the type number to obtain the testing times corresponding to the current field data;
and the target tampering information determining unit is configured to execute the test times corresponding to the current field data, and determine the target tampering information from a plurality of preset tampering information arranged according to a preset test type sequence.
Optionally, the apparatus further comprises:
the target response identification information query module is configured to execute target response identification information corresponding to target response data in preset response test information after intercepting the target response data corresponding to the current test request of the application to be tested, and the preset response test information records response identification information of tampered response data and corresponding historical tampering times;
the history tampering frequency obtaining module is configured to obtain history tampering frequency corresponding to the target response identification information from the preset response test information under the condition that the target response identification information is inquired in the preset response test information;
the current field data determining module 620 is further configured to perform the step of determining the current field data in the target response data if the history tampering number corresponding to the target response identification information is less than the target tampering number.
Optionally, the apparatus further comprises:
the test information adding module is configured to add the target response identification information and the initial tampering times corresponding to the target response identification information in the preset response test information under the condition that the target response identification information is not inquired in the preset response test information;
wherein the number of initial tampering is zero.
Optionally, the apparatus further comprises:
and the historical tampering frequency updating module is configured to update the historical tampering frequency corresponding to the target response identification information in the preset response test information after the current field data in the target response data is tampered based on the target tampering information to obtain tampering response data.
Optionally, the apparatus further comprises:
the log data detection module is configured to monitor log data corresponding to the application to be tested;
and the abnormity analysis result generation module is configured to execute generation of an abnormity analysis result based on the log data under the condition that the test result indicates that the application to be tested runs abnormally.
With regard to the apparatus in the above-described embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.
Fig. 7 is a block diagram illustrating an electronic device for application testing, which may be a terminal, according to an example embodiment, and an internal structure thereof may be as shown in fig. 7. The electronic device comprises a processor, a memory, a network interface, a display screen and an input device which are connected through a system bus. Wherein the processor of the electronic device is configured to provide computing and control capabilities. The memory of the electronic equipment comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The network interface of the electronic device is used for connecting and communicating with an external terminal through a network. The computer program is executed by a processor to implement an application testing method. The display screen of the electronic equipment can be a liquid crystal display screen or an electronic ink display screen, and the input device of the electronic equipment can be a touch layer covered on the display screen, a key, a track ball or a touch pad arranged on the shell of the electronic equipment, an external keyboard, a touch pad or a mouse and the like.
Those skilled in the art will appreciate that the architecture shown in fig. 7 is merely a block diagram of some of the structures associated with the disclosed aspects and does not constitute a limitation on the electronic devices to which the disclosed aspects apply, as a particular electronic device may include more or less components than those shown, or combine certain components, or have a different arrangement of components.
In an exemplary embodiment, there is also provided an electronic device including: a processor; a memory for storing the processor-executable instructions; wherein the processor is configured to execute the instructions to implement the application testing method as in the embodiments of the present disclosure.
In an exemplary embodiment, there is also provided a computer-readable storage medium, in which instructions, when executed by a processor of an electronic device, enable the electronic device to perform an application testing method in embodiments of the present disclosure.
In an exemplary embodiment, a computer program product containing instructions is also provided, which when run on a computer, causes the computer to perform the application testing method in the embodiments of the present disclosure.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in the embodiments provided herein may include non-volatile and/or volatile memory, among others. Non-volatile memory can include read-only memory (ROM), Programmable ROM (PROM), Electrically Programmable ROM (EPROM), Electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced SDRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), Rambus Direct RAM (RDRAM), direct bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This application is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It will be understood that the present disclosure is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims (16)

1. An application testing method, comprising:
intercepting target response data of a current test request corresponding to an application to be tested, wherein the current test request is any one-time test request in a target number of test requests performed on a target test interface corresponding to the application to be tested, the target number is equal to a target tampering frequency, and the target tampering frequency is determined based on the number of fields in the target response data and the number of types corresponding to multiple abnormal test types; the target response data comprises a plurality of field data arranged according to a preset field test sequence;
acquiring historical tampering times corresponding to the target response data from preset response test information, wherein the preset response test information records response identification information of the tampered response data and the corresponding historical tampering times; dividing the historical tampering times by the type number to obtain a target merchant; taking the target quotient as the number of historical test field data in the target response data, wherein the historical test field data is field data which is tampered based on preset tampering information corresponding to the multiple abnormal test types; determining current field data from the target response data according to the number of the historical test field data and the preset field test sequence, wherein the current field data are field data which are tampered in the target response data and are not based on any preset tampering information corresponding to the multiple abnormal test types;
tampering the current field data in the target response data based on the target tampering information to obtain tampering response data; the target tampering information is any preset tampering information which is not used for tampering the current field data and is in preset tampering information corresponding to the multiple abnormal test types;
and sending the tampering response data to the application to be tested, and acquiring a test result generated by the application to be tested based on the tampering response data.
2. The application testing method of claim 1, wherein in a case that the current test request is a test request sent for the first time among the target number of test requests, after intercepting target response data of an application to be tested corresponding to the current test request, the method further comprises:
acquiring the number of fields in the target response data and the number of types corresponding to the multiple abnormal test types;
and generating the target tampering times according to the field number and the type number.
3. The application testing method of claim 1, wherein the preset tampering information corresponding to the plurality of abnormal testing types is a plurality of preset tampering information arranged according to a preset testing type sequence; the method further comprises the following steps:
acquiring historical tampering times corresponding to the target response data from preset response test information, wherein the preset response test information records response identification information of the tampered response data and the corresponding historical tampering times;
performing modular operation processing on the historical tampering times and the type number to obtain the testing times corresponding to the current field data;
and determining the target tampering information from the preset tampering information which is arranged according to a preset test type sequence based on the test times corresponding to the current field data.
4. The application testing method of any one of claims 1 to 3, wherein after intercepting the target response data of the application to be tested corresponding to the current test request, the method further comprises:
inquiring target response identification information corresponding to the target response data in preset response test information, wherein the preset response test information records response identification information of tampered response data and corresponding historical tampering times;
acquiring historical tampering times corresponding to the target response identification information from the preset response test information under the condition that the target response identification information is inquired in the preset response test information;
and under the condition that the historical tampering times corresponding to the target response identification information are less than the target tampering times, executing the step of determining the current field data in the target response data.
5. The application testing method of claim 4, further comprising:
adding the target response identification information and the initial tampering times corresponding to the target response identification information in the preset response test information under the condition that the target response identification information is not inquired in the preset response test information;
wherein the number of initial tampering is zero.
6. The application testing method according to claim 5, wherein after the current field data in the target response data is tampered based on the target tampering information to obtain tampering response data, the method further comprises:
and updating the historical tampering times corresponding to the target response identification information in the preset response test information.
7. The application testing method of any of claims 1 to 3, wherein the method further comprises:
monitoring log data corresponding to the application to be tested;
and generating an abnormal analysis result based on the log data under the condition that the test result indicates that the application to be tested runs abnormally.
8. An application testing apparatus, comprising:
the target response data interception module is configured to execute target response data intercepting of a current test request corresponding to an application to be tested, wherein the current test request is any one test request in a target number of test requests performed on a target test interface corresponding to the application to be tested, the target number is equal to a target tampering frequency, and the target tampering frequency is determined based on the number of fields in the target response data and the number of types corresponding to multiple abnormal test types; the target response data comprises a plurality of field data arranged according to a preset field test sequence;
the current field data determination module includes: a history tampering frequency obtaining unit configured to obtain history tampering frequency corresponding to the target response data from preset response test information, wherein the preset response test information records response identification information of tampered response data and corresponding history tampering frequency; the calculation processing unit is configured to divide the historical tampering times by the type number to obtain a target quotient; a quantity determination unit configured to execute a process of taking the target quotient as a quantity of historical test field data in the target response data, the historical test field data being field data that has been tampered based on preset tampering information corresponding to the plurality of abnormal test types; a current field data determining unit configured to perform determining the current field data from the target response data according to the number of the historical test field data and the preset field test sequence, wherein the current field data is any field data which is not tampered based on preset tampering information corresponding to the plurality of abnormal test types in the target response data;
the tampering module is configured to tamper the current field data in the target response data based on target tampering information to obtain tampering response data; the target tampering information is any preset tampering information which is not used for tampering the current field data and is in preset tampering information corresponding to the multiple abnormal test types;
and the test result acquisition module is configured to send the tampering response data to the application to be tested and acquire a test result generated by the application to be tested based on the tampering response data.
9. The application testing apparatus according to claim 8, wherein in a case where the current test request is a test request sent for the first time in the target number of test requests, the apparatus further comprises:
the data acquisition module is configured to execute the steps of acquiring the field quantity in the target response data and the type quantity corresponding to the multiple abnormal test types after intercepting the target response data of the application to be tested corresponding to the current test request;
and the target tampering times generation module is configured to generate the target tampering times according to the field number and the type number.
10. The application testing device of claim 8, wherein the preset tampering information corresponding to the plurality of abnormal testing types is a plurality of preset tampering information arranged according to a preset testing type sequence; the device further comprises:
a second data obtaining unit configured to perform obtaining of a history tampering number corresponding to the target response data from preset response test information in which response identification information of the tampered response data and a corresponding history tampering number are recorded;
the modulus operation processing unit is configured to execute modulus operation processing on the historical tampering times and the type number to obtain testing times corresponding to the current field data;
a target tampering information determining unit configured to perform determining the target tampering information from the plurality of preset tampering information arranged in a preset test type order based on the number of tests corresponding to the current field data.
11. The application testing device of any of claims 8 to 10, wherein the device further comprises:
the target response identification information query module is configured to execute querying of target response identification information corresponding to the target response data in preset response test information after intercepting the target response data corresponding to the current test request of the application to be tested, wherein the preset response test information records response identification information of tampered response data and corresponding historical tampering times;
a history tampering frequency obtaining module configured to obtain a history tampering frequency corresponding to the target response identification information from the preset response test information, in a case where the target response identification information is queried in the preset response test information;
the current field data determination module is further configured to execute the step of determining the current field data in the target response data if the historical tampering number corresponding to the target response identification information is less than the target tampering number.
12. The application testing device of claim 11, wherein the device further comprises:
a test information adding module configured to add the target response identification information and the initial tampering times corresponding to the target response identification information in the preset response test information under the condition that the target response identification information is not queried in the preset response test information;
wherein the number of initial tampering is zero.
13. The application testing device of claim 12, wherein the device further comprises:
and the historical tampering frequency updating module is configured to update the historical tampering frequency corresponding to the target response identification information in the preset response test information after the current field data in the target response data is tampered based on the target tampering information to obtain tampering response data.
14. The application testing device of any of claims 8 to 10, wherein the device further comprises:
the log data detection module is configured to monitor log data corresponding to the application to be tested;
and the abnormal analysis result generation module is configured to execute generation of an abnormal analysis result based on the log data under the condition that the test result indicates that the application to be tested runs abnormally.
15. An electronic device, comprising:
a processor;
a memory for storing the processor-executable instructions;
wherein the processor is configured to execute the instructions to implement the application testing method of any of claims 1 to 7.
16. A computer readable storage medium, wherein instructions in the storage medium, when executed by a processor of an electronic device, enable the electronic device to perform the application testing method of any of claims 1 to 7.
CN202110961538.9A 2021-08-20 2021-08-20 Application testing method and device, electronic equipment and storage medium Active CN113419968B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110961538.9A CN113419968B (en) 2021-08-20 2021-08-20 Application testing method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110961538.9A CN113419968B (en) 2021-08-20 2021-08-20 Application testing method and device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN113419968A CN113419968A (en) 2021-09-21
CN113419968B true CN113419968B (en) 2022-03-25

Family

ID=77719729

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110961538.9A Active CN113419968B (en) 2021-08-20 2021-08-20 Application testing method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113419968B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114726577A (en) * 2022-03-02 2022-07-08 武汉天喻信息产业股份有限公司 Communication system for testing and data tampering method

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108268375B (en) * 2018-01-12 2021-04-30 深圳壹账通智能科技有限公司 Application program testing method and device, computer equipment and storage medium
CN110069413B (en) * 2019-04-22 2020-11-24 苏州亿歌网络科技有限公司 Test data communication, test method, device, equipment and storage medium
US11841943B2 (en) * 2019-09-26 2023-12-12 Arm Limited Tamper detection and response techniques
CN111586037B (en) * 2020-05-06 2022-05-06 全知科技(杭州)有限责任公司 Method for detecting abnormal network request tampered by parameters
CN111813653B (en) * 2020-05-28 2023-07-04 杭州览众数据科技有限公司 Data exception testing method and automatic testing tool related to field content
CN111914262A (en) * 2020-08-12 2020-11-10 中国工商银行股份有限公司 Test method, device, system, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN113419968A (en) 2021-09-21

Similar Documents

Publication Publication Date Title
US11798028B2 (en) Systems and methods for monitoring malicious software engaging in online advertising fraud or other form of deceit
CN108268375B (en) Application program testing method and device, computer equipment and storage medium
CN109672741B (en) Micro-service monitoring method and device, computer equipment and storage medium
CN108848000B (en) Network request testing method and device, computer equipment and storage medium
CN107329894B (en) Application program system testing method and device and electronic equipment
US20070150568A1 (en) Non-destructive synthetic transaction configuration
CN108287823B (en) Message data processing method and device, computer equipment and storage medium
US11227256B2 (en) Method and system for detecting gaps in data buckets for A/B experimentation
US20190057118A1 (en) Method and System for Detecting Data Bucket Inconsistencies for A/B Experimentation
CN113726770B (en) Data interception method, device, computer equipment and storage medium
CN110781070A (en) Big data test verification method and device, computer equipment and storage medium
US11726958B2 (en) Method and system for providing pre-approved A/A data buckets
CN113419968B (en) Application testing method and device, electronic equipment and storage medium
CN111654495B (en) Method, apparatus, device and storage medium for determining traffic generation source
CN110727892A (en) Cache data updating method and device and electronic equipment
US9652488B2 (en) Computer product, verification support method, and verification support apparatus
CN111431767B (en) Multi-browser resource synchronization method and device, computer equipment and storage medium
US20160085664A1 (en) Generating a fingerprint representing a response of an application to a simulation of a fault of an external service
CN111897723A (en) Method and device for testing application
CN108304289B (en) Terminal fingerprint test method and device, computer equipment and storage medium
CN112019377B (en) Method, system, electronic device and storage medium for network user role identification
CN115905225A (en) Data service publishing system, method, device and computer storage medium
CN113204477B (en) Application testing method and device, electronic equipment and storage medium
CN111459743B (en) Data processing method and device and readable storage medium
CN110704218B (en) Data processing method, data processing device, computer equipment and storage medium

Legal Events

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