Code coverage is
-
Static White-box
-
Dynamic White-box
-
Static Black-box
-
Dynamic Black-box
Code coverage is a Dynamic White-box testing technique. It requires executing the code with test cases (dynamic) and analyzing the internal structure/branches (white-box). Static analysis examines code without execution, while black-box testing ignores internal structure.
Code coverage is a dynamic technique because it requires actually executing the code (running test cases) to measure which lines, branches, or paths were exercised — you can't compute it by static inspection alone. It's also white-box because it requires knowledge of and access to the internal code structure (statements, branches, paths) rather than just external behavior, which is what distinguishes white-box from black-box testing. Static White-box (e.g., code reviews/complexity metrics) and both black-box options don't involve measuring internal execution coverage.