Black-box testing
Black-box testing evaluates software by examining its externally observable behavior without relying on knowledge of its internal implementation.
Unit Testing Principles, Practices, and Patterns
A testing technique that evaluates software through externally observable behavior without relying on knowledge of its internal implementation.
- How it is used
- Guides unit tests toward user-relevant outcomes instead of implementation details.
- How deep it goes
- Defines the principle, contrasts it with white-box testing, and demonstrates refactoring a structural test into an outcome test.
- Examples
- Uses MessageRenderer tests that inspect sub-renderers, source code, or produced HTML.
- What you can do after
- Diagnose brittle tests and rewrite them around externally observable results.
Read how Unit Testing Principles, Practices, and Patterns explains black-box testing →
Write Powerful Rust Macros
Black-box testing evaluates software through externally observable behavior and public interfaces without relying on implementation details.
- How it is used
- Verifies a procedural macro’s promised public behavior through the same API its users call.
- How deep it goes
- Defines outsider-focused testing and develops a compiling builder use case, while deferring detailed internal-output checks to white-box tests.
- Examples
- Uses a derived empty struct whose generated `builder().build()` call must compile and return the struct type.
- What you can do after
- Apply it via Rust tests to validate generated public APIs with happy-path and selected failing compilation cases.
Read how Write Powerful Rust Macros explains black-box testing →
Functional Design and Architecture: Examples in Haskell
Black-box testing evaluates software through externally observable behavior without relying on knowledge of its internal implementation.
- How it is used
- Uses public interfaces to reduce project risk by checking observable behavior against functional or nonfunctional requirements.
- How deep it goes
- Defines the interface boundary and contrasts testing modes, but stops short of prescribing implementation-aware cases or detailed test design.
- Examples
- Uses public interfaces, observable results, functional requirements, nonfunctional requirements, and integrated application parts as testing targets.
- What you can do after
- Evaluate functional and nonfunctional requirements through public interfaces and recognize when architecture or additional testing is needed.
Read how Functional Design and Architecture: Examples in Haskell explains black-box testing →
Test Driven: Practical TDD and Acceptance TDD for Java Developers
Black-box testing checks a system through its externally visible behavior without relying on knowledge of its internal implementation.
- How it is used
- Tests acceptance behavior through an application’s visible interface, without relying on its internal implementation.
- How deep it goes
- Defines UI interaction and state checks, then contrasts them with hooks and direct internal access without detailing a complete test.
- Examples
- Uses GUI component lookup, button clicks, and checks of text-field values or enabled state.
- What you can do after
- Evaluate acceptance-test strategies by weighing UI-only access against access to application internals.
Learn Go with Pocket-Sized Projects
Closed-box testing evaluates a software system from outside its implementation, typically through its externally accessible interface.
- How it is used
- Validates client-visible behavior through a public API while protecting tests from internal implementation changes.
- How deep it goes
- Explains external package layout, visibility boundaries, output assertions, and added cases, but not detailed testing theory.
- Examples
- Uses a logger output example and habit-creation checks for validation results, generated fields, and invalid-input errors.
- What you can do after
- Apply it via Go tests to verify exported behavior without coupling assertions to private implementation details.
Read how Learn Go with Pocket-Sized Projects explains black-box testing →
Learn AI-Assisted Python Programming, Second Edition
Closed-box testing is software testing that evaluates externally observable behavior without relying on knowledge of the implementation's internal structure.
- How it is used
- Tests functions or entire programs by varying inputs and checking outputs against specified behavior.
- How deep it goes
- Explains input-output testing and contrasts implementation-independent cases with code-guided cases, without specifying a formal test-design method.
- Examples
- Uses traffic analysis, palindrome checks, maximum finding, longest-word ties, doctests, and artificial files as testing examples.
- What you can do after
- Diagnose/debug generated functions by designing behavioral tests before relying on implementation-specific analysis.
Read how Learn AI-Assisted Python Programming, Second Edition explains black-box testing →
Object-Oriented Software Design in C++
A testing approach that evaluates software through observable inputs and outputs without examining its internal implementation.
- How it is used
- Uses observable behavior to verify that an application meets functional and nonfunctional requirements.
- How deep it goes
- Defines external tests through inputs, actions, and expected results, without examining implementation internals.
- Examples
- Uses book-entry and repository-search behavior, plus specified input actions and expected results.
- What you can do after
- Evaluate whether application behavior matches stated requirements through externally observable tests.
Read how Object-Oriented Software Design in C++ explains black-box testing →
Also covered in
- Shipping Go: Develop, deliver, discuss, design, and go again
- Software Design for Python Programmers
- The Well-Grounded Python Developer: How the pros use Python and Flask
- Akka in Action, Second Edition
- Starting Data Analytics with Generative AI and Python
- Go in Action, Second Edition
- Testing Spring Boot ApplicationsIn early access (MEAP)
What to know first
- software testingSoftware testing is the systematic evaluation of software under specified inputs or conditions to assess its behavior against expected results or requirements and identify defects.
- mockingMocking is a testing technique that replaces a dependency or collaborator with a controlled substitute to simulate behavior, isolate code, or inspect interactions.
- contractA contract is an agreed specification of the conditions, expectations, rights, or obligations that govern behavior or interactions between parties or software components.
- integration testAn integration test evaluates whether multiple software components, or a component and an external dependency, interact and behave correctly together.
Related concepts
- open-box testingcontrasts with · Open-box testing is a software-testing technique that examines a program’s internal implementation to identify likely failures and design structure-specific tests.
- contractuses · A contract is an agreed specification of the conditions, expectations, rights, or obligations that govern behavior or interactions between parties or software components.
- white-box testingcontrasts with · White-box testing evaluates software using knowledge of its internal implementation, structure, or execution behavior.
- compilation testincludes · A compilation test checks whether source code, including a macro invocation, compiles successfully or fails as expected.
- software testingkind of · Software testing is the systematic evaluation of software under specified inputs or conditions to assess its behavior against expected results or requirements and identify defects.
Questions about black-box testing
What is black-box testing?
Black-box testing evaluates software by examining its externally observable behavior without relying on knowledge of its internal implementation.
Which Manning books explain black-box testing?
Unit Testing Principles, Practices, and Patterns, Write Powerful Rust Macros, Functional Design and Architecture: Examples in Haskell, Test Driven: Practical TDD and Acceptance TDD for Java Developers, Learn Go with Pocket-Sized Projects, Learn AI-Assisted Python Programming, Second Edition and Object-Oriented Software Design in C++.
What should I know before learning black-box testing?
Manning books that teach black-box testing usually introduce software testing, mocking, contract and integration test first.
What is the difference between black-box testing and open-box testing?
Black-box testing evaluates software by examining its externally observable behavior without relying on knowledge of its internal implementation. Open-box testing is a software-testing technique that examines a program’s internal implementation to identify likely failures and design structure-specific tests.
What kinds of black-box testing are there?
Kinds of black-box testing include compilation test.
What is black-box testing a kind of?
Black-box testing is a kind of software testing. Software testing is the systematic evaluation of software under specified inputs or conditions to assess its behavior against expected results or requirements and identify defects.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.






