An ERP import can report success twice while recording the same business event twice. It can also reject a legitimate second transaction because its date and amount happen to match an earlier one. A useful test therefore needs more than a green completion message or a plausible closing balance.
For a BAS/1C integration, start by defining the expected behavior at the boundary between the source system and the receiving information base. The protocol below is a proposed test contract, not a description of behavior guaranteed by every configuration. Run it in a disposable training copy with synthetic documents, isolated from real exchanges and payments.
State the contract before writing assertions
For this exercise, one accepted source event may create at most one receiving document with one intended contribution to the relevant movements. A repeated delivery of an unchanged event must leave that business state unchanged. Operational logs may record every attempt; business documents must not multiply with delivery attempts.
Use an identity such as source system + company + event ID. The components must match the actual uniqueness guarantees of the source. If IDs restart by year or by document type, include that scope explicitly. A file name, upload time, or batch number identifies a delivery, which may contain events already delivered elsewhere.
Store enough evidence to distinguish an unchanged repeat from a changed payload. For the exercise, compare a normalized representation of business fields: document type, organization, counterparty, currency, dates relevant to accounting, lines, quantities, prices, and required analytical dimensions. Exclude transport-only timestamps. Define decimal precision and ordering rules deliberately rather than relying on whatever a serializer happens to produce.
The proposed conflict rule is conservative: an existing identity with changed business content enters a review queue and does not silently overwrite, repost, or create another document. A later authorized correction is a separate workflow with its own tests.
Build a fixture that exposes weak matching
Use three synthetic receipt events for the same organization and date. Ignore taxes and discounts in this exercise; amounts are simply quantity multiplied by unit price.
| Source ID | Quantity | Unit price | Amount |
|---|---|---|---|
| R101 | 8 | 25 | 200 |
| R102 | 5 | 40 | 200 |
| R103 | 3 | 60 | 180 |
| Total | 16 | — | 580 |
R101 and R102 deliberately have equal amounts and dates. Both must survive the import because they are distinct events. Matching only by amount and date would incorrectly collapse them. Matching only by line content has the opposite weakness: two genuine orders can contain identical lines.
Keep an expected manifest containing each scoped identity, its normalized content, and its expected receiving document and movement contribution. Compare identities before comparing totals. A sum can show that something differs, but cannot establish which transaction is present.
Run six cases from known starting states
Reset the training copy or restore its fixture between independent cases. Record which cases intentionally build on the baseline.
| Case | Action | Expected evidence |
|---|---|---|
| 1. Baseline | Import R101–R103 into an empty fixture. | Three accepted identities, three intended documents, 16 units and amount 580. |
| 2. Unchanged replay | Deliver the complete batch again, then deliver it in a different order. | The same three document identities and movement contributions; totals remain 16 and 580. Extra attempts appear only in operational evidence. |
| 3. Same amount and date | Inspect baseline R101 and R102 separately. | Two distinct documents exist despite both amounts being 200. Each traces to its own source ID. |
| 4. Legitimate identical transaction | After baseline, import new ID R104 with the same business fields as R101. | R104 is accepted as a distinct event: four documents, 24 units, amount 780. |
| 5. Changed payload | After baseline, resend R101 with quantity 9 instead of 8, making its amount 225. | A conflict is recorded for R101. Existing documents and movements remain unchanged at 16 units and 580. |
| 6. Interrupted batch | From empty state, interrupt after the first two documents commit, then retry all three events. | Before recovery: 13 units and 400. After recovery: exactly three documents, 16 units and 580, with no duplicated first or second event. |
These outcomes assume the proposed per-document commit contract. If the implementation promises an all-or-nothing batch instead, an interrupted transaction should leave no committed batch contribution. Document that alternative and adjust the expected intermediate state before testing.
Test the awkward recovery boundary
The most revealing interruption is often after a receiving document commits but before a delivery checkpoint is saved. A retry cannot safely assume that a missing checkpoint means no document exists. Conversely, a recorded attempt does not prove that the document and its intended movements committed.
Capture the source identity, delivery attempt, receiving document reference, transaction outcome, and checkpoint outcome separately. Recovery must reconcile those records using the agreed identity and content rules. In the training copy, verify the interrupted event directly, then replay the complete batch and inspect every expected document. Do not accept a successful retry message as the sole recovery assertion.
For background on inspecting the document side of that evidence, Stimul has a historical Ukrainian reference on reviewing document postings. Its interface examples are historical; use the commands available in your actual configuration.
Balanced totals are not proof of uniqueness
A duplicated accounting entry may increase debit and credit equally, so a balanced trial balance can coexist with duplicate business events. An omitted receipt and an extra receipt of the same amount can also leave the amount total unchanged. That is why the manifest, document identities, and movement contributions are independent checks.
Finish with three questions: Did every intended event arrive? Did any unintended event appear? Did each accepted event contribute exactly the expected business effect? Preserve the fixture, interruption point, and evidence together. That makes a passing replay test reproducible instead of merely reassuring.
Top comments (0)