liveBook · Manning

White-box testing

White-box testing is a software testing technique that evaluates behavior using knowledge of the software’s internal implementation, structure, or execution paths.

How 3 Manning books explain it

Functional Design and Architecture: Examples in Haskell

White-box unit testing is testing that verifies internal code paths and implementation details in addition to externally observable behavior.

How it is used
Uses mocks to drive business logic through controlled internal paths and dependency failures.
How deep it goes
Explains interface-based mocking, stateful mock interpreters, failure tests, runtime dispatch, and tracing; warns against exhaustive coverage.
Examples
Demonstrates mocked random values for a game picker and mocked KV-database failures while loading a labyrinth game session.
What you can do after
Apply it via mock interpreters and controlled runtimes to test sensitive branches and external-service failures.

Read how Functional Design and Architecture: Examples in Haskell explains white-box testing →

Write Powerful Rust Macros

White-box testing evaluates software with knowledge of and access to its internal implementation, including private code paths.

How it is used
Verifies procedural-macro internals and private helper behavior alongside implementation code.
How deep it goes
Demonstrates string, exact-stream, and parsed-AST assertions, while noting the maintenance cost of macro-specific fixtures.
Examples
Uses a derive-generated builder for `StructWithNoFields` and exercises testing structs with fields and unnamed-field failures.
What you can do after
Diagnose/debug with it by directly asserting generated output and parsing it to inspect selected syntax details.

Read how Write Powerful Rust Macros explains white-box testing →

Unit Testing Principles, Practices, and Patterns

A software testing method that verifies internal implementation behavior using knowledge of the application's source code or structure.

How it is used
Analyzes tests and implementation choices within a broader unit-testing strategy.
How deep it goes
Contrasts definitions, benefits, and brittleness but stops short of prescribing detailed test construction.
Examples
Compares tests derived from source code with tests derived from requirements and specifications.
What you can do after
Evaluate tests by balancing regression protection against brittleness and resistance to refactoring.

Read how Unit Testing Principles, Practices, and Patterns explains white-box testing →

Related concepts

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.