Cliente–Proveedor

Escrito por Darjus Kazakevic · revisado el

The customer team gets a say in the supplier's plan, and a test in its build.

In an online shop, Sales publishes orders and Shipping uses them. Sales is upstream (the supplier) and Shipping is downstream (the customer). By default, Shipping learns about a changed order format when its own build breaks.

Customer–supplier fixes that. Shipping's needs go into Sales's backlog like any other work, and a contract test written by Shipping runs in Sales's pipeline. It works only when both teams report to management that can settle priority conflicts.

En esencia — The supplier plans for the customer's needs, and the customer's contract tests run in the supplier's build, so a break fails before release.

Cuándo recurrir a él

Recurre a él cuando

  • Downstream keeps learning about upstream changes from a red build
  • Both teams report to management that can settle priorities
  • Upstream has a few consumers it can talk to directly

Reconsidéralo cuando

  • Upstream is a vendor with no reason to take your requests
  • Most features need both teams at once: that is a partnership
  • Upstream has dozens of consumers: publish an open host service

Conceptos clave

Supplier and customer
The supplier (upstream) provides data or a service; the customer (downstream) uses it. Change flows downstream, so the customer is the side that needs protection.
Planned requests
The customer's needs enter the supplier's backlog and get a priority there, next to the supplier's own features. A request that always loses is not customer–supplier.
Consumer-driven contract test
A test written by the customer that checks only the fields and rules it uses. It runs in the supplier's pipeline, so the supplier sees a break before release.

Reglas de diseño

Run the customer's test in the supplier's build
A contract test written by the customer and run on every supplier push turns a promise into a failing build before release, instead of a surprise after it.
Make the customer's needs planned work
Put the customer's requests in the supplier's backlog with a priority. If they always lose to the supplier's roadmap, you are conformist in practice, so say so on the context map.
Test only what the customer uses
A contract test checks the fields and rules the customer relies on, nothing more. Testing the whole response blocks the supplier from harmless changes.

Errores habituales

  • Contract tests that run only in the customer's pipeline, so breaks show up late
  • Customer requests that are accepted but never scheduled
  • Testing the whole payload, so every harmless change fails
  • Treating a vendor as a supplier that will plan for you