← Software Testing learning pathSoftware Testing · Module 5 of 10
White-box testing
Design tests using knowledge of the code.
📖 Key ideas
- White-box testing uses internal code structure.
- Statement coverage: every line executed at least once.
- Branch/decision coverage: every true/false outcome.
- Path coverage: every possible path (often too many).
- Coverage tools: JaCoCo, coverage.py, Istanbul/nyc.
💡 Real-life example: White-box testing is a mechanic opening the bonnet to check every part works.
White-box testingTests based on code structure
Statement coverageLines executed
Branch coverageDecision outcomes executed
Coverage toolMeasures executed code