Contracts

Goals

  1. Describe a contract
  2. Skillfully create and use contracts
  3. Continually get high payoffs from using contracts

What?

A contract is an explicit or implicit agreement that defines the relationship between actors.

The purpose of a contract is to define the best outcomes that can happen and the best path for reaching those outcomes. A contract also reduces waste, ambiguity, misalignment, and conflicts.

That is, a contract serves to define the “best relationship.”

Actor
An actor is a person, group, or entity (code, device, method, webpage, … ) that has a role to play.
Best
Best means the highest probability of maximizing rewards minus drawbacks in a holistic sense for the given context and surrounding circumstances.
Relationship
In the context of a contract, a relationship refers to the purpose, inputs, outputs, and the criteria for success.

Examples

Coding

In coding, contracts are built in. A function implicitly promises the following:

Contracts are used extensively in software engineering. They function as promises that make systems reliable and composable.

Problem Solving

A well-developed problem-solving method functions as an implicit contract with its user. The method promises:

In this case, the contract exists between two entities: the method and the user of the method. The essence of a high-quality contract is a promise of the highest probability of success in both outcomes and paths.

Relationship

If a relationship between two people is set up with a high-quality contract:

Here again, the core elements of a contract appear: inputs, outputs, best outcomes, and best paths, without assuming perfection, which does not exist.

Employee / Employer (Poor Contract)

High-quality contracts are uncommon. This often becomes visible in employee–employer relationships where one or both parties are dissatisfied.

The costs of a low-quality contract can include:

Why?

Skilled contract building equips you with the ability to maximize your chances of getting the best results and the best paths across many contexts, including coding, relationships, method development, product development, education, management, and parenting. Even better, it helps handle errors and problems and get things back on track when they go awry.

In short, a high quality contract is a guarantee of success (in a probability sense) in a relationship between you and another actor (person, group or thing)

Building High-Quality Contracts (How to)

A contract is a relationship between two entities: X and Y. Here is the recipe in short hand:

Purpose → Inputs → Outputs → Success Criteria → Reflect & Improve

Here are the recipe steps.

  1. Figure out the contract purposes
    • Why does the relationship exist?
    • What rewards can and should this relationship produce?
  2. Figure out Inputs
    • What does X need to provide?
    • What does Y need to provide?
  3. Figure out Outputs
    • What is produced?
    • What outcomes are needed or desirable?
  4. Figure out Success criteria
    • How we know it worked?
    • What exceptions will occur and how will they be handled?
  5. Reflect and Improve (contract building is iterative; not a one-off)
    • What is working and why?
    • What are the most useful concerns and how do we address them?
    • What, if anything, has been learned about contracts?
    • What are next steps?
    • What is the current level of quality on the 10 scale? (10 = best quality possible for the context)

Success Criteria

Success Criteria (SC) are the list of desirable or necessary outcomes that define what success looks like. They make the “pot of gold” visible — the rewards that justify the effort — and they must be expressed in observable or measurable terms so anyone can recognize when the gold has been reached.

Quality in a Contract

Quality is the degree to which an entity (a performance, good, service, or experience) fulfills its intended purpose across all relevant dimensions.

A contract has high quality when the following conditions are jointly met.

  1. It does its job well
    The core function succeeds.
    Examples include code that works as intended, a problem-solving method that reliably produces good solutions, a relationship that functions well for the people in it, and a restaurant that delivers great food and service.
  2. Clear, concise, and motivating purpose
    The purpose explains why the contract exists.
    When humans are involved, the purpose is motivating enough to drive good execution.
  3. Well-defined success criteria (the gold)
    Success criteria are measurable or observable.
    They describe the rewards (payoffs) that matter to the human actors involved.
  4. Well-defined inputs
    What each party must provide is explicit.
    Assumptions are minimized or eliminated.
  5. Well-defined outputs
    What the contract produces is explicit and distinguishable from success criteria.
    Outputs can be checked or verified.
  6. Graceful exception handling
    Expected deviations, edge cases, and failures are anticipated.
    Exceptions are handled in ways that preserve as much value as possible rather than treating them as surprises or total failures.

Taken together, these conditions are necessary and sufficient for a contract to achieve high quality in real-world use.

Pitfalls and Tips

Success Criteria (For this Lesson)

Success (the gold) is reached when the following criteria are jointly met.

TwFs (Tasks with Feedback)

Task:

Why build contracts?

Task:

Build a contract for a Restaurant ↔︎ Diner

Task:

Build a contract for a Dog ↔︎ Owner

Task:

Build a contract for a Fiction Book ↔︎ Reader

Task:

What is the recipe for a high-quality contract?