← Graph

Diagnostic Substitute

concept 3 connections

Part of Eventide's Useful-Objects doctrine. A dependency is defaulted to an inert null-object implementation of its interface (via Mimic), optionally specialised via a `Substitute` module that adds domain-level telemetry methods (e.g. `http_client.posted?(content)`). Used in tests to assert that a collaborator was interacted with correctly, without invoking live services. Bellware insists this is *not* a mock object: mock objects retrofit transparency into the test file after design is finished, whereas a diagnostic substitute is part of the class's own design and lives with the production code. A diagnostic substitute can behave like a spy in spirit, but the architectural choice differs.

category
pattern
about
Diagnostic Substitute concept
The question asks how diagnostic substitutes differ from mocks and spies.
about
Diagnostic Substitute concept
Introduces diagnostic substitutes as the preferred alternative to mocks/stubs/spies in tests.
concept Useful Objects
related_to
Diagnostic Substitute concept
Useful Objects rely on diagnostic substitutes instead of mocks/stubs/spies.

Provenance

Read by
1 extraction