Black Box, White Box, and Grey Box Testing
Black box testing
Section titled “Black box testing”You test the system by inputs/outputs without knowing internal code.
Examples:
- UI testing
- API testing
- acceptance tests
White box testing
Section titled “White box testing”You test with knowledge of internal implementation.
Examples:
- unit tests
- branch/condition coverage
- code-level edge cases
Grey box testing
Section titled “Grey box testing”You have partial knowledge of internals.
Examples:
- API tests with DB knowledge
- testing with logs/metrics
Diagram
Section titled “Diagram”graph LR A["Black box\n(No internals)"] --> B["Grey box\n(Some internals)"] --> C["White box\n(Full internals)"]
When to use what
Section titled “When to use what”- Black box: verify user-visible behavior
- White box: verify correctness and edge cases
- Grey box: efficient end-to-end checks
pch.coffeeTagline
pch.coffeeCtapch.feedbackHeading
pch.feedbackSubheading