Code-aware testing based on internal structure, logic flows, and execution paths to ensure comprehensive coverage and detect hidden defects.
Structural testing (also known as white-box testing) is based on the internal code structure, logic, and implementation details of a system. Tests are designed by analyzing source code, control flows, data flows, and execution paths. This approach uses code coverage metrics to measure test adequacy and ensures that critical logic branches, loops, and conditions are thoroughly exercised.
| Coverage Type | Description | Typical Target |
|---|---|---|
|
Statement Coverage
|
Measures the percentage of executable statements in the code that have been executed at least once during testing. The most basic coverage metric. | 80-100% |
|
Branch Coverage
|
Ensures that every decision point (if-else, switch-case) has been tested with both true and false outcomes. Stronger than statement coverage. | 70-90% |
|
Path Coverage
|
Tests all possible execution paths through the code, including combinations of branches and loops. Most comprehensive but exponentially complex. | CRITICAL PATHS |
|
Condition Coverage
|
Verifies that each boolean sub-expression in conditions has been evaluated to both true and false. Catches logical errors in compound conditions. | 60-80% |
Review source code, identify control flow graphs, and map decision points, branches, and execution paths.
Define coverage goals (statement, branch, path, condition) based on criticality and risk assessment.
Create test inputs that exercise specific code paths, edge cases, and boundary conditions to maximize coverage.
Use coverage tools to instrument code, run tests, and collect execution data showing which lines, branches, and paths were hit.
Identify untested code sections, add tests to cover gaps, and iterate until coverage targets are met.
While black-box testing validates behavior against requirements, white-box testing ensures internal logic correctness and detects implementation errors.
Code coverage metrics provide quantifiable data on test completeness, guiding test effort and signaling when additional tests are needed.
Structural testing techniques are defined in the ISTQB Certified Tester Foundation Level syllabus, section 4.3 (White-box Test Techniques). Our engineers are certified in ISTQB methodologies and apply industry-standard coverage criteria to every project.
Our ISTQB-certified engineers deliver comprehensive structural testing with measurable coverage metrics and detailed reporting.