White-box testing (a.k.a. clear box testing, glass box testing, transparent box testing, or structural testing) is a method of testing software that tests internal structures or workings of an application, as opposed to its functionality (i.e. black-box testing). In white-box testing an internal perspective of the system, as well as programming skills, are required and used to design test cases. The tester chooses inputs to exercise paths through the code and determine the appropriate outputs. This is analogous to testing nodes in a circuit, e.g. in-circuit testing(ICT).
While white-box testing can be applied at the unit, integration and system levels of the software testing process, it is usually done at the unit level. It can test paths within a unit, paths between units during integration, and between subsystems during a system level test. Though this method of test design can uncover many errors or problems, it might not detect unimplemented parts of the specification or missing requirements.
White-box test design techniques include:
Control flow testing
Control-flow testing is a structural testing strategy that uses the program’s control flow as a model.
Control-flow testing techniques are based on judiciously selecting a set of test paths through the program.
The set of paths chosen is used to achieve a certain measure of testing thoroughness.
E.g., pick enough paths to assure that every source statement is executed as least once.
Control-flow testing is most applicable to new software for unit testing.
Control-flow testing assumptions:
specifications are correct
data is defined and accessed properly
there are no bugs other than those that affect control flow
Structured and OO languages reduce the number of control-flow bugs.
Control Flowgraphs
The control flowgraph is a graphical representation of a program’s control structure.
Flowgraphs Consist of Three Primitives
A decision is a program point at which the control can diverge.
(e.g., if and case statements).
A junction is a program point where the control flow can merge.
(e.g., end if, end loop, goto label)
A process block is a sequence of program statements uninterrupted by either decisions or junctions. (i.e., straight-line code).
A process has one entry and one exit.
A program does not jump into or out of a process.
Data flow testing
Branch testing
Path testing
No comments:
Post a Comment