Rethinking E2E Tests and Contract-Based Testing in Distributed Systems
Imagine an online store. A user buys something on the store's website, paying with money they hold at a financial institution (we'll call it Bank). For the sake of example, the Bank has a direct software integration with the Store. So we have two parties participating in the process: the backend system of the Store and the backend system of the Bank. The entire workflow—from when the buyer clicks "Pay" to the very end (when proceeds of the sale are sent to the Store's bank)—is a multi-step process involving a chain of API calls between the two parties. Some of the requirements of such a system are as follows: When a payment is made, it must first be approved (or denied) after verifications such as checking the payer's payment limits and performing checks against online fraud. The payer's money must be reserved for a period of time, to protect the Store's interests against fraudulent buyers. The payment can be refunded to the buyer if a prob...