Skip to main content

What is the difference between black-box, white-box, and gray-box testing?

  • testing types
  • black-box
  • white-box
  • gray-box

Answer it first, then compare. Nothing here is saved or scored.

Model answer

Black-box: test without knowledge of internal code, focus on inputs and outputs (functional testing, user perspective). White-box: test with full knowledge of code - focus on logic paths, branches, and internal state (unit testing, code review). Gray-box: partial knowledge - you understand the architecture and data flow but test through external interfaces (API testing with knowledge of the database schema). Most QA work is gray-box - you understand the system architecture but test through the UI or API rather than directly testing internal functions.

What interviewers listen for

  • Risk-based prioritisation
    You can defend skipping coverage on a path because the risk maths supports it.
  • Test design fluency
    You apply equivalence partitioning and decision tables to concrete inputs in real time.
  • Metric judgment
    You distinguish between metrics that drive learning and metrics that drive theatre.
  • Strategy under constraint
    You can produce a defensible plan when the team has half the time and twice the scope.

See all 33 methodology questions

Written by , Senior QA Automation Engineer, 50+ QA candidate interviews conductedLast updated July 2026