Application test method and device, computer device and storage medium

CN117648255BActive Publication Date: 2026-11-03CHINA ELECTRONICS RELIABILITY AND ENVIRONMENTAL TESTING INSTITUTE ((THE FIFTH INSTITUTE OF ELECTRONICS MINISTRY OF INDUSTRY AND INFORMATION TECHNOLOGY) (CHINA SAIBAO LABORATORY)
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311643070.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-12-01
Publication Date
2026-11-03
Estimated Expiration
2043-12-01

AI Technical Summary

Technical Problem

In existing technologies, when testing applications, only a portion of the application can be tested, making it impossible to accurately identify all software vulnerabilities contained within the application.

Method used

The program tests the program blocks to be tested contained in the target application through initial test cases to obtain the first test result. Then, the program block detection is performed on the target application to obtain the number and identification of the undetected missing program blocks. The target test result is determined based on the first test result and the detection result. Detailed information of the undetected program blocks is obtained through mutation processing and code instrumentation.

Benefits of technology

It enables testing of all programs within an application, accurately identifying and locating software vulnerabilities, and ensuring the quality and reliability of the application.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117648255B_ABST
    Figure CN117648255B_ABST
Patent Text Reader

Abstract

The application relates to an application test method and device, computer equipment and a storage medium, and relates to the technical field of program testing. The method comprises the following steps: performing program testing on a to-be-detected program block contained in a target application according to an initial test case, obtaining a first test result of the target application; performing program block detection on the target application, and obtaining a detection result; wherein the detection result comprises the number of first missed program blocks contained in the target application and not detected, and the program identifier corresponding to the first missed program blocks when the number of the first missed program blocks is not zero; and determining a target test result of the target application according to the first test result and the detection result. The application can perform program testing on all to-be-detected program blocks contained in the target application, and then obtain all potential software vulnerabilities contained in the application program.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of program testing technology, and in particular to an application testing method, apparatus, computer equipment, and storage medium. Background Technology

[0002] With the rapid development of the software industry, more and more applications are being developed and put into use. However, before an application is officially put into use, it is necessary to conduct program testing in order to quickly locate software vulnerabilities contained in the application.

[0003] In existing technologies, fuzz testing cases can be used to test applications and locate software vulnerabilities contained in the application. However, when testing applications, existing technologies can only test a portion of the program, and therefore cannot accurately identify all software vulnerabilities contained in the application. Summary of the Invention

[0004] Therefore, it is necessary to provide an application testing method, apparatus, computer equipment, and storage medium that can accurately obtain all software vulnerabilities contained in an application, addressing the aforementioned technical problems.

[0005] Firstly, this application provides an application testing method. The method includes:

[0006] Based on the initial test cases, the program blocks to be tested contained in the target application are tested to obtain the first test result of the target application;

[0007] The target application is subjected to block detection to obtain the detection results; the detection results include the number of undetected first missing blocks in the target application, and the program identifier corresponding to the first missing block when the number of first missing blocks is not zero.

[0008] Based on the first test results and the detection results, the target test results for the target application are determined.

[0009] In one embodiment, the target test result of the target application is determined based on the first test result and the detection result, including:

[0010] If the number of the first missing program blocks in the detection result is zero, then the first test result will be used as the target test result of the target application.

[0011] If the number of the first missing program blocks in the detection result is not zero, then the target test result of the target application is determined based on the program identifier contained in the detection result and the first test result.

[0012] In one embodiment, the target test result of the target application is determined based on the program identifier and the first test result contained in the detection result, including:

[0013] The initial test cases are mutated to obtain the target test cases;

[0014] Based on the target test cases, the program is tested on the first missing program block corresponding to the program identifier to obtain the second test result of the target application;

[0015] Determine whether there is an undetected second subroutine block in the first omitted program block;

[0016] If it does not exist, the first test result and the second test result will be used as the target test result for the target application.

[0017] If it exists, the target test case is used as the new initial test case, the second missing subroutine block is used as the new first missing subroutine block, and the process returns to the step of mutating the initial test case until it is determined that there is no undetected second missing subroutine block in the new first missing subroutine block.

[0018] In one embodiment, the first missing program block is tested according to the target test cases to obtain a second test result for the target application, including:

[0019] The first omitted program block is grouped and processed to obtain at least one group of the first omitted subroutine blocks;

[0020] Based on the target test cases, the program tests the first missing subroutine blocks of each group, and the second sub-test results corresponding to the first missing subroutine blocks of each group are obtained;

[0021] The results of each second subtest are summarized to obtain the second test results for the target application.

[0022] In one embodiment, program testing is performed on the program blocks to be tested contained in the target application according to the initial test cases to obtain the first test result of the target application, including:

[0023] Insert instrumentation code into the program block to be tested contained in the target application;

[0024] Based on the initial test cases, the program blocks to be tested in the target application with instrumented code are tested to obtain the first test results of the target application.

[0025] In one embodiment, block detection is performed on the target application to obtain detection results, including:

[0026] Based on the instrumented code, determine the control flow graph corresponding to the target application;

[0027] Based on the program call information recorded in the control flow graph, program block detection is performed on the target application to obtain the detection results.

[0028] Secondly, this application also provides an application testing apparatus. The apparatus includes:

[0029] The first determining module is used to perform program testing on the program blocks to be tested contained in the target application based on the initial test cases, and obtain the first test result of the target application;

[0030] The second determining module is used to perform program block detection on the target application and obtain detection results; wherein, the detection results include the number of undetected first missing program blocks in the target application, and the program identifier corresponding to the first missing program block when the number of first missing program blocks is not zero.

[0031] The third determination module is used to determine the target test result of the target application based on the first test result and the detection result.

[0032] Thirdly, this application also provides a computer device. The computer device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to perform the following steps:

[0033] Based on the initial test cases, the program blocks to be tested contained in the target application are tested to obtain the first test result of the target application;

[0034] The target application is subjected to block detection to obtain the detection results; the detection results include the number of undetected first missing blocks in the target application, and the program identifier corresponding to the first missing block when the number of first missing blocks is not zero.

[0035] Based on the first test results and the detection results, the target test results for the target application are determined.

[0036] Fourthly, this application also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program thereon, which, when executed by a processor, performs the following steps:

[0037] Based on the initial test cases, the program blocks to be tested contained in the target application are tested to obtain the first test result of the target application;

[0038] The target application is subjected to block detection to obtain the detection results; the detection results include the number of undetected first missing blocks in the target application, and the program identifier corresponding to the first missing block when the number of first missing blocks is not zero.

[0039] Based on the first test results and the detection results, the target test results for the target application are determined.

[0040] Fifthly, this application also provides a computer program product. The computer program product includes a computer program that, when executed by a processor, performs the following steps:

[0041] Based on the initial test cases, the program blocks to be tested contained in the target application are tested to obtain the first test result of the target application;

[0042] The target application is subjected to block detection to obtain the detection results; the detection results include the number of undetected first missing blocks in the target application, and the program identifier corresponding to the first missing block when the number of first missing blocks is not zero.

[0043] Based on the first test results and the detection results, the target test results for the target application are determined.

[0044] The aforementioned application testing method, apparatus, computer equipment, and storage medium perform program testing on the program blocks to be tested contained in the target application through initial test cases to obtain a first test result of the target application; perform program block detection on the target application to obtain a detection result; and determine the target test result of the target application based on the first test result and the detection result. As can be seen from the above process, after determining the first test result of the target application, this application also performs program block detection on the target application to determine whether the target application contains an undetected first omission program block, thereby knowing that the target application contains an undetected first omission program block. Furthermore, based on the first test result and the detection result, the target test result of the target application is determined. Compared to the prior art process of directly determining the test result of the target application after performing program testing on the target application using fuzzy test cases, this application also considers the undetected first omission program block in the target application when performing program testing. Therefore, this application can test the entire program of the target application, accurately obtaining all software vulnerabilities contained in the application. Furthermore, the detection result includes the program identifier corresponding to the first missing program block when the number of the first missing program block is not zero. Therefore, when the number of the first missing program block is not zero, this application can locate the first missing program block according to the program identifier, and then perform program testing on the first missing program block in the subsequent program testing process, and perform program testing on each program block to be tested contained in the target application. Attached Figure Description

[0045] Figure 1 An application environment diagram for an application testing method provided in this application embodiment;

[0046] Figure 2A flowchart illustrating an application testing method provided in this application embodiment;

[0047] Figure 3 A flowchart illustrating the steps for determining a target test result is provided in this application embodiment;

[0048] Figure 4 A flowchart illustrating another step for determining a target test result provided in this application embodiment;

[0049] Figure 5 A flowchart illustrating the steps for determining a detection result provided in this application embodiment;

[0050] Figure 6 A flowchart illustrating another application testing method provided in this application embodiment;

[0051] Figure 7 A structural block diagram of the first application testing device provided in the embodiments of this application;

[0052] Figure 8 A structural block diagram of the second application testing device provided in the embodiments of this application;

[0053] Figure 9 A structural block diagram of the third application testing device provided in the embodiments of this application;

[0054] Figure 10 A structural block diagram of the fourth application testing device provided in the embodiments of this application;

[0055] Figure 11 A structural block diagram of the fifth application testing device provided in the embodiments of this application;

[0056] Figure 12 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation

[0057] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0058] It should be understood that the specific embodiments described herein are merely illustrative of this application and are not intended to limit this application. In the description of this application, references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of this application. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in a suitable manner in any one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of different embodiments or examples.

[0059] Based on the above, the application testing method provided in this application embodiment can be applied to, for example, Figure 1 In the application environment shown, in one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows. Figure 1 As shown, the computer device includes a processor, memory, and a network interface connected via a system bus. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and data blocks. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The data blocks store data acquired by the application testing method. The network interface communicates with external terminals via a network connection. When the computer program is executed by the processor, it implements an application testing method.

[0060] This application discloses an application testing method, apparatus, computer equipment, and storage medium. The method involves testing the program blocks to be tested contained in the target application using initial test cases to obtain a first test result of the target application; performing program block testing on the target application to obtain a test result; and determining the target test result of the target application based on the first test result and the test result.

[0061] In one exemplary embodiment, such as Figure 2 As shown, Figure 2 This application provides a flowchart of an application testing method according to an embodiment of the present application. The method is applied to... Figure 1 The following steps, 201 to 203, are used as an example of computer equipment.

[0062] Step 201: Perform program testing on the program blocks to be tested contained in the target application according to the initial test cases to obtain the first test result of the target application.

[0063] The initial test cases refer to test cases randomly generated by the default fuzzing strategy of AFL (American Fuzzy Lop); the first test results include program vulnerability and bug information found by testing the target application through the initial test cases, such as the number of version bugs, the number of module bugs, the severity of the bugs, the bug type, and the bug status.

[0064] The program block to be tested refers to the program in the target application that needs to be tested; to further explain, the program in the target application that needs to be tested can be divided into at least one program block to be tested according to the functions implemented by the program.

[0065] It should be noted that, in order to promptly identify errors, defects, and problems in the target application, including functional issues, performance problems, and security vulnerabilities, initial test cases can be used to test the program blocks to be tested contained in the target application, thereby discovering and resolving problems in a timely manner and reducing the later maintenance costs of the target application.

[0066] To further explain, the number of initial test cases can be determined based on the number of cores on the computer device with the target application installed; that is, the number of device cores is used as the number of initial test cases.

[0067] In one embodiment of this application, if the number of initial test cases is determined according to the number of device cores of the device where the target application is located, and if the number of device cores of the device where the target application is located is 16, then the number of initial test cases is 16. Therefore, 16 initial test cases can be used to sequentially test the program blocks to be tested contained in the target application, and the test results obtained by each initial test case in testing the target application are merged as the first test result of the target application.

[0068] Step 202: Perform block detection on the target application and obtain the detection results.

[0069] The detection results include the number of undetected first missing program blocks in the target application, and the program identifier corresponding to the first missing program block when the number of first missing program blocks is not zero.

[0070] Furthermore, the first omitted program block refers to the program block that was not tested when the target application was tested using the initial test cases. The program identifier corresponding to the first omitted program block can be the code number id (Identity document) of the first omitted program block, or the code location of the first omitted program block.

[0071] It should be noted that, in order to test all the program blocks to be tested in the target application as comprehensively as possible, program block detection can be performed on the target application during program testing to obtain detection results. Furthermore, based on the number of the first missing program blocks in the detection results, the target application can be tested again to further ensure the reliability and security of the target application.

[0072] In one embodiment of this application, the detection result of the target application for program block detection can be obtained based on the instrumentation code. Specifically, it may include the following: determining the control flow graph corresponding to the target application based on the instrumentation code, performing program block detection on the target application based on the program call information recorded in the control flow graph, and obtaining the detection result.

[0073] The program call information recorded in the control flow graph is used to represent all program block paths that the target application will traverse during execution.

[0074] Step 203: Based on the first test result and the detection result, determine the target test result for the target application.

[0075] It should be noted that since the detection result includes the number of undetected first missing program blocks in the target application, and when the number of first missing program blocks is not zero, it means that the program blocks to be tested contained in the target application contain undetected first missing program blocks, in order to perform program testing on all program blocks to be tested contained in the target application, this application needs to determine the target test result of the target application based on the first test result and the detection result.

[0076] In one embodiment of this application, when it is necessary to determine the target test result of the target application, the following may be included: determining whether the number of the first missing program blocks in the detection result is zero; if the number of the first missing program blocks in the detection result is zero, then the first test result is taken as the target test result of the target application; if the number of the first missing program blocks in the detection result is not zero, then the target test result of the target application is determined based on the first missing program blocks and the first test result.

[0077] As an example, the target application contains 10 program blocks to be tested. The target application is tested using the initial test cases to obtain the first test result. Further, the program block detection of the target application shows that the number of the first missing program blocks in the detection result is zero, indicating that all the program blocks to be tested in the target application have been tested. Therefore, the first test result is the target test result of the target application.

[0078] As another example, the target application contains 10 program blocks to be tested. The target application is tested using initial test cases to obtain the first test result. Further, the target application is tested for program blocks and the number of first missing program blocks in the detection result is 8, as well as the program identifiers of the 8 first missing program blocks. This indicates that there are still untested program blocks to be tested in the target application. Then, the first test result and the detection result determine the target test result of the target application.

[0079] The aforementioned application testing method involves testing the program blocks to be detected within the target application using initial test cases to obtain a first test result; then performing program block detection on the target application to obtain detection results; and finally determining the target test result based on the first test result and the detection results. As can be seen from the above process, after determining the first test result of the target application, this application further performs program block detection on the target application to determine whether it contains any undetected first omission program blocks. This allows the determination of whether the target application contains undetected first omission program blocks. Furthermore, based on the first test result and the detection results, the target test result of the target application is determined. Compared to the prior art process of directly determining the test result of the target application after testing it using fuzzy test cases, this application considers undetected first omission program blocks in the target application during program testing. Therefore, this application can test the entire program of the target application, accurately identifying all software vulnerabilities contained in the application. Furthermore, the detection result includes the program identifier corresponding to the first missing program block when the number of the first missing program block is not zero. Therefore, when the number of the first missing program block is not zero, this application can locate the first missing program block according to the program identifier, and then perform program testing on the first missing program block in the subsequent program testing process, and perform program testing on each program block to be tested contained in the target application.

[0080] To ensure the quality and reliability of the target application, existing technologies use a series of test cases to randomly explore and test the software program. However, when testing applications, existing technologies can only test a portion of the program, thus failing to accurately identify all software vulnerabilities contained within the application. To solve the above technical problem, the computer device of this application can, as... Figure 3 The target test results for the target application are determined in the manner shown, including steps 301 and 302. Wherein:

[0081] Step 301: If the number of the first missing program blocks in the detection result is zero, then the first test result is taken as the target test result of the target application.

[0082] It should be noted that since the first missing program block refers to the program block that was not tested when the target application was tested using the initial test cases, if the number of the first missing program blocks in the detection result is zero, it means that all the program blocks to be tested in the target application have been tested and there are no untested program blocks. Therefore, if the number of the first missing program blocks in the detection result is zero, the first test result will be taken as the target test result of the target application.

[0083] Step 302: If the number of the first missing program blocks in the detection result is not zero, then the target test result of the target application is determined based on the program identifier contained in the detection result and the first test result.

[0084] It should be noted that since the first missing program block refers to the program block that was not tested when the target application was tested using the initial test cases, if the number of the first missing program blocks in the detection result is not zero, it indicates that there are still program blocks in the target application that have not been tested. Therefore, if the number of the first missing program blocks in the detection result is not zero, the program identifier and the first test result contained in the detection result determine the target test result of the target application.

[0085] In one embodiment of this application, the target test result of the target application is determined based on the program identifier and the first test result contained in the detection result. Specifically, this may include the following: mutating the initial test case to obtain a mutated target test case; further, using the mutated target test case to perform program testing on the target application to obtain a second test result of the target application; and determining whether the first missing program block corresponding to the program identifier has been tested. If so, the first test result and the second test result are used as the target test result of the target application. If not, an undetected second missing subprogram block is determined from the first missing program block corresponding to the program identifier. Then, the target test case is used as a new initial test case, the second missing subprogram block is used as a new first missing program block, and the step of mutating the initial test case is returned to execution until it is determined that there is no undetected second missing subprogram block in the new first missing program block.

[0086] In another embodiment of this application, determining the target test result of the target application based on the program identifier and the first test result contained in the detection result may further include the following: constructing reference test cases capable of testing the first missing program block corresponding to the program identifier; performing program testing on the first missing program block corresponding to the program identifier based on the reference test cases to obtain the second test result of the target application. Since the reference test cases are capable of testing the first missing program block corresponding to the program identifier, there is no undetected second missing subprogram block in the first missing program block. The first test result and the second test result are used as the target test result of the target application.

[0087] The above application testing method determines whether the number of the first missing program blocks in the detection result is zero. Then, based on the determination result, it reflects whether all the program blocks to be tested contained in the target application have been tested. If the number of the first missing program blocks in the detection result is not zero, the first missing program blocks in the target application are tested again to ensure that all the program blocks to be tested contained in the target application have been tested, thereby ensuring the quality and reliability of the target application.

[0088] In an exemplary embodiment, when the number of the first missing program blocks in the detection result is not zero, and it is necessary to determine the target test result of the target application, it can be done as follows: Figure 4 The method shown includes steps 401 to 405. Wherein:

[0089] Step 401: Perform mutation processing on the initial test cases to obtain the target test cases.

[0090] Mutation processing refers to the process of randomly modifying the initial test cases during the testing process to generate new test cases. The initial test cases and the target test cases are different test cases.

[0091] It should be noted that since the initial test cases cannot achieve full coverage testing of the target application, the initial test cases are mutated to discover potential vulnerabilities and errors in the target application as comprehensively as possible. By mutating the initial test cases, different code paths and boundary conditions of the program blocks to be tested in the target application can be covered as much as possible, thereby increasing the possibility of discovering potential problems and improving the comprehensiveness and effectiveness of testing the target application.

[0092] To further explain, there are many methods for mutating initial test cases, such as simple mutation and conditional mutation.

[0093] As one implementation method, if the initial test cases are mutated using a simple mutation method to obtain the target test cases, it can include the following: making simple modifications to the initial test cases, such as changing the value of numbers, swapping the positions of variables, adding or deleting certain characters, etc., to mutate the initial test cases and obtain the target test cases.

[0094] As another implementation method, if the initial test cases are mutated using condition mutation to obtain the target test cases, the following can be included: according to the program's control flow, the conditions of the conditional statements (if statements, loop statements, etc.) in the initial test cases are modified to generate new test cases, thereby realizing the mutation of the initial test cases and obtaining the target test cases.

[0095] Step 402: Perform program testing on the first missing program block corresponding to the program identifier according to the target test cases to obtain the second test result of the target application.

[0096] In one embodiment of this application, when it is necessary to obtain the second test result of the target application, the following may be included: grouping the first missing program blocks to obtain at least one group of first missing subprogram blocks; performing program testing on each group of first missing subprogram blocks according to the target test cases to obtain the second sub-test result corresponding to each group of first missing subprogram blocks; and summarizing each second sub-test result to obtain the second test result of the target application.

[0097] It should be noted that the process of grouping the first missing program blocks may specifically include the following: determining the relationship between the number of the first missing program blocks and the threshold. The threshold can be determined based on the number of the first missing program blocks and the number of device cores of the target application. For example, if the number of the first missing program blocks is 160 and the number of device cores is 16, then the threshold is 10, indicating that 10 first missing program blocks can be divided into a group; therefore, 16 groups of first missing subroutines can be obtained.

[0098] To further explain, when grouping the first missing program block, the first missing program blocks that have the same prefix and meet the threshold can also be grouped together by using the key node (e.g., the judgment node) as a prefix, thereby achieving the grouping of the first missing program block and obtaining at least one group of first missing subroutines.

[0099] Step 403: Determine whether there is an undetected second missing subroutine block in the first missing program block.

[0100] The second omitted subroutine block refers to the subroutine block in the first omitted subroutine block that was not tested by the target test case.

[0101] It should be noted that, in order to ensure that all the program blocks to be tested contained in the target application are tested, thereby ensuring the quality and reliability of the target application, it is necessary to detect the first missing program block to determine whether there is an undetected second missing subroutine block in the first missing program block.

[0102] Step 404: If it does not exist, then the first test result and the second test result are taken as the target test result of the target application.

[0103] It should be noted that since there is no untested second missing subroutine block in the first missing program block, it indicates that all the program blocks to be tested contained in the target application have been tested. Therefore, the first test result and the second test result are the target test results of the target application.

[0104] Step 405: If it exists, then take the target test case as the new initial test case, take the second missing subroutine block as the new first missing subroutine block, and return to the step of performing mutation processing on the initial test case until it is determined that there is no undetected second missing subroutine block in the new first missing subroutine block.

[0105] It should be noted that since there is an undetected second sub-program block in the first missing program block, it indicates that there are still untested program blocks in the target application. Therefore, it is necessary to continue to detect the target application until all the program blocks in the target application have been detected.

[0106] In one embodiment of this application, if there is an undetected second missing subroutine block in the first missing program block, the process may include the following steps: taking the target test case as a new initial test case, taking the second missing subroutine block as a new first missing program block, and returning to perform mutation processing on the initial test case to obtain a new target test case, and performing program testing on the new first missing program block according to the new target test case to obtain a new second test result for the target application, until it is determined that there is no undetected second missing subroutine block in the new first missing program block.

[0107] For example, if the target application contains ten program blocks to be tested, the application is tested according to the initial test cases to obtain the first test result. If, based on the test results, it is determined that the target application contains two undetected first missing program blocks, the initial test cases are mutated to obtain the target test cases. The two missing program blocks corresponding to the program identifiers are then tested according to the target test cases to obtain the second test result. If, at this point, it is determined that there is an undetected second missing subprogram block within the first missing program block, the target test cases are used as the new initial test cases, and the second missing subprogram block is used as the new first missing program block. The new initial test cases are mutated to obtain the target test cases. The new first missing program blocks are then tested according to the target test cases to obtain the new second test result. If, at this point, it is determined that there is no undetected second missing subprogram block within the new first missing program block, the first test result, the second test result, and the new second test result are taken as the target test result of the target application.

[0108] The above application testing method mutates the initial test cases to obtain target test cases, enabling the target test cases to test the first missing program block of the target application. Furthermore, by determining whether there is an undetected second missing sub-program block in the first missing program block, it ensures that all program blocks to be tested in the target application are tested.

[0109] In one embodiment of this application, when it is necessary to obtain the first test result of the target application, the following may be included: inserting instrumentation code into the test block contained in the target application; performing program testing on the test block with the instrumentation code inserted in the target application according to the initial test cases, and obtaining the first test result of the target application.

[0110] Among them, instrumentation code is used to indicate that some probe code is inserted into the program while ensuring the original logical integrity of the program block to be tested. These probe codes refer to code segments used to dynamically collect information from the target application.

[0111] It should be noted that when it is necessary to insert instrumentation code into the program block to be tested contained in the target application, the following can be included: traversing the program block to be tested contained in the target application line by line, and inserting instrumentation code into each line of the program block to be tested during the line-by-line traversal, thereby realizing the instrumentation operation of the program block to be tested contained in the target application.

[0112] To further explain, instrumented code can obtain some runtime information generated during the testing of the target application, including call chain information, edge information, conditional jump instructions, and subsequent block information (e.g., target and fall_through blocks).

[0113] In one embodiment of this application, when it is necessary to obtain the first test result of the target application, the following may be included: performing program testing on the program block to be tested with instrumented code inserted in the target application according to the initial test cases, so as to achieve the purpose of program testing of the target application and obtain the first test result of the target application.

[0114] To further explain, when it is necessary to obtain the second test results of the target application, the first missing program blocks can be grouped to obtain at least one group of first missing subroutines. Instrumentation is then performed on each group of first missing subroutines with instrumented code. Then, according to the target test cases, program tests are performed on each group of first missing subroutines with instrumented code inserted in the target application to obtain the second subtest results corresponding to each group of first missing subroutines. The second subtest results are then summarized to obtain the second test results of the target application.

[0115] The above application testing method tests the program block to be tested in the target application with instrumented code inserted through initial test cases to obtain the first test result of the target application. Since the instrumented code can obtain some runtime information generated by the target application during the test, it provides a basis for obtaining the target test result of the target application in the future.

[0116] In an exemplary embodiment, when it is necessary to perform block detection on a target application and obtain the detection results, it can be done through methods such as... Figure 5 The method shown includes steps 501 and 502. Wherein:

[0117] Step 501: Determine the control flow graph corresponding to the target application based on the instrumentation code.

[0118] The control flow graph is used to represent all the paths that the target application will traverse during execution. The control flow graph represents the possible flow of execution of all program blocks in the target application in the form of a graph, and can also reflect the real-time execution process of the target application.

[0119] It should be noted that since instrumentation code can obtain some runtime information generated during the testing of the target application, including call chain information, edge information, conditional jump instructions, and subsequent program block information, the control flow graph corresponding to the target application can be obtained based on the runtime information of the target application obtained by instrumentation code.

[0120] Step 502: Based on the program call information recorded in the control flow graph, perform program block detection on the target application and obtain the detection results.

[0121] The program call information recorded in the control flow graph is used to represent all program block paths that the target application will traverse during execution.

[0122] In one embodiment of this application, when it is necessary to obtain the detection result, the following may be included: traversing the control flow graph using a depth-first search method, performing program block detection on the target application based on the program call information recorded in the control flow graph, recording the number of untested program blocks and the program identifiers of the untested program blocks, and obtaining the detection result.

[0123] Among them, untested program blocks refer to program blocks whose successor program blocks target and fall_through have not been tested.

[0124] The above application testing method uses the program call information recorded in the control flow graph to perform program block detection on the target application and obtain the detection results. Since the detection results include the number of undetected first missing program blocks in the target application, and the program identifier corresponding to the first missing program block when the number of the first missing program blocks is not zero, it provides a test basis for obtaining the target test results of the target application.

[0125] In an exemplary embodiment, when it is necessary to determine the target test results of a target application, the process may specifically include the following steps: Figure 6 As shown:

[0126] Step 601: Insert instrumentation code into the program block to be tested contained in the target application.

[0127] Step 602: Perform program testing on the program block to be tested with instrumented code inserted in the target application according to the initial test cases to obtain the first test result of the target application.

[0128] Step 603: Determine the control flow graph corresponding to the target application based on the instrumentation code.

[0129] Step 604: Based on the program call information recorded in the control flow graph, perform program block detection on the target application and obtain the detection results.

[0130] Step 605: If the number of the first missing program blocks in the detection result is zero, then the first test result is taken as the target test result of the target application.

[0131] Step 606: If the number of the first missing program blocks in the detection result is not zero, then the initial test case is mutated to obtain the target test case.

[0132] Step 607: Group the first missing program blocks corresponding to the program identifier to obtain at least one group of first missing subroutines.

[0133] Step 608: Perform program testing on the first missing subroutine blocks of each group according to the target test cases to obtain the second sub-test results corresponding to the first missing subroutine blocks of each group; summarize the second sub-test results to obtain the second test results of the target application.

[0134] Step 609: Determine whether there is an undetected second missing subroutine block in the first missing program block;

[0135] Step 610: If it does not exist, then the first test result and the second test result are taken as the target test result of the target application.

[0136] Step 611: If it exists, then take the target test case as the new initial test case, take the second missing subroutine block as the new first missing subroutine block, and return to the step of performing mutation processing on the initial test case until it is determined that there is no undetected second missing subroutine block in the new first missing subroutine block.

[0137] In one embodiment of this application, after obtaining the target test results of the target application, the method further includes: evaluating the target test results using three metrics: execution speed, coverage, and collisions; and determining whether the target test results meet the requirements based on the evaluation results. For example, in testing on some real application software, such as gdiplus, office (MSXML), and IrfanView, the execution speed is used for evaluation. This application improves the parallel speedup ratio by 2112%, 3157%, and 3852% respectively during testing. It can be seen that the execution speed of this application is significantly improved during testing.

[0138] The aforementioned application testing method involves testing the program blocks to be detected within the target application using initial test cases to obtain a first test result; then performing program block detection on the target application to obtain detection results; and finally determining the target test result based on the first test result and the detection results. As can be seen from the above process, after determining the first test result of the target application, this application further performs program block detection on the target application to determine whether it contains any undetected first omission program blocks. This allows the determination of whether the target application contains undetected first omission program blocks. Furthermore, based on the first test result and the detection results, the target test result of the target application is determined. Compared to the prior art process of directly determining the test result of the target application after testing it using fuzzy test cases, this application considers undetected first omission program blocks in the target application during program testing. Therefore, this application can test the entire program of the target application, accurately identifying all software vulnerabilities contained in the application. Furthermore, the detection result includes the program identifier corresponding to the first missing program block when the number of the first missing program block is not zero. Therefore, when the number of the first missing program block is not zero, this application can locate the first missing program block according to the program identifier, and then perform program testing on the first missing program block in the subsequent program testing process, and perform program testing on each program block to be tested contained in the target application.

[0139] It should be understood that although the steps in the flowcharts of the above embodiments are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the above embodiments may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.

[0140] Based on the same inventive concept, this application also provides an application testing apparatus for implementing the application testing method described above. The solution provided by this apparatus is similar to the implementation scheme described in the above method; therefore, the specific limitations in one or more application testing apparatus embodiments provided below can be found in the limitations of the application testing method described above, and will not be repeated here.

[0141] In one embodiment, such as Figure 7As shown, an application testing device is provided, comprising: a first determining module 10, a second determining module 20, and a third determining module 30, wherein:

[0142] The first determining module 10 is used to perform program testing on the program blocks to be tested contained in the target application according to the initial test cases, and obtain the first test result of the target application.

[0143] The second determining module 20 is used to perform program block detection on the target application and obtain detection results; wherein, the detection results include the number of undetected first missing program blocks in the target application, and the program identifier corresponding to the first missing program block when the number of the first missing program blocks is not zero.

[0144] The third determining module 30 is used to determine the target test result of the target application based on the first test result and the detection result.

[0145] The aforementioned application testing apparatus performs program testing on the program blocks to be tested contained in the target application using initial test cases to obtain a first test result for the target application; it then performs program block detection on the target application to obtain detection results; and finally, based on the first test result and the detection results, it determines the target test result for the target application. As can be seen from the above process, after determining the first test result of the target application, this application also performs program block detection on the target application to determine whether the target application contains any undetected first omission program blocks. This allows the determination of the target application's target test result based on the first test result and the detection results. Compared to the prior art's process of directly determining the test result of the target application after performing program testing on the target application using fuzzy test cases, this application considers the undetected first omission program blocks in the target application during program testing. Therefore, this application can test the entire program of the target application, accurately obtaining all software vulnerabilities contained in the application. Furthermore, the detection result includes the program identifier corresponding to the first missing program block when the number of the first missing program block is not zero. Therefore, when the number of the first missing program block is not zero, this application can locate the first missing program block according to the program identifier, and then perform program testing on the first missing program block in the subsequent program testing process, and perform program testing on each program block to be tested contained in the target application.

[0146] In one embodiment, such as Figure 8 As shown, an application testing apparatus is provided. The third determining module 30 in this application testing apparatus includes: a first determining unit 31 and a second determining unit 32, wherein:

[0147] The first determining unit 31 is used to take the first test result as the target test result of the target application if the number of the first missing program blocks in the detection result is zero.

[0148] The second determining unit 32 is used to determine the target test result of the target application based on the program identifier contained in the test result and the first test result if the number of the first missing program blocks in the detection result is not zero.

[0149] In one embodiment, such as Figure 9 As shown, an application testing apparatus is provided. The second determining unit 32 in this apparatus includes: a first determining subunit 321, a second determining subunit 322, a third determining subunit 323, a fourth determining subunit 324, and a fifth determining subunit 325, wherein:

[0150] The first determining subunit 321 is used to perform mutation processing on the initial test cases to obtain the target test cases.

[0151] The second determining subunit 322 is used to perform program testing on the first missing program block corresponding to the program identifier according to the target test cases, and obtain the second test result of the target application.

[0152] The second determining subunit 322 is specifically used to group the first missing program blocks to obtain at least one group of first missing subprogram blocks; to perform program testing on each group of first missing subprogram blocks according to the target test cases to obtain the second subtest results corresponding to each group of first missing subprogram blocks; and to summarize each second subtest result to obtain the second test result of the target application.

[0153] The third determining subunit 323 is used to determine whether there is an undetected second missing subroutine block in the first missing program block.

[0154] The fourth determining subunit 324 is used to take the first test result and the second test result as the target test result of the target application if the first test result does not exist.

[0155] The fifth determining subunit 325 is used to, if it exists, take the target test case as the new initial test case, take the second missing subroutine block as the new first missing subroutine block, and return to the step of performing mutation processing on the initial test case until it is determined that there is no undetected second missing subroutine block in the new first missing subroutine block.

[0156] In one embodiment, such as Figure 10 As shown, an application testing apparatus is provided. The first determining module 10 of this apparatus includes a third determining unit 11 and a fourth determining unit 12, wherein:

[0157] The third determining unit 11 is used to insert instrumentation code into the program block to be detected contained in the target application.

[0158] The fourth determining unit 12 is used to perform program testing on the test program block with instrumented code inserted in the target application according to the initial test cases, and obtain the first test result of the target application.

[0159] In one embodiment, such as Figure 11 As shown, an application testing apparatus is provided. The second determining module 20 of this apparatus includes a fifth determining unit 21 and a sixth determining unit 22, wherein:

[0160] The fifth determining unit 21 is used to determine the control flow graph corresponding to the target application based on the instrumentation code.

[0161] The sixth determining unit 22 is used to perform program block detection on the target application based on the program call information recorded in the control flow graph, and obtain the detection result.

[0162] Each module in the aforementioned application testing device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can call and execute the operations corresponding to each module.

[0163] In one embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as follows: Figure 12As shown, the computer device includes a processor, memory, input / output interfaces, a communication interface, a display unit, and an input device. The processor, memory, and input / output interfaces are connected via a system bus, and the communication interface, display unit, and input device are also connected to the system bus via the input / output interfaces. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The input / output interfaces are used for exchanging information between the processor and external devices. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, mobile cellular networks, NFC (Near Field Communication), or other technologies. When the computer program is executed by the processor, it implements an application testing method. The display unit is used to form a visually visible image and can be a display screen, a projection device, or a virtual reality imaging device. The display screen can be an LCD screen or an e-ink screen. The input device of the computer device can be a touch layer covering the display screen, or buttons, trackballs, or touchpads set on the casing of the computer device, or external keyboards, touchpads, or mice, etc.

[0164] Those skilled in the art will understand that Figure 12 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0165] In one embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to perform the following steps:

[0166] Based on the initial test cases, the program blocks to be tested contained in the target application are tested to obtain the first test result of the target application;

[0167] The target application is subjected to block detection to obtain the detection results; the detection results include the number of undetected first missing blocks in the target application, and the program identifier corresponding to the first missing block when the number of first missing blocks is not zero.

[0168] Based on the first test results and the detection results, the target test results for the target application are determined.

[0169] In one embodiment, the processor, when executing a computer program, also performs the following steps:

[0170] If the number of the first missing program blocks in the detection result is zero, then the first test result will be used as the target test result of the target application.

[0171] If the number of the first missing program blocks in the detection result is not zero, then the target test result of the target application is determined based on the program identifier contained in the detection result and the first test result.

[0172] In one embodiment, the processor, when executing a computer program, also performs the following steps:

[0173] The initial test cases are mutated to obtain the target test cases;

[0174] Based on the target test cases, the program is tested on the first missing program block corresponding to the program identifier to obtain the second test result of the target application;

[0175] Determine whether there is an undetected second subroutine block in the first omitted program block;

[0176] If it does not exist, the first test result and the second test result will be used as the target test result for the target application.

[0177] If it exists, the target test case is used as the new initial test case, the second missing subroutine block is used as the new first missing subroutine block, and the process returns to the step of mutating the initial test case until it is determined that there is no undetected second missing subroutine block in the new first missing subroutine block.

[0178] In one embodiment, the processor, when executing a computer program, also performs the following steps:

[0179] The first omitted program block is grouped and processed to obtain at least one group of the first omitted subroutine blocks;

[0180] Based on the target test cases, the program tests the first missing subroutine blocks of each group, and the second sub-test results corresponding to the first missing subroutine blocks of each group are obtained;

[0181] The results of each second subtest are summarized to obtain the second test results for the target application.

[0182] In one embodiment, the processor, when executing a computer program, also performs the following steps:

[0183] Insert instrumentation code into the program block to be tested contained in the target application;

[0184] Based on the initial test cases, the program blocks to be tested in the target application with instrumented code are tested to obtain the first test results of the target application.

[0185] In one embodiment, the processor, when executing a computer program, also performs the following steps:

[0186] Based on the instrumented code, determine the control flow graph corresponding to the target application;

[0187] Based on the program call information recorded in the control flow graph, program block detection is performed on the target application to obtain the detection results.

[0188] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, the computer program performing the following steps when executed by a processor:

[0189] Based on the initial test cases, the program blocks to be tested contained in the target application are tested to obtain the first test result of the target application;

[0190] The target application is subjected to block detection to obtain the detection results; the detection results include the number of undetected first missing blocks in the target application, and the program identifier corresponding to the first missing block when the number of first missing blocks is not zero.

[0191] Based on the first test results and the detection results, the target test results for the target application are determined.

[0192] In one embodiment, when the computer program is executed by a processor, it further performs the following steps:

[0193] If the number of the first missing program blocks in the detection result is zero, then the first test result will be used as the target test result of the target application.

[0194] If the number of the first missing program blocks in the detection result is not zero, then the target test result of the target application is determined based on the program identifier contained in the detection result and the first test result.

[0195] In one embodiment, when the computer program is executed by a processor, it further performs the following steps:

[0196] The initial test cases are mutated to obtain the target test cases;

[0197] Based on the target test cases, the program is tested on the first missing program block corresponding to the program identifier to obtain the second test result of the target application;

[0198] Determine whether there is an undetected second subroutine block in the first omitted program block;

[0199] If it does not exist, the first test result and the second test result will be used as the target test result for the target application.

[0200] If it exists, the target test case is used as the new initial test case, the second missing subroutine block is used as the new first missing subroutine block, and the process returns to the step of mutating the initial test case until it is determined that there is no undetected second missing subroutine block in the new first missing subroutine block.

[0201] In one embodiment, when the computer program is executed by a processor, it further performs the following steps:

[0202] The first omitted program block is grouped and processed to obtain at least one group of the first omitted subroutine blocks;

[0203] Based on the target test cases, the program tests the first missing subroutine blocks of each group, and the second sub-test results corresponding to the first missing subroutine blocks of each group are obtained;

[0204] The results of each second subtest are summarized to obtain the second test results for the target application.

[0205] In one embodiment, when the computer program is executed by a processor, it further performs the following steps:

[0206] Insert instrumentation code into the program block to be tested contained in the target application;

[0207] Based on the initial test cases, the program blocks to be tested in the target application with instrumented code are tested to obtain the first test results of the target application.

[0208] In one embodiment, when the computer program is executed by a processor, it further performs the following steps:

[0209] Based on the instrumented code, determine the control flow graph corresponding to the target application;

[0210] Based on the program call information recorded in the control flow graph, program block detection is performed on the target application to obtain the detection results.

[0211] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, performs the following steps:

[0212] Based on the initial test cases, the program blocks to be tested contained in the target application are tested to obtain the first test result of the target application;

[0213] The target application is subjected to block detection to obtain the detection results; the detection results include the number of undetected first missing blocks in the target application, and the program identifier corresponding to the first missing block when the number of first missing blocks is not zero.

[0214] Based on the first test results and the detection results, the target test results for the target application are determined.

[0215] In one embodiment, when the computer program is executed by a processor, it further performs the following steps:

[0216] If the number of the first missing program blocks in the detection result is zero, then the first test result will be used as the target test result of the target application.

[0217] If the number of the first missing program blocks in the detection result is not zero, then the target test result of the target application is determined based on the program identifier contained in the detection result and the first test result.

[0218] In one embodiment, when the computer program is executed by a processor, it further performs the following steps:

[0219] The initial test cases are mutated to obtain the target test cases;

[0220] Based on the target test cases, the program is tested on the first missing program block corresponding to the program identifier to obtain the second test result of the target application;

[0221] Determine whether there is an undetected second subroutine block in the first omitted program block;

[0222] If it does not exist, the first test result and the second test result will be used as the target test result for the target application.

[0223] If it exists, the target test case is used as the new initial test case, the second missing subroutine block is used as the new first missing subroutine block, and the process returns to the step of mutating the initial test case until it is determined that there is no undetected second missing subroutine block in the new first missing subroutine block.

[0224] In one embodiment, when the computer program is executed by a processor, it further performs the following steps:

[0225] The first omitted program block is grouped and processed to obtain at least one group of the first omitted subroutine blocks;

[0226] Based on the target test cases, the program tests the first missing subroutine blocks of each group, and the second sub-test results corresponding to the first missing subroutine blocks of each group are obtained;

[0227] The results of each second subtest are summarized to obtain the second test results for the target application.

[0228] In one embodiment, when the computer program is executed by a processor, it further performs the following steps:

[0229] Insert instrumentation code into the program block to be tested contained in the target application;

[0230] Based on the initial test cases, the program blocks to be tested in the target application with instrumented code are tested to obtain the first test results of the target application.

[0231] In one embodiment, when the computer program is executed by a processor, it further performs the following steps:

[0232] Based on the instrumented code, determine the control flow graph corresponding to the target application;

[0233] Based on the program call information recorded in the control flow graph, program block detection is performed on the target application to obtain the detection results.

[0234] 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 used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data shall comply with the relevant laws, regulations and standards of the relevant countries and regions.

[0235] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. This computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the above methods. Any references to memory, data blocks, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The data blocks involved in the embodiments provided in this application may include at least one of relational data blocks and non-relational data blocks. Non-relational data blocks may include, but are not limited to, blockchain-based distributed data blocks. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.

[0236] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0237] The above embodiments are merely illustrative of several implementation methods of this application, and their descriptions are relatively specific and detailed. However, they should not be construed as limiting the scope of this application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.

Claims

1. An application testing method, characterized in that, The method includes: Based on the initial test cases, the program blocks to be tested contained in the target application are tested to obtain the first test result of the target application; The target application is subjected to block detection to obtain detection results; wherein, the detection results include the number of undetected first missing blocks in the target application, and the program identifier corresponding to the first missing block when the number of the first missing block is not zero; Based on the first test result and the detection result, the target test result of the target application is determined, including: If the number of the first missing program blocks in the detection result is zero, then the first test result shall be taken as the target test result of the target application. If the number of the first missing program blocks in the detection result is not zero, then the target test result of the target application is determined based on the program identifier contained in the detection result and the first test result; Specifically, determining the target test result for the target application based on the program identifier contained in the detection result and the first test result includes: The initial test cases are mutated to obtain the target test cases; Based on the target test cases, the program is tested on the first missing program block corresponding to the program identifier to obtain the second test result of the target application; Determine whether there is an undetected second missing subroutine block in the first missing program block; If it does not exist, then the first test result and the second test result shall be taken as the target test result of the target application; If it exists, the target test case is used as the new initial test case, the second missing subroutine block is used as the new first missing subroutine block, and the process returns to the step of mutating the initial test case until it is determined that there is no undetected second missing subroutine block in the new first missing subroutine block.

2. The method according to claim 1, characterized in that, The step of performing program testing on the first missing program block corresponding to the program identifier according to the target test case to obtain the second test result of the target application includes: The first missing program block is grouped to obtain at least one group of the first missing subroutine blocks; Based on the target test cases, program tests are performed on the first missing subroutines of each group to obtain the second sub-test results corresponding to the first missing subroutines of each group. The results of each second sub-test are summarized to obtain the second test results of the target application.

3. The method according to claim 1, characterized in that, The step of performing program testing on the program blocks to be tested contained in the target application based on the initial test cases to obtain the first test result of the target application includes: Insert instrumentation code into the program block to be detected contained in the target application; The program is tested on the target application based on the initial test cases, and the instrumented code is inserted into the test program block to be tested, and the first test result of the target application is obtained.

4. The method according to claim 3, characterized in that, The step of testing the program block to be tested in the target application containing the instrumented code, and obtaining the first test result of the target application, includes: Based on the instrumentation code, determine the control flow graph corresponding to the target application; Based on the program call information recorded in the control flow graph, program block detection is performed on the target application to obtain the detection results.

5. An application testing device, characterized in that, The device includes: The first determining module is used to perform program testing on the program blocks to be tested contained in the target application according to the initial test cases, and obtain the first test result of the target application; The second determining module is used to perform program block detection on the target application and obtain detection results; wherein, the detection results include the number of undetected first missing program blocks in the target application, and the program identifier corresponding to the first missing program block when the number of the first missing program blocks is not zero. A third determining module is configured to determine the target test result of the target application based on the first test result and the detection result. The third determining module includes: The first determining unit is configured to, if the number of the first missing program blocks in the detection result is zero, take the first test result as the target test result of the target application. The second determining unit is configured to determine the target test result of the target application based on the program identifier contained in the detection result and the first test result if the number of the first missing program blocks in the detection result is not zero. Specifically, determining the target test result for the target application based on the program identifier contained in the detection result and the first test result includes: The initial test cases are mutated to obtain the target test cases; Based on the target test cases, the program is tested on the first missing program block corresponding to the program identifier to obtain the second test result of the target application; Determine whether there is an undetected second missing subroutine block in the first missing program block; If it does not exist, then the first test result and the second test result shall be taken as the target test result of the target application; If it exists, the target test case is used as the new initial test case, the second missing subroutine block is used as the new first missing subroutine block, and the process returns to the step of mutating the initial test case until it is determined that there is no undetected second missing subroutine block in the new first missing subroutine block.

6. The apparatus according to claim 5, characterized in that, The step of performing program testing on the first missing program block corresponding to the program identifier according to the target test case to obtain the second test result of the target application includes: The first missing program block is grouped to obtain at least one group of the first missing subroutine blocks; Based on the target test cases, program tests are performed on the first missing subroutines of each group to obtain the second sub-test results corresponding to the first missing subroutines of each group. The results of each second sub-test are summarized to obtain the second test results of the target application.

7. The apparatus according to claim 5, characterized in that, The step of performing program testing on the program blocks to be tested contained in the target application based on the initial test cases to obtain the first test result of the target application includes: Insert instrumentation code into the program block to be detected contained in the target application; The program is tested on the target application based on the initial test cases, and the instrumented code is inserted into the test program block to be tested, and the first test result of the target application is obtained.

8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 4.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 4.

10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 4.

Citation Information

Patent Citations

  • Seed processing method and system for fuzzy test, fuzzy test method and system and storage medium

    CN111881039A

  • Automatic code security detection and vulnerability repair method and device, terminal and medium

    CN115455431A