← Software Testing learning path
Software Testing · Module 5 of 10

White-box testing

Design tests using knowledge of the code.

📖 Key ideas

  1. White-box testing uses internal code structure.
  2. Statement coverage: every line executed at least once.
  3. Branch/decision coverage: every true/false outcome.
  4. Path coverage: every possible path (often too many).
  5. 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