White Box Testing The Role of Structural Testing
White Box Testing The Role of Structural Testing on Software Development
Testing Techniques – Reviewing… z Functional – Black Box Testing y Test cases are based on the requirements or specification x. Considers only inputs and outputs y May miss important aspects of the implementation z Structural – White Box Testing y Test cases are based on the implementation x. Considers internal logic paths, program states, intermediate data structures, … y May miss important aspects of the requirements x. Does not check missing functionality
Testing Techniques – Reviewing… z Black Box vs. White Box Testing
Testing Techniques – Reviewing… z Functional & Structural Testing y Complementary techniques x. Reveal distinct classes of errors The question is not which of them to use but how to explore their complementary aspects. z Partitioning Equivalence y Functional Testing x. We have focused on the specification and requirements of the Genealogy System, even before its implementation
Why White Box Testing? z If only the functional technique is used. . . y May be difficult to measure the testing activity x. It is not possible to ensure that certain essential parts of the program have been exercised x. Errors can be “hidden” in pieces of code which are infrequently executed x. Control flow cannot be accurately predicted in functional testing y Specifications are, in general, incomplete x. So. . . The test sets created from them can also be incomplete
White Box Testing z Procedural-Oriented Design y Assumes that errors are in the control structure of the program or in the data paths y Generates test cases to test control paths through the code y Control Flow criteria x. Execute as many statements as possible x. Coverage can be: • All-Nodes: each statement executed at least once • All-Edges: each decision (branch) executed at least once • All-Paths: each path in control flow graph executed at least once Even for small programs, Control Flow testing is not effective for revealing even trivial faults.
White Box Testing z Procedural-Oriented Design y Data Flow criteria x. Require the interactions between variable definitions and variable uses be exercised • Assignment of values to variables • Use of variables x. Coverage can be: • • All definitions: each definition to some reachable use All uses: definition to each reachable use All def-uses: each definition to each reachable use. . . z What does it all mean? Does coverage guarantee absence of faults? Can we always get 100% coverage?
White Box Testing z Extensions for White Box Testing y Integration testing of procedural programs y Unit and integration testing of object-oriented programs x. Some OO features impose new issues to be faced when testing an OO system
- Slides: 8