Fuzzy testing method and device for aerospace embedded software and electronic equipment

By generating and executing multi-dimensional test cases, the problem of AFL fuzzing tool being unable to adapt to the input mode of aerospace embedded software was solved, realizing efficient fuzzing testing and defect detection of aerospace embedded software, and improving the stability and reliability of the software.

CN121579335APending Publication Date: 2026-02-27BEIHANG UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511556692.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-10-29
Publication Date
2026-02-27

AI Technical Summary

Technical Problem

Existing AFL fuzzing tools are ill-suited to the input modes of aerospace embedded software, cannot receive input via communication protocols, and cannot perform multi-dimensional segmentation and detection of security attributes during the communication process.

Method used

A multi-dimensional test case generation method is adopted. By obtaining the protocol text of the aerospace embedded software, a protocol model is generated. A multi-dimensional seed pool is generated by mutating the initial and target seed pools. The seed pools are then encapsulated and verified. Multi-dimensional test cases are executed to perform fuzz testing, generating program defect information and coverage, and generating a defect fuzz test report.

Benefits of technology

It improves the efficiency of fuzz testing for aerospace embedded software, enhances the stability and reliability of the software, provides support for defect repair, and enables multi-dimensional segmentation and security attribute detection of aerospace embedded software.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121579335A_ABST
    Figure CN121579335A_ABST
Patent Text Reader

Abstract

The invention provides a fuzz testing method and device for spaceflight embedded software and electronic equipment, and relates to the technical field of software test.The method comprises the steps that a multi-dimensional test case for the spaceflight embedded software is obtained; performing a fuzzy test on the aerospace embedded software to-be-tested program facing the aerospace embedded software by executing the multi-dimensional test case to obtain program defect information and a program coverage rate; and according to the program defect information and the program coverage rate, generating a defect fuzzy test report for the aerospace embedded software. According to the technical scheme, on the basis of the obtained multi-dimensional test case, the astronautic embedded software-oriented astronautic embedded software to-be-tested program is subjected to fuzzy testing, and the program defect information and the program coverage rate are obtained; and according to the program defect information and the program coverage rate, a defect fuzz test report for the spaceflight embedded software is generated, and the fuzz test efficiency for the spaceflight embedded software is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of software testing technology, and in particular to a fuzz testing method, apparatus, and electronic device for aerospace embedded software. Background Technology

[0002] Given the complexity of embedded software for aerospace applications, how to effectively conduct adequacy evaluation of information system software testing to ensure the sufficiency and completeness of testing and verification has become a pressing problem for software vendors.

[0003] Currently, the primary tool for fuzzing software programs in existing technologies is the American Fuzzy Lop (AFL). AFL is a security-oriented fuzzing tool that collects program runtime information through source code instrumentation, offering low overhead and high performance. AFL receives input in file format and then performs file-based mutation. However, aerospace embedded software, limited by its operating environment, cannot use source code instrumentation for program information collection. Furthermore, aerospace embedded software can receive input not only via files but also via communication protocols from other programs or devices. These communication protocols are diverse and complex. Fuzzing tools must not only adhere to the semantic and state constraints stipulated by the protocols but also generate input from multiple testing perspectives to detect whether test cases violate various security attributes in the communication process. Therefore, existing AFL fuzzing tools are ill-suited to the input patterns of aerospace embedded software.

[0004] Therefore, there is an urgent need for a fuzz testing method for aerospace embedded software. Summary of the Invention

[0005] This invention provides a fuzzing method, apparatus, and electronic device for aerospace embedded software, addressing the shortcomings of existing AFL fuzzing tools in adapting to the input modes of aerospace embedded software. It enables multi-dimensional segmentation of the aerospace embedded software, performs fuzzing tests on the software program based on the obtained multi-dimensional test cases, and obtains program defect information and program coverage. Based on the program defect information and program coverage, a defect fuzzing report for the aerospace embedded software is generated, improving the efficiency of fuzzing testing. The defect fuzzing report effectively helps improve the stability and reliability of the aerospace embedded software, providing strong support for defect repair.

[0006] This invention provides a fuzz testing method for aerospace embedded software, comprising the following steps.

[0007] Obtain multi-dimensional test cases for aerospace embedded software; the multi-dimensional test cases are determined by the test case generator based on the software protocol text of the aerospace embedded software, and the multi-dimensional test cases are different for different software protocol texts for aerospace embedded software. Fuzz testing was performed on the aerospace embedded software program under test by executing multi-dimensional test cases to obtain program defect information and program coverage. Based on program defect information and program coverage, generate defect fuzz test reports for aerospace embedded software.

[0008] According to the present invention, a fuzzing method for aerospace embedded software is provided to obtain multi-dimensional test cases for aerospace embedded software, comprising: obtaining protocol text for aerospace embedded software; generating a protocol model based on the protocol text; obtaining an initial seed pool and a target seed pool; wherein the initial seed pool includes standard test cases for aerospace software, and the target seed pool is a multi-dimensional seed pool; mutating the standard test cases for aerospace software in the initial seed pool in different ways according to the target seed pool to obtain a multi-dimensional seed pool; optimizing the multi-dimensional seed pool according to the protocol model to obtain a target multi-dimensional seed pool; and encapsulating the target multi-dimensional seed pool to obtain the multi-dimensional test cases.

[0009] According to the present invention, a fuzz testing method for aerospace embedded software encapsulates a target multi-dimensional seed pool to obtain multi-dimensional test cases, including: encapsulating the target multi-dimensional seed pool to obtain initial multi-dimensional test cases; adding a valid protocol header to the initial multi-dimensional test cases to obtain candidate multi-dimensional test cases; and recalculating the checksum of the candidate multi-dimensional test cases to obtain the final multi-dimensional test cases.

[0010] According to the present invention, a fuzzing method for aerospace embedded software is used to perform fuzzing on a program under test (UTC) for aerospace embedded software by executing multi-dimensional test cases to obtain program defect information and program coverage. The method includes: determining target fuzzing test cases based on multi-dimensional test cases; wherein the target fuzzing test case is a test case selected from a certain dimension of the multi-dimensional test cases; disassembling the binary file of the UTC program under test using a disassembler to obtain the assembly code of the UTC program under test; monitoring the assembly code by calling a monitoring interface, and determining whether program defects are found in the UTC program under test during the execution of the target fuzzing test cases; and, if program defects are found in the UTC program under test, obtaining program defect information and program coverage from the fuzzing of the UTC program under test.

[0011] According to the fuzzing method for aerospace embedded software provided by the present invention, before obtaining the program defect information and program coverage of the aerospace embedded software under test for fuzzing when it is determined that the aerospace embedded software under test has a program defect, the method further includes: continuing to execute the step of disassembling the binary file of the aerospace embedded software under test by a disassembler to obtain the assembly code of the aerospace embedded software under test.

[0012] According to the fuzzing method for aerospace embedded software provided by the present invention, after obtaining the program defect information and program coverage of the aerospace embedded software to be tested by fuzzing, the method further includes: continuing to execute the step of mutating the aerospace software standard test cases in the initial seed pool in different ways according to the target seed pool to obtain a multi-dimensional seed pool.

[0013] According to the fuzzing method for aerospace embedded software provided by the present invention, after obtaining the program defect information and program coverage of the aerospace embedded software to be tested for fuzzing, the method further includes: if it is determined that the program coverage is less than a preset coverage, continuing to execute the step of determining the target fuzzing test case based on the multi-dimensional test case; wherein the dimensions of the target fuzzing test case determined each time are different.

[0014] According to the present invention, a fuzz testing method for aerospace embedded software generates a defect fuzz test report for aerospace embedded software based on program defect information and program coverage. The method includes: verifying the program defect information; if the program defect information is found to be free of defects, continuing to execute the step of obtaining multi-dimensional test cases for aerospace embedded software; if the program defect information is found to contain defects, deduplicating and extracting the program defect information to obtain target program defect information; and generating the defect fuzz test report for aerospace embedded software based on the target program defect information and the program coverage.

[0015] This invention also provides a fuzz testing device for aerospace embedded software, comprising the following modules: The test case acquisition module is used to acquire multi-dimensional test cases for aerospace embedded software. These multi-dimensional test cases are determined by the test case generator based on the software protocol text for aerospace embedded software, and the multi-dimensional test cases corresponding to different software protocol texts for aerospace embedded software are different. The fuzzing module is used to perform fuzzing tests on the aerospace embedded software program under test by executing multi-dimensional test cases, so as to obtain program defect information and program coverage. The report generation module is used to generate defect fuzz test reports for aerospace embedded software based on program defect information and program coverage.

[0016] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement any of the above-described fuzz testing methods for aerospace embedded software.

[0017] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements any of the above-described fuzz testing methods for aerospace embedded software.

[0018] The present invention also provides a computer program product, including a computer program that, when executed by a processor, implements any of the above-described fuzz testing methods for aerospace embedded software.

[0019] This invention provides a fuzzing method, apparatus, and electronic device for aerospace embedded software. It acquires multi-dimensional test cases for the aerospace embedded software; these multi-dimensional test cases are determined by a test case generator based on the software protocol text of the aerospace embedded software, and different software protocol texts for aerospace embedded software correspond to different multi-dimensional test cases. By executing these multi-dimensional test cases, fuzzing is performed on the aerospace embedded software program under test, obtaining program defect information and program coverage. A defect fuzzing report for the aerospace embedded software is generated based on the program defect information and program coverage. The technical solution of this invention addresses the problem that existing technologies, such as AFL (Automatic Fuzzing Tool), which is a security-oriented fuzzing tool, collect program runtime information through source code instrumentation, resulting in low overhead and good performance. AFL receives input in file format and then uses file-based mutation methods. However, aerospace embedded software, limited by its operating environment, cannot use source code instrumentation for program information collection. Furthermore, aerospace embedded software can receive input not only through files but also through communication protocols from other programs or devices. Communication protocols are numerous and complex in design. Fuzzing tools must not only adhere to the semantic and state constraints stipulated in the protocol, but also generate inputs from multiple testing perspectives to detect whether test cases violate various security attributes in the communication process. Therefore, existing AFL fuzzing tools are ill-suited to the input patterns of aerospace embedded software. A solution is needed to perform multi-dimensional segmentation of aerospace embedded software, conduct fuzzing tests on the aerospace embedded software under test based on the obtained multi-dimensional test cases, and obtain program defect information and program coverage. Based on the program defect information and program coverage, a defect fuzzing report for aerospace embedded software will be generated, improving the efficiency of fuzzing for aerospace embedded software. The defect fuzzing report will effectively help improve the stability and reliability of aerospace embedded software, providing strong support for defect repair. Attached Figure Description

[0020] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0021] Figure 1 This is one of the flowcharts of the fuzz testing method for aerospace embedded software provided by the present invention.

[0022] Figure 2 This is the second flowchart of the fuzz testing method for aerospace embedded software provided by the present invention.

[0023] Figure 3 This is the third flowchart of the fuzz testing method for aerospace embedded software provided by this invention.

[0024] Figure 4 This is the fourth flowchart of the fuzz testing method for aerospace embedded software provided by this invention.

[0025] Figure 5 This is the fifth flowchart of the fuzz testing method for aerospace embedded software provided by the present invention.

[0026] Figure 6 This is the sixth flowchart of the fuzz testing method for aerospace embedded software provided by this invention.

[0027] Figure 7 This is a schematic diagram of the fuzzy testing device for aerospace embedded software provided by the present invention.

[0028] Figure 8 This is a schematic diagram of the structure of the electronic device provided by the present invention. Detailed Implementation

[0029] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.

[0030] The following is combined with Figures 1-6 This invention describes a fuzz testing method for aerospace embedded software. This method is applicable to multi-dimensional automated fuzz testing of aerospace embedded software. The execution subject of this method can be an electronic device or a fuzz testing device for aerospace embedded software installed in the electronic device. The fuzz testing device for aerospace embedded software can be implemented through software, hardware, or a combination of both. Figure 1 This is one of the flowcharts illustrating the fuzz testing method for aerospace embedded software provided by this invention, such as... Figure 1 As shown, the method includes the following steps 101, 102 and 103.

[0031] Step 101: Obtain multi-dimensional test cases for aerospace embedded software.

[0032] In this step, the multi-dimensional test cases are determined by the test case generator based on the software protocol text for aerospace embedded software. Different software protocol texts for aerospace embedded software correspond to different multi-dimensional test cases, and the multi-dimensional test cases are multi-dimensional. This embodiment does not limit this.

[0033] The test case generator is a tool for generating multi-dimensional test cases. The software protocol text refers to code information, software compilation logic information, etc., for aerospace embedded software. This embodiment does not limit this.

[0034] Specifically, for aerospace embedded software, the software protocol text for aerospace embedded software is obtained, and multi-dimensional test cases are obtained based on the software protocol text for aerospace embedded software and the test case generator.

[0035] In one specific embodiment, obtaining multi-dimensional test cases for aerospace embedded software includes: obtaining protocol text for aerospace embedded software; generating a protocol model based on the protocol text; obtaining an initial seed pool and a target seed pool; wherein the initial seed pool includes standard test cases for aerospace software, and the target seed pool is a multi-dimensional seed pool; mutating the standard test cases for aerospace software in the initial seed pool in different ways according to the target seed pool to obtain a multi-dimensional seed pool; optimizing the multi-dimensional seed pool according to the protocol model to obtain a target multi-dimensional seed pool; and encapsulating the target multi-dimensional seed pool to obtain the multi-dimensional test cases.

[0036] In this step, the protocol model is specifically used to assist the test case generator in generating multi-dimensional test cases. The test case generator has an initial seed pool, which stores standard test cases for aerospace software.

[0037] The target seed pool in the test case generator is a seed pool with three dimensions maintained internally by the test case generator. For example, the three dimensions are instruction parameters, injected data, and instruction timing. The initial seed pool is mutated in different ways and stored in the seed pool of the three dimensions, thus recognizing a multi-dimensional seed pool. This embodiment does not limit this.

[0038] Specifically, Figure 2 This is the second flowchart of the fuzz testing method for aerospace embedded software provided by the present invention, as shown below. Figure 2 As shown, obtaining multi-dimensional test cases for aerospace embedded software specifically includes the following steps 201, 202, 203, 204, 205, and 206.

[0039] 201. Obtain the protocol text for aerospace embedded software.

[0040] 202. Generate a protocol model based on the protocol text; 203. Obtain the initial seed pool and the target seed pool.

[0041] 204. Based on the target seed pool, the aerospace software standard test cases in the initial seed pool are mutated in different ways to obtain a multi-dimensional seed pool.

[0042] 205. Optimize the multi-dimensional seed pool according to the protocol model to obtain the target multi-dimensional seed pool.

[0043] 206. The target multi-dimensional seed pool is encapsulated by a protocol encapsulator to obtain multi-dimensional test cases.

[0044] In one specific embodiment, the target multi-dimensional seed pool is encapsulated to obtain multi-dimensional test cases, including: encapsulating the target multi-dimensional seed pool to obtain initial multi-dimensional test cases; adding a valid protocol header to the initial multi-dimensional test cases to obtain candidate multi-dimensional test cases; and recalculating the checksum of the candidate multi-dimensional test cases to obtain multi-dimensional test cases.

[0045] In this step, the addition of a valid protocol header and the calculation of the checksum can be performed, for example, by using a protocol controller peripheral chip. This embodiment does not limit this to the following.

[0046] Specifically, Figure 3 This is the third flowchart of the fuzz testing method for aerospace embedded software provided by this invention, as shown below. Figure 3 As shown, the multi-dimensional seed pool of the target is encapsulated to obtain multi-dimensional test cases, which specifically includes the following steps 301, 302 and 303.

[0047] Step 301: Encapsulate the target multi-dimensional seed pool to obtain initial multi-dimensional test cases.

[0048] Step 302: Add a valid protocol header to the initial multi-dimensional test cases to obtain candidate multi-dimensional test cases.

[0049] Specifically, after obtaining the initial multi-dimensional test cases, new valid protocol headers are added to the initial multi-dimensional test cases according to the protocol controller peripheral chip, thereby obtaining candidate multi-dimensional test cases.

[0050] Step 303: Recalculate the checksum for the candidate multi-dimensional test cases to obtain the multi-dimensional test cases.

[0051] Specifically, after obtaining candidate multi-dimensional test cases, the checksum of the candidate multi-dimensional test cases is recalculated according to the protocol controller peripheral chip to obtain the multi-dimensional test cases.

[0052] Step 102: Perform fuzz testing on the aerospace embedded software program under test by executing multi-dimensional test cases to obtain program defect information and program coverage.

[0053] In this step, when executing multi-dimensional test cases, it can be done through a test controller, such as the VTest controller. The VTest controller is mainly responsible for calling the simulator core and executing multi-dimensional test cases through the simulator core. This embodiment does not limit this.

[0054] Specifically, after obtaining the multi-dimensional test cases, the simulator core is called based on the VTest controller, and then the multi-dimensional test cases are executed through the simulator core. By executing the multi-dimensional test cases, fuzz testing is performed on the aerospace embedded software program under test, which is aimed at aerospace embedded software, to obtain program defect information and program coverage.

[0055] In one specific embodiment, fuzz testing of the aerospace embedded software under test (APT) is performed by executing multi-dimensional test cases to obtain program defect information and program coverage. This includes: determining target fuzz test cases based on the multi-dimensional test cases; wherein the target fuzz test case is a test case selected from a specific dimension of the multi-dimensional test cases; disassembling the binary file of the APT using a disassembler to obtain the assembly code of the APT; monitoring the assembly code by calling a monitoring interface, and determining whether program defects are found in the APT during the execution of the target fuzz test cases; and, if program defects are determined to exist in the APT, obtaining program defect information and program coverage from the fuzz testing of the APT.

[0056] Specifically, Figure 4 This is the fourth flowchart of the fuzz testing method for aerospace embedded software provided by this invention, as shown below. Figure 4 As shown, fuzz testing of the aerospace embedded software program under test is performed by executing multi-dimensional test cases to obtain program defect information and program coverage. Specifically, this includes the following steps 401, 402, 403 and 404.

[0057] Step 401: Determine the target fuzzy test cases based on the multi-dimensional test cases.

[0058] Among them, the target fuzzy test case is a test case selected from a multi-dimensional test case for a specific dimension.

[0059] Specifically, a test case of one dimension is randomly selected from the multi-dimensional test cases as the target fuzzy test case.

[0060] Step 402: Disassemble the binary file of the aerospace embedded software test program using a disassembler to obtain the assembly code of the aerospace embedded software test program.

[0061] Specifically, after obtaining the target fuzz test cases, the binary file of the aerospace embedded software test program of the target fuzz test cases can be disassembled by executing the status monitor, thereby obtaining the assembly code of the aerospace embedded software test program.

[0062] Step 403: Monitor the assembly code by calling the monitoring interface, and determine whether program defects are found in the aerospace embedded software under test during the execution of the target fuzz test cases.

[0063] In this step, the monitoring interface can be, for example, an instruction monitoring interface, a memory monitoring interface, etc., and this embodiment does not limit it.

[0064] Specifically, after obtaining the assembly code, the assembly code is monitored by calling the instruction monitoring interface and memory monitoring interface. Based on the information fed back by the instruction monitoring interface and memory monitoring interface, it is determined whether the aerospace embedded software under test has program defects. If it is determined that the aerospace embedded software under test has program defects, step 404 is executed. If it is determined that the aerospace embedded software under test does not have program defects, step 402 is executed, keeping the test cases of the current dimension as the target fuzz test cases. That is, if it is determined that the aerospace embedded software under test has program defects, before obtaining the program defect information and program coverage for fuzz testing of the aerospace embedded software under test, if it is determined that the aerospace embedded software under test does not have program defects, the step of disassembling the binary file of the aerospace embedded software under test using a disassembler to obtain the assembly code of the aerospace embedded software under test continues.

[0065] Step 404: If it is determined that the aerospace embedded software test program has a program defect, obtain the program defect information and program coverage of the aerospace embedded software test program for fuzz testing.

[0066] Specifically, when it is determined that the aerospace embedded software under test has a program defect, the program defect information and program coverage of the aerospace embedded software under test are obtained by performing fuzz testing on the aerospace embedded software.

[0067] In one specific embodiment, after obtaining the program defect information and program coverage of the aerospace embedded software test program for aerospace embedded software under fuzz testing, the method further includes: continuing to return to the execution step of mutating the aerospace software standard test cases in the initial seed pool in different ways according to the target seed pool to obtain a multi-dimensional seed pool.

[0068] Specifically, after obtaining the program defect information and program coverage of the aerospace embedded software to be tested for fuzz testing, the process returns to step 204. Based on the target seed pool, the aerospace software standard test cases in the initial seed pool are mutated in different ways to obtain a multi-dimensional seed pool, and the next round of fuzz testing is started. This embodiment does not limit this process.

[0069] In one specific embodiment, after obtaining the program defect information and program coverage of the aerospace embedded software to be tested for fuzz testing, the method further includes: if it is determined that the program coverage is less than a preset coverage, continuing to return to the step of determining the target fuzz test case based on the multi-dimensional test case; wherein the dimensions of the target fuzz test case determined each time are different.

[0070] In this step, the preset coverage rate can be, for example, the coverage rate of the program set in advance, or the coverage rate of the program obtained in the previous round of fuzz testing. This embodiment does not limit this.

[0071] Specifically, after obtaining the program defect information and program coverage of the aerospace embedded software under test for fuzz testing, it is determined whether the program coverage is less than a preset coverage. If the program coverage is less than the preset coverage, it is determined that the program coverage has not improved. If the program coverage is less than the preset coverage, it is determined that the program coverage has not improved, and the process returns to step 401 to execute the step of determining the target fuzz test cases based on multi-dimensional test cases; wherein, the dimensions of the target fuzz test cases determined in each round are different. If the program coverage is greater than or equal to the preset coverage, the fuzz testing continues to be performed while maintaining the dimensions of the target fuzz test cases determined in the current round, and the process returns to step 204 to determine the target test cases from the initial seed pool for mutation to obtain a multi-dimensional seed pool, and to start the next round of fuzz testing. This embodiment does not limit this step.

[0072] In one specific embodiment, Figure 5 This is the fifth flowchart of the fuzzing method for aerospace embedded software provided by the present invention. It involves performing fuzzing tests on the aerospace embedded software program under test by executing multi-dimensional test cases to obtain program defect information and program coverage. Figure 5 As shown, it also includes steps 501, 502 and 503.

[0073] Step 501: Perform fuzz testing on the aerospace embedded software program under test by executing multi-dimensional test cases to obtain fuzz test results.

[0074] Specifically, fuzz testing is performed on the aerospace embedded software program under test by executing multi-dimensional test cases to obtain fuzz test results. The fuzz test results include the current program coverage and defect testing status of the aerospace embedded software program under test.

[0075] Step 502: Determine whether defects in the aerospace embedded software program under test are found based on the defect test results in the fuzzy test results.

[0076] Specifically, based on the defect test results in the fuzzy test, it is determined whether a defect was found in the aerospace embedded software program under test. If a program defect is found in the aerospace embedded software program under test, step 503 is executed.

[0077] Step 503: If it is determined that the aerospace embedded software under test has a program defect, obtain the program defect information and program coverage.

[0078] Specifically, if a program defect is found in the aerospace embedded software under test, the program defect information is determined based on the defect testing results in the fuzzing test, and the program coverage in the fuzzing test results is output. Furthermore, after obtaining the program defect information and program coverage, and maintaining the dimension of the target fuzzing test cases determined in the current round, the fuzzing test continues to be executed, and the process returns to step 204.

[0079] In one specific embodiment, if it is determined that the aerospace embedded software under test has no program defects, it is determined whether the program coverage in the fuzzing results is less than a preset coverage. If the program coverage is determined to be less than the preset coverage, it is determined that the program coverage has not improved. If the program coverage is determined to be less than the preset coverage, it is determined that the program coverage has not improved, and the process continues to return to step 401 to execute the step of determining the target fuzzing test cases based on multi-dimensional test cases; wherein, the dimensions of the target fuzzing test cases determined in each round are different. If it is determined that the program coverage is greater than or equal to the preset coverage, the fuzzing test continues to be executed while maintaining the dimensions of the target fuzzing test cases determined in the current round, and the process continues to return to step 204 to determine the target test cases from the initial seed pool for mutation to obtain a multi-dimensional seed pool, and to start the next round of fuzzing test. This embodiment does not limit this process.

[0080] Step 103: Generate a defect fuzz test report for aerospace embedded software based on program defect information and program coverage.

[0081] In this step, the defect fuzz test report can be obtained by processing program defect information and program coverage based on the fuzz test controller, and this embodiment does not limit this.

[0082] The fuzz test controller is mainly responsible for automatically generating defect fuzz test reports. That is, it can process the program defect information and program coverage feedback from the status monitor to generate defect fuzz test reports for aerospace embedded software.

[0083] Specifically, after obtaining program defect information and program coverage, a defect fuzz test report for aerospace embedded software is generated based on the program defect information and program coverage, and the defect fuzz test report is visualized.

[0084] In one specific embodiment, the state monitor may further include an information collector and a defect detector. The information collector is used to collect various state information of the aerospace embedded software program under test during fuzzing, such as memory information, function execution information, basic block execution information, variable access status, etc., and feeds this state information back to the defect detector and fuzzing controller. The defect detector is responsible for checking for various defects that may occur during the fuzzing process of the aerospace embedded software program under test. It determines whether a certain type of defect has occurred by combining the information collected from the information collector with the characteristics of the aerospace embedded chip. Currently, it supports detecting defect types such as division by zero, uninitialized access, integer overflow, array out-of-bounds, and data races, but this embodiment does not limit these types.

[0085] In one specific embodiment, generating a defect fuzz test report for aerospace embedded software based on program defect information and program coverage includes: verifying the program defect information; if the program defect information is found to be free of defects, continuing to execute the step of obtaining multi-dimensional test cases for aerospace embedded software; if the program defect information is found to be defective, deduplicating and extracting the program defect information to obtain target program defect information; and generating the defect fuzz test report for aerospace embedded software based on the target program defect information and the program coverage.

[0086] Specifically, Figure 6 This is the sixth flowchart of the fuzz testing method for aerospace embedded software provided by this invention, as shown below. Figure 6 As shown, generating a defect fuzz test report for aerospace embedded software based on program defect information and program coverage specifically includes the following steps 601, 602, and 603.

[0087] Step 601: After obtaining the program defect information and program coverage, verify the program defect information.

[0088] Specifically, after obtaining program defect information and program coverage, the program defect information is verified. If no defects are found, the program coverage is fed back to the test case generator, and the process returns to step 401 to start the next round of fuzz testing. If defects are found, step 602 is executed.

[0089] Step 602: If the program defect information is found to be defective, the program defect information is deduplicated and extracted to obtain the target program defect information.

[0090] Specifically, when verifying that the program defect information is defective, the defective information in the program defect information is deduplicated, and the remaining information after deduplication is extracted to obtain the target program defect information.

[0091] Step 603: Generate a defect fuzz test report for aerospace embedded software based on the target program defect information and program coverage.

[0092] The aforementioned fuzz testing method for aerospace embedded software is a black-box testing method. It does not require providing source code for code instrumentation. Users only need to provide the binary file of the aerospace embedded software program under test and the VTest environment that supports the software to run.

[0093] This invention provides a fuzzing method for aerospace embedded software. It obtains multi-dimensional test cases for the aerospace embedded software. These multi-dimensional test cases are determined by a test case generator based on the software protocol text of the aerospace embedded software; different software protocol texts for aerospace embedded software correspond to different multi-dimensional test cases. By executing these multi-dimensional test cases, fuzzing is performed on the aerospace embedded software program under test, obtaining program defect information and program coverage. A defect fuzzing report for the aerospace embedded software is generated based on the program defect information and program coverage. The technical solution of this invention addresses the limitations of existing technologies. AFL (Automatic Fuzzing Tool) is a security-oriented fuzzing tool that collects program runtime information through source code instrumentation, resulting in low overhead and high performance. AFL receives input in file format and then uses file-based mutation methods. However, aerospace embedded software, due to limitations in its operating environment, cannot use source code instrumentation for program information collection. Furthermore, aerospace embedded software can receive input not only through files but also through communication protocols from other programs or devices. Communication protocols are numerous and complex in design. Fuzzing tools must not only adhere to the semantic and state constraints stipulated in the protocol, but also generate inputs from multiple testing perspectives to detect whether test cases violate various security attributes in the communication process. Therefore, existing AFL fuzzing tools are ill-suited to the input patterns of aerospace embedded software. A solution is needed to perform multi-dimensional segmentation of aerospace embedded software, conduct fuzzing tests on the aerospace embedded software under test based on the obtained multi-dimensional test cases, and obtain program defect information and program coverage. Based on the program defect information and program coverage, a defect fuzzing report for aerospace embedded software will be generated, improving the efficiency of fuzzing for aerospace embedded software. The defect fuzzing report will effectively help improve the stability and reliability of aerospace embedded software, providing strong support for defect repair.

[0094] The fuzz testing device for aerospace embedded software provided by the present invention will be described below. The fuzz testing device for aerospace embedded software described below and the fuzz testing method for aerospace embedded software described above can be referred to and correspond to each other.

[0095] Figure 7 This is a schematic diagram of the fuzz testing device for aerospace embedded software provided by the present invention, with reference to... Figure 7 As shown, the fuzzing device 700 for aerospace embedded software includes: a test case acquisition module 701, a fuzzing module 702, and a report generation module 703; wherein, The test case acquisition module 701 is used to acquire multi-dimensional test cases for aerospace embedded software. The multi-dimensional test cases are determined by the test case generator based on the software protocol text for aerospace embedded software. The multi-dimensional test cases are different for different software protocol texts for aerospace embedded software. The fuzzing module 702 is used to perform fuzzing tests on the aerospace embedded software program under test by executing multi-dimensional test cases, so as to obtain program defect information and program coverage. The report generation module 703 is used to generate a defect fuzz test report for aerospace embedded software based on program defect information and program coverage.

[0096] In one example embodiment, the use case acquisition module 701 is specifically configured to: acquire protocol text for aerospace embedded software; generate a protocol model based on the protocol text; acquire an initial seed pool and a target seed pool; wherein the initial seed pool includes aerospace software standard test cases, and the target seed pool is a multi-dimensional seed pool; mutate the aerospace software standard test cases in the initial seed pool in different ways according to the target seed pool to obtain a multi-dimensional seed pool; optimize the multi-dimensional seed pool according to the protocol model to obtain a target multi-dimensional seed pool; and encapsulate the target multi-dimensional seed pool to obtain the multi-dimensional test cases.

[0097] In one example embodiment, the test case acquisition module 701 encapsulates the target multi-dimensional seed pool to obtain multi-dimensional test cases. Specifically, it is used to: encapsulate the target multi-dimensional seed pool to obtain initial multi-dimensional test cases; add a valid protocol header to the initial multi-dimensional test cases to obtain candidate multi-dimensional test cases; and recalculate the checksum of the candidate multi-dimensional test cases to obtain multi-dimensional test cases.

[0098] In one example embodiment, the fuzzing module 702 is specifically configured to: determine target fuzzing test cases based on multi-dimensional test cases; wherein the target fuzzing test case is a test case for a certain dimension selected from the multi-dimensional test cases; disassemble the binary file of the aerospace embedded software test program for aerospace embedded software using a disassembler to obtain the assembly code of the aerospace embedded software test program; monitor the assembly code by calling a monitoring interface, and determine whether program defects are found in the aerospace embedded software test program during the execution of the target fuzzing test cases; if program defects are found in the aerospace embedded software test program, obtain program defect information and program coverage for fuzzing the aerospace embedded software test program for aerospace embedded software.

[0099] In one example embodiment, the apparatus further includes a step-holding module. The step-holding module is configured to: upon determining that a program defect has occurred in the aerospace embedded software test program, and before obtaining program defect information and program coverage for fuzz testing of the aerospace embedded software test program for aerospace embedded software, continue executing the step of disassembling the binary file of the aerospace embedded software test program for aerospace embedded software using a disassembler to obtain the assembly code of the aerospace embedded software test program.

[0100] In one example embodiment, the device further includes a step return module. The step return module is configured to: after obtaining program defect information and program coverage from fuzz testing of the aerospace embedded software test program for aerospace embedded software, continue to return to the step of mutating the aerospace software standard test cases in the initial seed pool according to the target seed pool in different ways to obtain a multi-dimensional seed pool.

[0101] In one example embodiment, the device further includes a coverage determination module. The coverage determination module is configured to: after obtaining program defect information and program coverage from fuzz testing of the aerospace embedded software program under test for aerospace embedded software, and if it is determined that the program coverage is less than a preset coverage, continue to return to the step of determining target fuzz test cases based on multi-dimensional test cases; wherein the dimensions of the determined target fuzz test cases are different each time.

[0102] In one example embodiment, the report generation module 703 is specifically used for: verifying the program defect information; if the program defect information is found to be free of defects, continuing to execute the step of obtaining multi-dimensional test cases for aerospace embedded software; if the program defect information is found to be defective, deduplicating and extracting the program defect information to obtain target program defect information; and generating the defect fuzz test report for the aerospace embedded software based on the target program defect information and the program coverage.

[0103] The apparatus of this embodiment can be used to execute the method of any embodiment in the side embodiment of the fuzz testing method for aerospace embedded software. Its specific implementation process and technical effects are similar to those in the side embodiment of the fuzz testing method for aerospace embedded software. For details, please refer to the detailed description in the side embodiment of the fuzz testing method for aerospace embedded software, which will not be repeated here.

[0104] Figure 8 This is a schematic diagram of the structure of the electronic device provided by the present invention, such as... Figure 8As shown, the electronic device may include: a processor 810, a communications interface 820, a memory 830, and a communication bus 840, wherein the processor 810, the communications interface 820, and the memory 830 communicate with each other through the communication bus 840. The processor 810 can call logical instructions in the memory 830 to execute a fuzzing method for aerospace embedded software. This method includes: obtaining multi-dimensional test cases for aerospace embedded software; wherein the multi-dimensional test cases are determined by a test case generator based on the software protocol text of the aerospace embedded software, and different software protocol texts for aerospace embedded software correspond to different multi-dimensional test cases; performing fuzzing tests on the aerospace embedded software under test program by executing the multi-dimensional test cases to obtain program defect information and program coverage; and generating a defect fuzzing test report for the aerospace embedded software based on the program defect information and program coverage.

[0105] Furthermore, the logical instructions in the aforementioned memory 830 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0106] On the other hand, the present invention also provides a computer program product, which includes a computer program that can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the fuzzing method for aerospace embedded software provided by the above methods. The method includes: obtaining multi-dimensional test cases for aerospace embedded software; wherein the multi-dimensional test cases are determined by a test case generator based on the software protocol text of the aerospace embedded software, and the multi-dimensional test cases corresponding to different software protocol texts for aerospace embedded software are different; performing fuzzing on the aerospace embedded software under test program by executing the multi-dimensional test cases to obtain program defect information and program coverage; and generating a defect fuzzing report for the aerospace embedded software based on the program defect information and program coverage.

[0107] In another aspect, the present invention also provides a non-transitory computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements a fuzzing method for aerospace embedded software provided by the above methods. This method includes: acquiring multi-dimensional test cases for aerospace embedded software; wherein the multi-dimensional test cases are determined by a test case generator based on software protocol text for aerospace embedded software, and the multi-dimensional test cases corresponding to different software protocol texts for aerospace embedded software are different; performing fuzzing testing on the aerospace embedded software program under test by executing the multi-dimensional test cases to obtain program defect information and program coverage; and generating a defect fuzzing test report for aerospace embedded software based on the program defect information and program coverage.

[0108] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.

[0109] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.

[0110] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A fuzz testing method for aerospace embedded software, characterized in that, include: Obtain multi-dimensional test cases for aerospace embedded software; wherein, the multi-dimensional test cases are determined by the test case generator based on the software protocol text of the aerospace embedded software, and the multi-dimensional test cases corresponding to the software protocol text of different aerospace embedded software are different; By executing the multi-dimensional test cases, fuzz testing is performed on the aerospace embedded software program under test, which is aimed at aerospace embedded software, to obtain program defect information and program coverage. A defect fuzz test report for the aerospace embedded software is generated based on the program defect information and the program coverage.

2. The fuzz testing method for aerospace embedded software according to claim 1, characterized in that, The acquisition of multi-dimensional test cases for aerospace embedded software includes: Obtain the protocol text for the aerospace embedded software; Generate a protocol model based on the protocol text; Obtain an initial seed pool and a target seed pool; wherein the initial seed pool includes aerospace software standard test cases, and the target seed pool is a multi-dimensional seed pool; Based on the target seed pool, the aerospace software standard test cases in the initial seed pool are mutated in different ways to obtain a multi-dimensional seed pool; The multi-dimensional seed pool is optimized according to the protocol model to obtain the target multi-dimensional seed pool; The target multi-dimensional seed pool is encapsulated to obtain the multi-dimensional test cases.

3. The fuzz testing method for aerospace embedded software according to claim 2, characterized in that, The encapsulation of the target multi-dimensional seed pool to obtain the multi-dimensional test cases includes: The target multi-dimensional seed pool is encapsulated to obtain initial multi-dimensional test cases; Add a valid protocol header to the initial multi-dimensional test cases to obtain candidate multi-dimensional test cases; The checksums of the candidate multi-dimensional test cases are recalculated to obtain the multi-dimensional test cases.

4. The fuzz testing method for aerospace embedded software according to claim 2, characterized in that, The process of performing fuzz testing on the aerospace embedded software program under test by executing the multi-dimensional test cases to obtain program defect information and program coverage includes: Target fuzzy test cases are determined based on the multi-dimensional test cases; wherein, the target fuzzy test cases are test cases for a certain dimension selected from the multi-dimensional test cases; The binary file of the aerospace embedded software test program is disassembled using a disassembler to obtain the assembly code of the aerospace embedded software test program. The assembly code is monitored by calling the monitoring interface, and whether program defects are found in the aerospace embedded software test program during the execution of the target fuzz test cases. If a program defect is determined to exist in the aerospace embedded software test program, the program defect information and the program coverage are obtained by performing fuzz testing on the aerospace embedded software test program.

5. The fuzz testing method for aerospace embedded software according to claim 4, characterized in that, Before obtaining the program defect information and program coverage of the aerospace embedded software test program when it is determined that the test program has a program defect, the method further includes: Continue executing the step of disassembling the binary file of the aerospace embedded software test program using a disassembler to obtain the assembly code of the aerospace embedded software test program.

6. The fuzz testing method for aerospace embedded software according to claim 4, characterized in that, After obtaining the program defect information and program coverage from the fuzz testing of the aerospace embedded software under test, the method further includes: Continue by returning to the step of mutating the aerospace software standard test cases in the initial seed pool in different ways according to the target seed pool to obtain a multi-dimensional seed pool.

7. The fuzz testing method for aerospace embedded software according to claim 4, characterized in that, After obtaining the program defect information and program coverage from the fuzz testing of the aerospace embedded software under test, the method further includes: If the program coverage is determined to be less than the preset coverage, the process continues to return to the step of determining the target fuzzy test case based on the multi-dimensional test cases; wherein the dimensions of the target fuzzy test case determined each time are different.

8. The fuzz testing method for aerospace embedded software according to claim 1, characterized in that, The step of generating the defect fuzz test report for the aerospace embedded software based on the program defect information and the program coverage includes: The program defect information is verified; If the program defect information is verified to be free of defects, the process continues to return to the step of obtaining multi-dimensional test cases for aerospace embedded software. If the program defect information is found to be defective, the program defect information is deduplicated and extracted to obtain the target program defect information. A fuzz test report on the defects of the aerospace embedded software is generated based on the target program defect information and the program coverage.

9. A fuzz testing device for aerospace embedded software, characterized in that, include: The test case acquisition module is used to acquire multi-dimensional test cases for aerospace embedded software; wherein, the multi-dimensional test cases are determined by the test case generator based on the software protocol text for aerospace embedded software, and the multi-dimensional test cases corresponding to the software protocol text for different aerospace embedded software are different; The fuzzing module is used to perform fuzzing tests on the aerospace embedded software program under test by executing the multi-dimensional test cases, so as to obtain program defect information and program coverage. The report generation module is used to generate a defect fuzz test report for the aerospace embedded software based on the program defect information and the program coverage.

10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that, When the processor executes the computer program, it implements the fuzz testing method for aerospace embedded software as described in any one of claims 1 to 8.