White‐Box Testing

Thomas J. Ostrand · Encyclopedia of Software Engineering · 2002

Abstract White‐box testing refers to test methods that rely on the internal structure of the software. White‐box methods are based on executing or “covering” specific elements of the code. The essential rationale for these methods is that it is impossible to detect a fault in some piece of code by testing if that code is never executed. The ideal would be to test every part of the code in every way that it could be executed during actual operation of the system. Since this ideal is achievable only for very simple programs with finite input domains, each white‐box method identifies some specific code characteristic or type of code element that should be tested. A white‐box approach can be used either to generate test cases or to measure the extent to which a given set of test cases covers all the code elements identified by the approach. When a method is used to measure coverage, it is called an adequacy criterion . In practice, the white‐box methods are used primarily for measuring the adequacy of test sets that have been derived by black‐box methods. Only near the end of the testing cycle are the white‐box approaches used to help generate the small number of additional tests needed to satisfy a criterion. The simpler white‐box methods require single elements in the program to be executed. These methods include statement and branch coverage, which were the earliest, and are still the most commonly used, white‐box methods. Tools to monitor the coverage of statements and branches for popular programming languages have been available since the 1970s. The more complex methods require sequences of elements to be executed. These include various types of path coverage and the data flow methods.

Read the paper · More papers on PaperTik