White-box testing is software testing in which tests are designed using knowledge of the software’s internal structure or processing. Also called structure-based testing, it can help show which parts of an implementation a test suite exercises. It complements black-box testing, which derives tests from specified behavior without relying on the implementation.
What white-box testing means
White-box testing examines a component’s or system’s internal structure or workings when designing tests. NIST’s glossary also lists clear-box, glass-box, transparent-box, and structural testing as related terms. ISTQB commonly uses structure-based testing for this approach.
The key distinction is the basis for test design: the tester uses knowledge of how the software is structured or processes inputs, not only what behavior its specification says to expect. NIST describes the method as assuming explicit and substantial knowledge of the assessment object’s internal structure and implementation details (NIST CSRC glossary; see also NIST SP 800-137).
How it differs from black-box testing
| Aspect | White-box testing | Black-box testing |
|---|---|---|
| Basis for test design | Internal structure and processing | Specified behavior, without reference to internal structure |
| Information used | Knowledge of the implementation or structure being tested | Behavioral specifications and externally observable inputs and outputs |
| What coverage can show | Whether selected structural items, such as statements or decision outcomes, were exercised | Whether selected specified behaviors or requirements were exercised |
These are complementary approaches rather than competing definitions of a test. A test suite can use each to investigate different risks: structural tests can reveal unexercised implementation paths, while behavior-based tests can check the system against its stated expectations. ISTQB explains the distinction in its Foundation Level syllabus.
Do these 3 things before closing this tab:
1Fix the driver behind crashes, sound loss and screen glitches2Clear out junk files and repair common Windows errors3Scan for outdated or missing drivers - takes under a minuteExample: testing both outcomes of a decision
Suppose a function returns one result when an input is greater than a threshold and another when it is not. A structure-based plan can include inputs that make the decision evaluate both ways. Exercising both outcomes is an example of decision coverage.
This demonstrates that the tests reached both outcomes of that decision; it does not show that every possible input was checked, that the threshold is correct, or that all requirements are met.
What structural coverage measures
Coverage criteria specify which structural items a test suite aims to exercise. Examples include:
- Statement coverage: whether the selected executable statements ran during testing.
- Decision coverage: whether each outcome of a decision was exercised.
- Condition coverage: whether the outcomes of individual conditions were exercised.
The percentage depends on the chosen criterion and what is counted. A coverage result can help identify unexercised items and guide additional tests, but it is not a correctness score: even high coverage does not prove the implementation is correct, requirements are complete, or defects are absent. The ISTQB glossary defines these and other testing techniques.
Where white-box testing is used
White-box testing is not limited to unit or component testing. ISO/IEC/IEEE 29119-1:2022 describes structure-based testing as usable at all test levels; one example is checking menu-item coverage during system testing (ISO/IEC/IEEE 29119-1:2022).
Nor is the term a synonym for static analysis. White-box testing describes a basis for designing tests. Static analysis is a separate activity that examines software artifacts without executing them. White-box test cases may be run at different levels, and the definition does not require a particular programming language.
Quick Recap
Best Value
Rank #4
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




