Chapter 18 — Scope of Layered Test Evidence
Chapter objective: After this chapter, a developer can select evidence for a domain port, real Runtime, multi-node protocol, or network black box and refuse to substitute a lower-layer green result for higher-layer acceptance.
Learning objectives
- Build an E1–E4 evidence ladder.
- Record environment, pinned revision, proven claims, and open claims at each layer.
- Distinguish real collections, controlled fake membership, and real network ports.
- Define a minimal faithful validation set for all three collection types.
Prerequisites
- The Chapter 15 example and Chapters 16–17 assembly/isolation are complete.
- The Chapter 14 chaos test has run.
- Test count is not treated as a production-readiness score.
Case progress
The fulfillment team has domain, single-Runtime, and chaos tests. Release review asks whether these results prove real ports, client protocols, and process isolation. The answer is stated one evidence layer at a time.
Evidence strength describes scope, not points
| Level | Execution surface | Best evidence for | Cannot replace |
|---|---|---|---|
| E1 | domain fake/static asset | port language, decision table, failure translation | real collection/protocol behavior |
| E2 | real Runtime, one process | spec, codec, typed handle, lifecycle | multi-node propagation and partition |
| E3 | multi-node protocol/controlled chaos | delta, repair, partition, recovery, member events | independent processes and real ports |
| E4 | independent processes, real port, client protocol | process boundary, protocol compatibility, reachability | production capacity and full failure domains |
E4 is closer to deployment reality than E3 and still leaves topology, capacity, access, alerts, and operations to production acceptance.
Minimal evidence by collection
Register
- E1: the route hint is rebuildable guidance, not an order fact.
- E2: put/get/remove, resolver, and ChangeStream overflow.
- E3: two-node delta, tombstone, schema mismatch, and repair.
- E4: Chapter 23's Redis-shaped lab observes replication through a real TCP port.
Lease
- E1: the domain result retains uncertain, reason, and fencing token.
- E2: a guard rejects the old token after acquire/transfer.
- E3: autonomous dual holder and quorum fail-closed behavior.
- E4: the actual protected resource validates the token; this book defines the boundary without claiming a ready-made business system.
CRDT
- E1: counts support operations, not billing authority.
- E2: single-Runtime merge and algebra cases.
- E3: multi-node local updates, duplicate/reordered delivery, and repair convergence.
- E4: exposure through a client protocol depends on the application and is not proven by a CRDT unit test.
Every evidence card fixes four facts
- Environment and revision: source, JDK, and Maven context.
- Input/fault: the actual injected condition.
- Observation: test counts, failures, errors, skips, and key behavior.
- Open claim: the question left to the next layer.
Skipped and Tests run: 0 are not passes;
compilation alone is not behavior evidence.
Counterexample and fault injection
- Select a nonexistent Maven test while disabling
failIfNoSpecifiedTestsand observe a false green with zero tests. - Use an E1 fake result to claim network repair and name the missing execution surface.
- Use controlled E3 multi-node results to claim real TCP compatibility and identify the process/port gap.
- Record "all passed" without a revision and observe the loss of reproducibility.
Experiment
Run book-owned E1/E2:
cd examples/order-fulfillment-control-plane
mvn clean testRun pinned-source E2/E3:
cd submodule/dsm
mvn -q -pl dsm-integration-test -am \
-Dtest=RuntimeIntegrationTest,TwoNodeIntegrationTest,ChaosIntegrationTest \
-Dsurefire.failIfNoSpecifiedTests=false testUse evidence-ladder.json to confirm that every level
contains nonempty proves and doesNotProve
fields.
Experiment acceptance card
| Field | Content |
|---|---|
| Command | Two book-example tests plus focused Runtime/TwoNode/Chaos tests |
| Input or fault | fake port, real single Runtime, two nodes, loss, and partition |
| Observable result | each layer's green result and count are reproducible; no zero-test or skipped false green |
| Evidence level | E1, E2, E3; Chapter 23 provides the real-port E4 lab |
| This experiment does not prove | Production capacity, cross-host deployment, real external fencing, or complete security configuration |
Review
- Test level describes execution scope rather than a quality score.
- Every layer states both proven and open claims.
- A fake, one Runtime, multi-node chaos, and a real port do not replace one another.
- Revision and fault input precede any green conclusion.
Next
Arc 5 turns to runtime responsibility. Chapter 19 adds diagnostics, metrics, and trace surfaces for locating distributed differences.