Testing pyramid, contract tests, chaos engineering
Test pyramid: Unit > Integration > E2E.
def test_calculate_total():
order = Order(items=[{"price": 10}, {"price": 20}])
assert order.calculate_total() == 30Test interactions between services.
@pact.given("product exists")
@pact.upon_receiving("GET product")
@pact.will_respond_with(200, body={"id": 1})Test resilience by injecting failures.
Randomly terminates instances to test resilience