Black Box Testing
What it is: Testing the application without knowledge of its internal code or structure. The tester only sees inputs and outputs.
Focus: Functionality, not implementation.
Key points:
- Based on requirements and specifications
- No need to read or understand the source code
- Common techniques: equivalence partitioning, boundary value analysis, decision tables
- Often performed by QA engineers or end users
Use it when:
- Validating user-facing features against requirements
- Running acceptance testing (UAT)
- Testing third-party APIs or services with no code access
- You want unbiased testing, free from implementation assumptions
White Box Testing
What it is: Testing with full knowledge of the internal code, logic, and structure.
Focus: Internal logic, paths, and code quality.
Key points:
- Requires access to source code
- Common techniques: statement coverage, branch coverage, path coverage
- Typically performed by developers
- Tools: unit testing frameworks (JUnit, pytest, Jest), code coverage tools
Use it when:
- Writing unit tests
- Checking edge cases inside complex logic
- Verifying all code paths are covered
- Refactoring code and need confidence nothing broke
Gray Box Testing
What it is: A mix of both. The tester has partial knowledge of internals (e.g., database schema, API structure) but tests mostly from a user perspective.
Focus: Integration points and behavior with some internal context.
Key points:
- Bridges the gap between dev and QA
- Useful for testing data flow and integration
- Common in security testing (penetration testing) and integration testing
Use it when:
- Testing integration between modules or services
- You need realistic testing but some internal context speeds things up
Quick Comparison
| Aspect | Black Box | White Box | Gray Box |
|---|---|---|---|
| Code knowledge | None | Full | Partial |
| Performed by | QA / users | Developers | QA + some dev knowledge |
| Test basis | Requirements | Code structure | Both |
| Best for | Functional / acceptance testing | Unit testing | Integration / security testing |
Black box → „Does it work as expected?“
White box → „Is the code itself correct and well-tested?“
Gray box → „Does it work correctly given what I know about how it’s built?“

Hinterlasse einen Kommentar