ediverse Explore the platform

Spotlight PEPPOL BIS Billing 3.0 The EU e-invoicing mandate is here — France Sept 2026, Belgium Jan 2026, Germany 2025.

— May 16, 2026 · 10 min read

Playbook: testing EDI pipelines

Testing an EDI pipeline is technically comparable to testing a microservice — but with three quirks that change the playbook: external partners you do not control, formats versioned across multi-decade timelines, and a high cost of error (badly issued invoice, misread order). This seven-step playbook collects the practices that work.

Why an EDI-specific playbook?

Classical software testing rests on the Arrange-Act-Assert trio in a controlled environment: build the input, call the function, verify the output. In EDI, the input may be a message received from an external partner with undocumented quirks, the act spans several systems (parser, mapper, ERP), and the assert must verify conformance to a de jure standard (EDIFACT, X12) AND to a sector implementation guide (EANCOM, VICS, GHX) AND to partner-specific expectations. Usual unit-testing tools do not cover that complexity by default.

Step 1: a versioned fixture repository

The foundation of a testable EDI pipeline is a fixture repository — real (anonymised) or synthetic messages, covering each combination of version × partner × scenario. For an average retailer, that can be a few hundred files:

  • A baseline per standard (D.96A, D.01B, D.96A EANCOM, X12 4010, X12 5010), to ensure pure syntax regression.
  • Fixtures per partner, because Carrefour does not send exactly the same ORDERS as Tesco — different optional segments, non-standard qualifiers, etc.
  • Error-path fixtures: missing mandatory segment, unknown qualifier, invalid date, inconsistent amount. These fixtures are nominally rejected by the pipeline; the test verifies correct rejection and the correct error message.

The repository must be versioned in Git, with a manifest (typically YAML or JSON) describing for each file its version, partner, expected scenario and expected status. The manifest is queryable by tests and also serves as living documentation of the tested perimeter.

Step 2: snapshot tests on transformations

EDI mappers are rarely easy to unit-test: they produce structured output (XML, JSON, another EDIFACT) from structured input, with hundreds of rules. Snapshot tests (Jest toMatchSnapshot, Vitest toMatchSnapshot, or approval-style with ApprovalTests) are particularly effective.

The test applies the mapper to an input fixture, then compares the output to the stored snapshot. Any difference is flagged. For code review, the snapshot diff becomes a visual proof of semantic change — far more readable than a mapper code diff. This pattern works equally for EDIFACT → internal ERP mappings and for transformations from one format to another (X12 → UBL, EDIFACT → JSON).

Step 3: contract testing with sandbox partners

Pact, designed for contract testing between microservices, applies to the EDI case with a few adaptations. The idea: the partner publishes a contract (Schematron, XSD, or equivalent Pact) describing the messages it accepts and emits; the pipeline is verified against the contract at every build.

In practice, few partners publish a Pact; but many publish a Schematron or an XSD. For PEPPOL BIS Billing 3.0, the OpenPEPPOL Authority publishes the official Schematron rules. Integrating them in a test run at each commit yields a strong guarantee: if an internal mapping changes, the test catches non-conformance before the invoice reaches production.

For EDIFACT, the EANCOM and ODETTE guides provide implementation rules usable as contracts. On the X12 side, the VICS and HIPAA TR3 guides play the same role.

Step 4: partner sandboxes

Most large partners offer a sandbox environment accessible to suppliers during onboarding: Walmart Retail Link, Amazon Vendor Central, SAP Ariba Network sandbox, Coupa CSP, FOD Financiën Belgium (Hermes PEPPOL sandbox). These sandboxes accept synthetic messages without engaging production.

The stake: automate a send-acknowledgment cycle in that environment at each major release. The pipeline pushes a fixture to the sandbox, waits for the acknowledgment (CONTRL, 997, AS2 MDN, AS4 receipt), and verifies the status. This tests the whole chain — serialisation, transport, signing — not only the internal code.

Step 5: property-based testing on invariants

Property-based tests (fast-check in TypeScript, Hypothesis in Python, QuickCheck in Haskell) generate random inputs automatically to stress a system.

In EDI, some properties lend themselves well to this kind of test: roundtrip (parse(serialize(msg)) == msg for any msg), mapper idempotency, total preservation (invoice total = sum of lines ± discounts ± VAT), Schematron conformance of any generation result. A property-based test on 100,000 synthetic INVOICes in seconds detects edge bugs impossible to anticipate with hand-written fixtures.

Step 6: capture-replay on real messages

The most valuable test is often the one that replays, in a non-production environment, the real messages received the previous day through the new pipeline version. This is the shadow testing pattern: the new version processes in parallel with the old, and a comparator verifies the outputs are identical.

This test requires non-trivial infrastructure: input message archival (with GDPR guarantees), a non-blocking pipeline for production, and an output comparator tolerant to expected differences (timestamps, technical identifiers). But once in place, it is the tool that catches the subtlest regressions, those visible only on real traffic.

Step 7: chaos days

One last level, often neglected: chaos days targeted at the EDI infrastructure. Over a scheduled window, artificial incidents are injected: PEPPOL access point halt, AS2 connection loss, expired certificate, oversized payload past timeout, reversed segment order, UTF-8 vs ISO-8859-1 encoding.

The goal is not to break; it is to verify that defence mechanisms (exponential retry, dead-letter channel, circuit breaker, ops escalation) work in real conditions. A quarterly chaos day, in working hours but on an isolated environment, builds operational confidence no unit test can build.

Seven steps, one discipline

Testing an EDI pipeline requires more discipline than a standard microservice, because operational stakes are higher and external dependencies more numerous. The seven steps above — versioned fixtures, snapshots, contract testing, sandbox, property-based, capture-replay, chaos days — cover the essential perimeter. None is sufficient on its own; combined, they let you qualify a major release calmly and sleep easy during nightly deployment. To dig further, see Testing EDI pipelines in foundations, and the EDIFACT Validator page for hands-on use on a fixture.