Embedded software fault injection method and device

Through the use of digital virtual technology and DLL, the problem of failure data injection in embedded software testing is solved, fault injection in hardware-free environment is realized, testing effectiveness and efficiency are improved, and it is especially suitable for closed-loop solution type software.

CN114676059BActive Publication Date: 2024-12-10THE GENERAL DESIGNING INST OF HUBEI SPACE TECH ACAD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210332509.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-30
Publication Date
2024-12-10
Estimated Expiration
2042-03-30

AI Technical Summary

Technical Problem

In embedded software testing, due to hardware interface limitations, it is difficult to inject fault data in the designed failure mode, especially the fault data construction of closed-loop solution type software is more difficult, which affects the effectiveness of the test work.

Method used

Using digital virtual technology to build an embedded software operation platform and data interface suite, the correspondence between communication protocol and physical quantity is realized through DLL, allowing fault injection in a hardware environment without embedded system, and using data DLL and control DLL to control the physical quantity in the environment to realize Fault injection.

Benefits of technology

Without modifying the source program of the software being tested, the fault parameters and types are flexibly injected, which improves the effectiveness and efficiency of embedded software testing and supports simulation solution of closed-loop solution type software.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114676059B_ABST
    Figure CN114676059B_ABST
Patent Text Reader

Abstract

The present invention discloses an embedded software fault injection method and device, and relates to the field of embedded software testing. The method includes constructing an embedded software digital operation platform, and constructing a data interface suite; creating a corresponding relationship between the communication protocol of the interface and the physical quantity in the data interface suite, and decomposing the data in the communication protocol into the corresponding physical quantity; creating a data DLL and a control DLL, wherein the data DLL is used to store normal external excitations of the embedded software, and the output is associated with the physical quantity in the data interface suite, and for the embedded software of the closed-loop solution type; the control DLL obtains normal external excitations or standard solution data from the data interface suite, and superimposes error data or replaces it with error data based on test needs to realize test fault injection. The present invention can ensure the effectiveness of embedded software testing work.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of embedded software testing, and in particular to an embedded software fault injection method and device. Background Art

[0002] Effective software testing is an important means to improve software quality. Fault injection technology, as a method that can accelerate system failure, can accurately obtain parameters such as system test coverage and error latency, and has been widely used in software testing. By monitoring and analyzing the process of accelerating system failure and failure after injecting faults, the cycle of obtaining test results for the reliability and fault tolerance characteristics of the tested software can be greatly shortened. Therefore, fault injection technology plays an important role in improving software quality, reducing software hazards, and improving the software development process.

[0003] Since embedded software is closely integrated with hardware when implementing the designed functions, when carrying out testing, testers are restricted by the hardware interface and are often unable to fully inject fault data according to the designed failure mode. Especially for some closed-loop solving type embedded software, it is more difficult to construct relevant fault data. Therefore, there is an urgent need for an embedded software fault injection method that can flexibly carry out embedded software testing. Summary of the invention

[0004] In view of the defects existing in the prior art, the purpose of the present invention is to provide an embedded software fault injection method and device, which can ensure the effectiveness of embedded software testing work.

[0005] To achieve the above objectives, the present invention provides an embedded software fault injection method, which specifically includes the following steps:

[0006] Constructing an embedded software digital operation platform for running the embedded software to be tested, and constructing a data interface kit for data interaction with the embedded software to be tested;

[0007] Create a corresponding relationship between the communication protocol of the interface and the physical quantity in the data interface suite, decompose the data in the communication protocol into the corresponding physical quantity, or package the physical quantity into a communication protocol and send it to the embedded software to be tested;

[0008] Create a data DLL and a control DLL, wherein the data DLL is used to store normal external excitations of the embedded software, and the output is associated with the physical quantity in the data interface kit, and for the embedded software of the closed-loop solution type, the data DLL is used to perform closed-loop simulation solution, the input is the solution control quantity, and the output is the standard solution data;

[0009] The control DLL obtains normal external excitation or standard solution data from the data interface kit, and superimposes error data or replaces it with erroneous data based on test needs to achieve test fault injection.

[0010] Based on the above technical solutions,

[0011] The embedded software digital operation platform is a virtualization of the embedded software operation hardware platform;

[0012] The embedded software digital operation platform includes a digital processor and a digital communication chip.

[0013] On the basis of the above technical solution, the data interface suite includes multiple communication protocols and multiple physical quantities, and the data interface suite describes the corresponding relationship between the communication protocols and the physical quantities.

[0014] On the basis of the above technical solution, the embedded software to be tested is a closed-loop solution type embedded software or an open-loop control type embedded software.

[0015] The present invention provides an embedded software fault injection device, comprising:

[0016] An embedded software digital operation platform, which is used to run the embedded software to be tested and to build a data interface kit for data interaction with the embedded software to be tested;

[0017] A data interface kit, which is used to perform data interaction with the embedded software to be tested, wherein the data interface kit creates a correspondence between the communication protocol of the interface and the physical quantity, decomposes the data in the communication protocol into the corresponding physical quantity, or packages the physical quantity into the communication protocol and sends it to the embedded software to be tested;

[0018] Data DLL, which is used to store normal external excitations of embedded software, and the output is associated with the physical quantity in the data interface kit, and for closed-loop solution type embedded software, the data DLL is used to perform closed-loop simulation solution, the input is the solution control quantity, and the output is the standard solution data;

[0019] The control DLL is used to obtain normal external excitation or standard solution data from the data interface kit, and superimpose error data or replace it with erroneous data based on test needs to achieve test fault injection.

[0020] On the basis of the above technical solution, the embedded software to be tested is a closed-loop solution type embedded software or an open-loop control type embedded software.

[0021] Compared with the prior art, the advantages of the present invention are: the hardware platform for embedded software operation is digitally realized by using digital virtual technology, and the fault injection function of embedded software can be flexibly realized by using communication protocol without the hardware environment of embedded system, and the change of the value of environmental physical quantity in the process of embedded software operation is controlled by using data DLL and control DLL, and the data, operation and solution model are decoupled, so as to inject fault parameters and types into the embedded software under test in a more flexible way. At the same time, the source program of the software under test does not need to be modified during the embedded software testing process, and the effectiveness of the embedded software testing work is guaranteed to the greatest extent. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0023] Figure 1 This is a flow chart of an embedded software fault injection method according to an embodiment of the present invention;

[0024] Figure 2 It is a structural schematic diagram of an embedded software fault injection device in an embodiment of the present invention. DETAILED DESCRIPTION

[0025] The embodiment of the present invention provides an embedded software fault injection method, which can conveniently observe the input and output of the system and evaluate the robustness and reliability of the system, and ultimately avoid software failure and loss in practical applications. The embodiment of the present invention also provides an embedded software fault injection device accordingly.

[0026] In order to make the purpose, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below in combination with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments.

[0027] See also Figure 1 As shown, an embodiment of the present invention provides an embedded software fault injection method, which specifically includes the following steps:

[0028] S1: Build an embedded software digital operation platform for running the embedded software to be tested, and build a data interface kit for data interaction with the embedded software to be tested;

[0029] In the embodiment of the present invention, the embedded software digital operation platform is a virtualization of the embedded software operation hardware platform; the embedded software digital operation platform includes a digital processor and a digital communication chip. The embedded software to be tested is a closed-loop solution type embedded software or an open-loop control type embedded software.

[0030] S2: Create a correspondence between the communication protocol of the interface and the physical quantity in the data interface suite, decompose the data in the communication protocol into corresponding physical quantities, or package the physical quantities into a communication protocol and send it to the embedded software to be tested.

[0031] In the embodiment of the present invention, the data interface suite includes multiple communication protocols and multiple physical quantities, and the data interface suite describes the corresponding relationship between the communication protocols and the physical quantities.

[0032] S3: Create data DLL (Dynamic Link Library) and control DLL. The data DLL is used to store normal external excitations of embedded software, and the output is associated with the physical quantity in the data interface kit. For closed-loop solution type embedded software, the data DLL is used for closed-loop simulation solution, with the input being the solution control quantity and the output being the standard solution data.

[0033] S4: The control DLL obtains normal external excitation or standard solution data from the data interface kit, and superimposes error data or replaces it with erroneous data based on test requirements to implement test fault injection.

[0034] In order to facilitate the control of testers, the present invention uses the error data superposition switch and the error data replacement switch as a physical quantity in the data interface kit, and the tester can modify it immediately. The relevant failure mode is embedded in the control DLL when it is made, which is a direct reflection of the test strategy and test experience.

[0035] The embedded software fault injection method of the present invention uses digital virtual technology to digitally implement the hardware platform on which the embedded software runs, so that in the absence of an embedded system hardware environment, the communication protocol can be used to flexibly implement fault injection on the embedded software; the data DLL and the control DLL are used to control the change of the value of the environmental physical quantity during the operation of the embedded software, decouple the data, operation and solution model, and inject fault parameters and types into the embedded software under test in a more flexible manner. At the same time, the source program of the tested software does not need to be modified during the embedded software testing process, and the effectiveness of the embedded software testing work is guaranteed to the greatest extent; the control DLL is the core of the test fault injection, and the present invention can realize the stimulation of multiple types of faults or customized faults by modifying the control DLL, and quickly realize the reconstruction of certain specific fault scenarios. By accumulating fault types, the control DLL can realize the reuse of functions, thereby improving the efficiency of embedded software testing.

[0036] See also Figure 2 As shown, an embedded software fault injection device provided by an embodiment of the present invention includes an embedded software digital operation platform, a data interface kit, a data DLL and a control DLL.

[0037] The embedded software digital operation platform is used to run the embedded software to be tested, and to build a data interface suite for data interaction with the embedded software to be tested; the data interface suite is used to interact with the embedded software to be tested, and the correspondence between the communication protocol of the interface and the physical quantity is created in the data interface suite, and the data in the communication protocol is decomposed into the corresponding physical quantity, or the physical quantity is packaged into a communication protocol and sent to the embedded software to be tested; the data DLL is used to store normal external excitations of the embedded software, and the output is associated with the physical quantity in the data interface suite, and for the embedded software of the closed-loop solution type, the data DLL is used to perform closed-loop simulation solution, with the input being the solution control quantity and the output being the standard solution data; the control DLL is used to obtain normal external excitations or standard solution data from the data interface suite, and to superimpose error data on it or replace it with erroneous data based on test needs to achieve test fault injection.

[0038] In the embodiment of the present invention, the embedded software digital operation platform is a virtualization of the embedded software operation hardware platform; the embedded software digital operation platform includes a digital processor and a digital communication chip. The data interface kit includes multiple communication protocols and multiple physical quantities, and the corresponding relationship between the communication protocols and the physical quantities is described. The embedded software to be tested is a closed-loop solution type embedded software or an open-loop control type embedded software.

[0039] The embedded software fault injection device of the embodiment of the present invention uses digital virtual technology to digitally implement the hardware platform on which the embedded software runs. Therefore, in the absence of an embedded system hardware environment, the communication protocol can be used to flexibly implement fault injection into the embedded software; the data DLL and the control DLL are used to control the change of the value of the environmental physical quantity during the operation of the embedded software, decouple the data, operation and solution model, and inject fault parameters and types into the embedded software under test in a more flexible manner. At the same time, the source program of the software under test does not need to be modified during the embedded software testing process, which guarantees the effectiveness of the embedded software testing work to the greatest extent.

[0040] The above description is only a specific implementation of the present application, so that those skilled in the art can understand or implement the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest range consistent with the principles and novel features applied for herein.

[0041] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems) and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the process in the flowchart. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

Claims

1. A method for embedded software fault injection, characterized in that: The specific steps include: Constructing an embedded software digital operation platform for running the embedded software to be tested, and constructing a data interface kit for data interaction with the embedded software to be tested; Create a corresponding relationship between the communication protocol of the interface and the physical quantity in the data interface suite, decompose the data in the communication protocol into the corresponding physical quantity, or package the physical quantity into a communication protocol and send it to the embedded software to be tested; Create a data DLL and a control DLL, wherein the data DLL is used to store normal external excitations of the embedded software, and the output is associated with the physical quantity in the data interface kit, and for the embedded software of the closed-loop solution type, the data DLL is used to perform closed-loop simulation solution, the input is the solution control quantity, and the output is the standard solution data; The control DLL obtains normal external excitation or standard solution data from the data interface kit, and superimposes error data or replaces it with erroneous data based on test needs to achieve test fault injection.

2. An embedded software fault injection method as claimed in claim 1, characterized in that: The embedded software digital operation platform is a virtualization of the embedded software operation hardware platform; The embedded software digital operation platform includes a digital processor and a digital communication chip.

3. An embedded software fault injection method as claimed in claim 1, characterized in that: The data interface suite includes multiple communication protocols and multiple physical quantities, and the data interface suite describes the corresponding relationship between the communication protocols and the physical quantities.

4. The method for embedded software fault injection according to claim 1, characterized in that: The embedded software to be tested is a closed-loop solution type embedded software or an open-loop control type embedded software.

5. An embedded software fault injection device, characterized in that: include: An embedded software digital operation platform, which is used to run the embedded software to be tested and to build a data interface kit for data interaction with the embedded software to be tested; A data interface kit, which is used to perform data interaction with the embedded software to be tested, wherein the data interface kit creates a correspondence between the communication protocol of the interface and the physical quantity, decomposes the data in the communication protocol into the corresponding physical quantity, or packages the physical quantity into the communication protocol and sends it to the embedded software to be tested; Data DLL, which is used to store normal external excitations of embedded software, and the output is associated with the physical quantity in the data interface kit, and for closed-loop solution type embedded software, the data DLL is used to perform closed-loop simulation solution, the input is the solution control quantity, and the output is the standard solution data; The control DLL is used to obtain normal external excitation or standard solution data from the data interface kit, and superimpose error data or replace it with erroneous data based on test needs to achieve test fault injection.

6. An embedded software fault injection device as claimed in claim 5, characterized in that: The embedded software to be tested is a closed-loop solution type embedded software or an open-loop control type embedded software.