October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsClean PCRecommendedOne scan can reveal what keeps slowing WindowsLook for cleanup and repair opportunities.Run ScanOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk2 min

What Is White-Box Testing? Definition, Examples, and Coverage

White-box testing designs tests from a program’s internal structure and processing. See how it differs from black-box testing and how structural coverage is used.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

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.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Example: 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.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

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.

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.

Leave a Reply

Your email address will not be published. Required fields are marked *

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Outdated Drivers Are Slowing You DownFree scan - exact matches
PC Slower Than It Used to Be?Free scan - under a minute

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.