Black-box testing evaluates behavior through a system’s public interface, without depending on its internal fields, functions, variables, or implementation details. In Go, an external test package such as `pocketlog_test` exercises only exported API, keeping tests aligned with what clients can use. section 4.1.5 section 4.6
Apply the technique by:
- Create a test file in the same directory with the `foo_test` package rather than the implementation package. section 4.1.5
- Import the package under test and call only exported constructors, methods, functions, and types. section 4.1.5
- Assert observable results, output, and public error behavior, then add cases for uncovered use cases. section 4.1.5 section 10.3.1
Testing logger output
An external example test constructs a debug logger, calls `Debugf`, and declares the expected standard output: `Hello, world`. The test initially fails while the logger does nothing, turning the public behavior into an implementation target. section 4.1.5





