2 comments on “Application Pattern: Consumer Driven Contracts”

  1. Hi Steve,

    Interesting stuff, as always!

    In general I would argue that it’s the responsibility of the Provider to make sure that it doesn’t break its existing behaviour. Of course, in a complex environment this can be extremely difficult to accomplish so I guess this is where Consumer Driven Contracts may thrive.

    You say that these Contracts are executable specifications so I guess this means that they are written by the Consumer’s dev team. Considering that this code will run inside the Provider’s build system, this would also imply a close relationship between the Consumers and the Provider, like being part of the same organization or at least sharing the same technologies.

    And if this close relationship already exists, isn’t it easier to just open up the Provider’s “Provider Contract” test suite to the Consumers and let them add any tests that they feel are missing?


    • Hi Niek

      Thanks for that.

      It’s the responsibility of both Provider and Consumer to protect the integrity of API conversations, but all too often Provider and Consumer know nothing of one another and costly risk reduction strategies can creep in. A Consumer can protect itself against unexpected change with relatively little effort, but protecting a Provider with multiple Consumers can be difficult and that’s where Consumer Driven Contracts come in. Increasing the visibility of existing inter-application relationships is really powerful.

      In an ideal world the Provider and Consumer teams will have a close relationship regardless of their organisational loyalties, and ideally a Provider will receive Consumer Contracts that are executable specifications. When this doesn’t happen, Consumer Driven Contracts remain enormously powerful even if the contracts are emails/spreadsheets etc. That is at least a starting point – the contracts should be a placeholder for a conversation whenever the Provider API needs to change.



Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>