White box testing designs tests from the internal structure of the code, so you can check that its statements and branches actually run. It suits developers and the code you control. It shows which code no test has touched, but it cannot show that the code does what users need, or that a tested line is tested well.
What do the white box coverage measures count?
The ISTQB syllabus says white-box testing “is structure-based and derives tests from the system’s implementation or internal structure (e.g., code, architecture, work-flows, and data flows)”. NIST words it from the assessor’s side: a methodology that “assumes explicit and substantial knowledge of the internal structure and implementation detail of the assessment object”. The coverage measures below say how much of that structure your tests touched.
| Measure | What it counts | What it misses | Tool example |
|---|---|---|---|
| Statement | Statements the tests executed | An if that was never false still counts as covered |
coverage.py; JaCoCo counts lines and instructions |
| Branch | Branches the tests executed | Defects that need a specific path through the code | JaCoCo branches, coverage.py |
The syllabus says that branch coverage subsumes statement coverage, and that 100% statement coverage does not ensure all the decision logic has been tested. Coverage.py shows the gap between the two: statement coverage can mark every line of a function as executed while the if was never evaluated as false, which only branch coverage flags as a “partial branch”.
How is white box testing different from static testing?
The two answer different questions. White box testing names what the tests are designed from: the code’s structure. Static testing names how the check is done: without running the code, through reviews and analysis tools. The ISTQB syllabus notes that white-box techniques can also be used in static testing, for example in dry runs of code. Our AI code review checklist is an example of static testing.
Who should do white box testing: developers or a QA team?
The ISTQB foundation syllabus names no role for white-box testing. This is our judgement from practice.
- Developers should own it for code they write. They can see the structure and fix the gap in the same change. Unit tests written with test-driven development give you coverage as a side effect, in our experience.
- A QA team adds most when it reads coverage reports as a map of risk, asks why a critical module has gaps and checks that tests assert something. Microsoft’s Azure Well-Architected testing guidance says to “Generate coverage reports to identify gaps in automation.” We would not ask testers to write white box tests for code they cannot read.
- An outside reviewer helps when nobody on the team trusts the numbers. A QA audit and assessment looks at your tests, pipeline and release process and reports what is at risk and what to fix first.
For tools, see our list of unit automation testing tools.
What coverage figure is worth asking for, and what does a high figure not tell you?
We do not recommend one percentage for every product. Ask for these instead.
- Coverage on the code that matters. A figure for the payment module says more than one for the whole repository.
- Branch coverage, not only statement coverage. The coverage.py example above shows why.
- No drop on a change. A rule that coverage may not fall on a pull request is easier to keep than a target.
- Assertions that can fail. A test that runs a line without checking a result raises coverage and proves nothing. Mutation testing checks for this by changing the code and seeing whether tests notice.
A high figure says the lines ran. It does not say the behavior is right, that requirements are met, or that missing features exist. Pair it with black box testing and our guide to automating white and black box tests with Selenium.
What does Zapple.Tech do about it?
If you do not know whether your coverage figure means anything, start with the evidence. Zapple.Tech starts with a one-week QA audit of one product area. It looks at its tests, pipeline and release process, and ends in a written report on what is at risk and what to fix first, plus a pilot plan you can run with Zapple.Tech or without it. Read more on the QA audit and assessment page. Tell us about your product in the form below.
How does white box testing relate to other terms?
- Mutation testing
Mutation testing measures how good a test suite is by making small deliberate changes, called mutants, to the code and running the tests against each one. A failing test kills the mutant; a surviving mutant marks behavior the tests do not check. Unlike code coverage, the mutation score shows whether tests would notice a change, not only which lines ran.
- Test-driven development
Test-driven development (TDD) is a programming workflow in which a developer turns one planned scenario into a failing automated test, writes just enough code to make it pass, optionally refactors, and repeats until the test list is empty. The tests direct the design of the code, so TDD is a way of writing code, not a test phase run afterwards.
- Black box testing
Black box testing checks what software does against its specification, without looking at the code. You give it inputs and compare the outputs with what the requirements say. It suits system and acceptance checks and works for outside teams, but it cannot show you which parts of the code no test has run.
Sources
- ISTQB Certified Tester Foundation Level syllabus v4.0.1, 2024-09-15 (pp. 27-30 and 42-43, read 2026-12-05) (read 5 December 2026)
- NIST CSRC Glossary, White Box Testing, from NIST SP 800-137, September 2011, final; no revision listed (read 2026-12-05) (read 5 December 2026)
- JaCoCo documentation, Coverage counters (read 2026-12-05) (read 5 December 2026)
- Coverage.py 7.18.0 documentation, Branch coverage measurement (read 2026-12-05) (read 5 December 2026)
- Microsoft Learn, Azure Well-Architected Framework, Architecture strategies for testing (updated 2026-11-04, read 2026-12-05) (read 5 December 2026)