Black Box, White Box and Test Design Techniques
Black Box Testing
Test behaviour without seeing code: give inputs, check outputs. Techniques below are all black box.
White Box Testing
Test with code knowledge: statement, branch and path coverage. Used in unit testing and code reviews.
Gray Box Testing
Partial knowledge: test APIs and database states while treating UI as a black box. Typical for QA engineers.
Equivalence Partitioning
Divide inputs into valid/invalid groups and test one value per group. Age 18-60: test 25 (valid), 10 and 70 (invalid).
Boundary Value Analysis
Bugs live at edges: for range 18-60 test 17, 18, 19, 59, 60, 61.
Decision Table Testing
Map combinations of conditions to actions. Login with valid/invalid username x valid/invalid password gives 4 rules and expected messages.
State Transition Testing
Test valid and invalid moves between states: order New to Paid to Shipped; Paid back to New must be rejected.
Use Case, Error Guessing, Pairwise
- Use case testing - walk the actor steps end to end.
- Error guessing - use experience: empty fields, special characters, huge files.
- Pairwise - cover all pairs of parameter values with few cases (browser x OS x role).
- Black box needs no code; white box needs coverage tools.
- Boundaries plus partitions catch most input bugs.
- Combine techniques: partitions select values, tables cover logic.