White-Box
White-box testing (logic driven) assumes that the path of logic in a unit or program is known. White-box testing consists of testing paths, branch by branch, to produce predictable results. Multiple white-box testing techniques are listed below. These techniques can be combined as appropriate for the application, but should be limited, as too many techniques can lead to an unmanageable number of test cases.
Statement Coverage Execute all statements at least once.
Decision Coverage Execute each decision direction at least once.
Black-Box
In black-box testing (data or condition driven), the focus is on evaluating the function of a program or application against its currently approved specifications. Specifically, this technique determines whether combinations of inputs and operations produce expected results. As a result, the initial conditions and input data are critical for black-box test cases.
Two successful techniques for managing the amount of input data required include:
Equivalence Partitioning
An equivalence class is a subset of data that represents a larger class. Equivalence partitioning is a technique for testing equivalence classes rather than undertaking exhaustive testing of each value of the larger class. For example, a program which edits credit limits within a given range (at least $10,000 but less than $15,000) would have three equivalence classes:
Less than $10,000 (invalid)
Equal to $10,000 but not as great as $15,000 (valid)
$15,000 or greater (invalid)
Boundary Analysis
This technique consists of developing test cases and data that focus on the input and output boundaries of a given function. In the credit limit example, boundary analysis would test the:
Low boundary plus or minus one ($9,999 and $10,001)
Boundaries ($10,000 and $15,000)
Upper boundary plus or minus one ($14,999 and $15,001)