No code path may behave differently because a source is simulated
Table of Contents
1. Summary
Synthetic data is data. It is never a branch. A source has a kind, and a person
can read the kind. No part of the system may choose a different action because
the kind is simulated. If real data replaced the simulator tomorrow, no code,
no table constraint, no subject and no screen should need a change.
2. Detail
2.1. What the kind may affect
- Display. A badge on a source, a filter on a list and the text on a series page.
- Governance and cost. The rate card of the source and whether its bill is a shadow bill.
- Installation. Which bundle installs the source and its adapter.
2.2. What the kind may not affect
- The mapping, the quality checks, the storage, the delivery and the metering.
- Any NATS subject, table name, source name pattern or constraint.
- Access control. The same permissions apply to a simulated source.
- Any consumer. Pricing and risk read a quote and cannot ask where it came from.
2.3. A review test
A change fails review when it does any of these.
- It tests the kind, the source name or the adapter id for the word
synthetic,simorsimulatedoutside the display code. - It adds a table constraint, a subject prefix or a column whose value depends on the kind.
- It gives the simulator a path that a live adapter cannot use.
- It lets a consumer read a value from the simulator that a live source could not publish.
2.4. Why the rule matters
If the system special-cases the simulator, a test with the simulator does not prove the system works with live data. The rule makes every simulated run a true test of the live path.
2.5. An exception that proves the rule
The party tick carries the source id. A consumer can display it. A consumer
that branches on it breaks the rule, and the review test catches it.
3. See also
- Market Data Architecture — the structure note that orders this cluster.
- A live and a simulated source differ only inside the adapter — exemplifies: the rule applied part by part.
- The source kind — completes: where the kind is stored.