White-box testing
White-box testing – sometimes termed clear-box, glass-box, or structural testing – is a software testing methodology in which the tester has full visibility into the internal workings of the system under test.
Unlike black-box testing, which treats the system as an opaque unit, white-box testing involves analyzing how the system processes a given input at the code level. The tests trace execution paths, evaluate logic branches, and verify that internal operations produce the expected output.
Because testers must read and reason about the source code directly, a degree of programming knowledge is a prerequisite for this approach to testing.
A central concept in white-box testing is [path coverage], which aims to ensure that every possible execution path through the code is exercised at least once during testing. Achieving full path coverage helps uncover latent bugs in rarely-executed branches that might otherwise go undetected.
Other coverage criteria commonly associated with white-box testing include [statement coverage], [branch coverage], and [condition coverage], each representing a different level of thoroughness.
White-box testing is particularly valuable during unit testing and security auditing, where understanding internal logic is essential.