词条 | Fault injection |
释义 |
In software testing, fault injection is a technique for improving the coverage of a test by introducing faults to test code paths, in particular error handling code paths, that might otherwise rarely be followed. It is often used with stress testing and is widely considered to be an important part of developing robust software.[1] Robustness testing[2] (also known as Syntax Testing, Fuzzing or Fuzz testing) is a type of fault injection commonly used to test for vulnerabilities in communication interfaces such as protocols, command line parameters, or APIs. The propagation of a fault through to an observable failure follows a well defined cycle. When executed, a fault may cause an error, which is an invalid state within a system boundary. An error may cause further errors within the system boundary, therefore each new error acts as a fault, or it may propagate to the system boundary and be observable. When error states are observed at the system boundary they are termed failures. This mechanism is termed the fault-error-failure cycle [3] and is a key mechanism in dependability. HistoryTechnique of fault injection dates back to the 1970s [4] when it was first used to induce faults at a hardware level. This type of fault injection is called Hardware Implemented Fault Injection (HWIFI) and attempts to simulate hardware failures within a system. The first experiments in hardware fault involved nothing more than shorting connections on circuit boards and observing the effect on the system (bridging faults). It was used primarily as a test of the dependability of the hardware system. Later specialised hardware was developed to extend this technique, such as devices to bombard specific areas of a circuit board with heavy radiation. It was soon found that faults could be induced by software techniques and that aspects of this technique could be useful for assessing software systems. Collectively these techniques are known as Software Implemented Fault Injection (SWIFI). Software implemented fault injectionSWIFI techniques for software fault injection can be categorized into two types: compile-time injection and runtime injection. Compile-time injection is an injection technique where source code is modified to inject simulated faults into a system. One method is called mutation testing which changes existing lines of code so that they contain faults. A simple example of this technique could be changinga = a + 1 to a = a – 1 Code mutation produces faults which are very similar to those unintentionally added by programmers. A refinement of code mutation is Code Insertion Fault Injection which adds code, rather than modifying existing code. This is usually done through the use of perturbation functions which are simple functions which take an existing value and perturb it via some logic into another value, for example int pFunc(int value) { return value + 20; } int main(int argc, char * argv[]) { int a = pFunc(aFunction(atoi(argv[1]))); if (a > 20) { /* do something */ } else { /* do something else */ } } In this case pFunc is the perturbation function and it is applied to the return value of the function that has been called introducing a fault into the system. Runtime Injection techniques use a software trigger to inject a fault into a running software system. Faults can be injected via a number of physical methods and triggers can be implemented in a number of ways, such as: Time Based triggers (When the timer reaches a specified time an interrupt is generated and the interrupt handler associated with the timer can inject the fault. ); Interrupt Based Triggers (Hardware exceptions and software trap mechanisms are used to generate an interrupt at a specific place in the system code or on a particular event within the system, for instance access to a specific memory location). Runtime injection techniques can use a number of different techniques to insert faults into a system via a trigger.
These techniques are often based around the debugging facilities provided by computer processor architectures. Protocol software fault injectionComplex software systems, especially multi-vendor distributed systems based on open standards, perform input/output operations to exchange data via stateful, structured exchanges known as "protocols." One kind of fault injection that is particularly useful to test protocol implementations (a type of software code that has the unusual characteristic in that it cannot predict or control its input) is fuzzing. Fuzzing is an especially useful form of Black-box testing since the various invalid inputs that are submitted to the software system do not depend on, and are not created based on knowledge of, the details of the code running inside the system. Fault injection toolsAlthough these types of faults can be injected by hand the possibility of introducing an unintended fault is high, so tools exist to parse a program automatically and insert faults. Research toolsA number of SWIFI Tools have been developed and a selection of these tools is given here. Six commonly used fault injection tools are Ferrari, FTAPE, Doctor, Orchestra, Xception and Grid-FIT.
Commercial tools
Libraries
Fault injection in functional properties or test casesIn contrast to traditional mutation testing where mutant faults are generated and injected into the code description of the model, application of a series of newly defined mutation operators directly to the model properties rather than to the model code has also been investigated.[24] Mutant properties that are generated from the initial properties (or test cases) and validated by the model checker should be considered as new properties that have been missed during the initial verification procedure. Therefore, adding these newly identified properties to the existing list of properties improves the coverage metric of the formal verification and consequently lead to a more reliable design. Application of fault injectionFault injection can take many forms. In the testing of operating systems for example, fault injection is often performed by a driver (kernel-mode software) that intercepts system calls (calls into the kernel) and randomly returning a failure for some of the calls. This type of fault injection is useful for testing low level user mode software. For higher level software, various methods inject faults. In managed code, it is common to use instrumentation. Although fault injection can be undertaken by hand, a number of fault injection tools exist to automate the process of fault injection.[25] Depending on the complexity of the API for the level where faults are injected, fault injection tests often must be carefully designed to minimize the number of false positives. Even a well designed fault injection test can sometimes produce situations that are impossible in the normal operation of the software. For example, imagine there are two API functions, Often, it will be infeasible for the fault injection implementation to keep track of enough state to make the guarantee that the API functions make. In this example, a fault injection test of the above code might hit the assert, whereas this would never happen in normal operation. Fault-injection can be used at testing time, during the execution of test cases.[26] For example, the short-circuit testing algorithm[26] injects exceptions during test suite execution so as to simulate unanticipated errors. This algorithm collects data for verifying two resilience properties. See also{{portal|Software Testing}}
References1. ^J. Voas, "Fault Injection for the Masses," Computer, vol. 30, pp. 129–130, 1997. 2. ^Kaksonen, Rauli. A Functional Method for Assessing Protocol Implementation Security. 2001. 3. ^A. Avizienis, J.-C. Laprie, Brian Randell, and C. Landwehr, "Basic Concepts and Taxonomy of Dependable and Secure Computing," Dependable and Secure Computing, vol. 1, pp. 11–33, 2004. 4. ^J. V. Carreira, D. Costa, and S. J. G, "Fault Injection Spot-Checks Computer System Dependability," IEEE Spectrum, pp. 50–55, 1999. 5. ^Rickard Svenningsson, Jonny Vinter, Henrik Eriksson and Martin Torngren, "MODIFI: A MODel-Implemented Fault Injection Tool,", Lecture Notes in Computer Science, 2010, Volume 6351/2010, 210-222. 6. ^G. A. Kanawati, N. A. Kanawati, and J. A. Abraham, "FERRARI: A Flexible Software-Based Fault and Error Injection System," IEEE Transactions on Computers, vol. 44, pp. 248, 1995. 7. ^T. Tsai and R. Iyer, "FTAPE: A Fault Injection Tool to Measure Fault Tolerance," presented at Computing in aerospace, San Antonio; TX, 1995. 8. ^S. Han, K. G. Shin, and H. A. Rosenberg, "DOCTOR: An IntegrateD SOftware Fault InjeCTiOn EnviRonment for Distributed Real-time Systems," presented at International Computer Performance and Dependability Symposium, Erlangen; Germany, 1995. 9. ^S. Dawson, F. Jahanian, and T. Mitton, "ORCHESTRA: A Probing and Fault Injection Environment for Testing Protocol Implementations," presented at International Computer Performance and Dependability Symposium, Urbana-Champaign, USA, 1996. 10. ^J. V. Carreira, D. Costa, and S. J. G, "Fault Injection Spot-Checks Computer System Dependability," IEEE Spectrum, pp. 50–55, 1999. 11. ^Grid-FIT Web-site {{webarchive |url=https://web.archive.org/web/20080202042029/http://wiki.grid-fit.org/ |date=2 February 2008 }} 12. ^N. Looker, B. Gwynne, J. Xu, and M. Munro, "An Ontology-Based Approach for Determining the Dependability of Service-Oriented Architectures," in the proceedings of the 10th IEEE International Workshop on Object-oriented Real-time Dependable Systems, USA, 2005. 13. ^N. Looker, M. Munro, and J. Xu, "A Comparison of Network Level Fault Injection with Code Insertion," in the proceedings of the 29th IEEE International Computer Software and Applications Conference, Scotland, 2005. 14. ^LFI Website 15. ^beSTORM product information 16. ^ExhaustiF SWIFI Tool Site 17. ^Holodeck product overview {{webarchive |url=https://web.archive.org/web/20081013052429/http://www.securityinnovation.com/holodeck/index.shtml |date=13 October 2008 }} 18. ^Codenomicon Defensics product overview 19. ^Kaksonen, Rauli. A Functional Method for Assessing Protocol Implementation Security. 2001. 20. ^Mu Service Analyzer 21. ^Mu Dynamics, Inc. 22. ^Xception Web Site 23. ^Critical Software SA 24. ^Mutant Fault Injection in Functional Properties of a Model to Improve Coverage Metrics, A. Abbasinasab, M. Mohammadi, S. Mohammadi, S. Yanushkevich, M. Smith, 14th IEEE Conference Digital System Design (DSD), pp. 422-425, 2011 25. ^N. Looker, M. Munro, and J. Xu, "Simulating Errors in Web Services," International Journal of Simulation Systems, Science & Technology, vol. 5, 2004. 26. ^1 {{cite journal|last1=Cornu|first1=Benoit|last2=Seinturier|first2=Lionel|last3=Monperrus|first3=Martin|title=Exception handling analysis and transformation using fault injection: Study of resilience against unanticipated exceptions|journal=Information and Software Technology|volume=57|year=2015|pages=66–76|doi=10.1016/j.infsof.2014.08.004|url=https://hal.archives-ouvertes.fr/hal-01062969/document|citeseerx=10.1.1.670.3667}} External links
1 : Software testing |
随便看 |
|
开放百科全书收录14589846条英语、德语、日语等多语种百科知识,基本涵盖了大多数领域的百科知识,是一部内容自由、开放的电子版国际百科全书。