Chapter 1 — The boundary and the guarantee
Consider the staircase light of a block of flats. Whoever enters the entrance hall presses the button and the light switches on; after a certain time, with no further action, the light switches itself off. If the button is pressed again while the light is still on, the light stays on longer; this behaviour is dealt with in chapters 8 and 9.
The consumer of the light does not know how it works inside. Behind the wall there may be a relay, an electronic timer or a small computer, and knowing it is not necessary. Only two pieces of information are needed: what can be done, that is pressing, and what is expected as a result, that is that the light stays on for the time needed to climb the stairs.
The manual describes how to write these two pieces of information precisely.
The boundary
The lighting installation is a system. In the manual the term denotes any element of the description, small or large: an installation, a program, an appliance are all systems.
Between the consumer of the light and the lighting installation there is an interface, consisting of the button pressed and the light observed: it is the boundary. In general, a boundary is the interface between a system and another counterpart, a person or another system, at which what passes between the two can be observed. Every boundary has two sides: in the example, on one side there is the person on the stairs, on the other the installation.
The boundary of the staircase light is crossed by two elements:
- from the person on the stairs to the installation, the button pressed;
- from the installation to the person on the stairs, the light, on or off.
For now the button and the light are treated as a single boundary; in chapter 11 the boundary is split in two.
What happens behind the boundary cannot be observed from outside. For the person on the stairs the installation is a black box: a system of which only what goes in and what comes out is known.
The guarantee
On a boundary, one of the two sides makes a commitment to the other. The lighting installation, for example, commits itself as follows: “if the button is pressed, the light switches on”. A sentence of this kind is a guarantee: it states what one side of the boundary guarantees to whoever is on the other side.
A guarantee concerns only what is observed at the boundary. “If the button is pressed, the light switches on” is admissible, because the button pressed and the light are both at the boundary; “the relay closes” is not, because the relay is inside the box and the person on the stairs cannot observe it.
The verification
A guarantee is useful only if it can be verified. “The light works well” cannot: it does not state for whom, nor by what measure. “The light switches on when the button is pressed”, by contrast, can be verified: one presses and observes. So can “the light switches off sixty seconds after the last press”, with a stopwatch.
For this reason every guarantee is accompanied by its verification: who checks that it is satisfied, and how. A guarantee without verification is not wrong, but it is incomplete.
Why write it down
Consider two people: the building manager, who wants the staircase light, and the electrician, who has to build it. An oral agreement leaves each of the two with a different memory; if instead the guarantees are written down before work begins, the two have a text on which they agree. When the work is finished the same text serves for acceptance testing: for each guarantee the corresponding verification is performed.
A guarantee that has just been written is pending approval: it becomes an actual commitment only when it is approved by whoever has the authority to do so, in this case the building manager. How the approval is written is described in chapter 7.
BCDD is intended above all for systems much larger than a light, in which this agreement is even more important. A large system is divided into parts, that is into smaller systems, and each part is described only through its own boundaries, like the staircase light. Whoever builds a part receives only the description of its boundaries. This may be a person or a language model, that is a program, trained on large amounts of text, that generates text and code from instructions written in natural language. The rule is the same for both: the description of the boundaries must be enough to establish what to do, without any need to know the inside of the other parts.
Building the system that keeps the guarantees is called implementing it; the built system, with all its internal choices, is the implementation.
What is not written
The internal construction of the system is not written: no wires, programs, circuit boards, calculation formulas or internal sequences of operations between one part and another are written. These are choices of whoever implements the system; if they were written, whoever implements it could no longer change them, not even on finding a better way to keep the same guarantees.
For the same reason where the system is located is not written: on which wall, in which program, on which appliance. This too is a choice of whoever implements it.
The names
The acronym BCDD stands for Behavioural Contract-Driven Design, that is design driven by contracts on behaviour. Behaviour is what is observed from outside: what goes in, what comes out and at what moment. A contract is the set of approved guarantees on a boundary, that is a commitment accepted by both sides; from chapter 3 onwards it also includes the approved assumptions.
The written description of a boundary is called a CSC, from Capability State Contract: a contract on what can be requested and on what can be observed. The name contains the word “contract” because a CSC, once approved, is a contract in every respect. The first CSC is presented in chapter 2.
Summary
- The boundary is the interface between a system and a person or another system, and it has two sides.
- On that boundary, a guarantee states what one side guarantees to the other; it concerns only what is observed at the boundary.
- A guarantee is complete only with its verification: who checks it, and how. Until it is approved, the guarantee is “pending approval”.
- The internal construction of the system and its location are not written: they are decided by whoever implements it.
- The written description of a boundary is called a CSC.
Special cases
Guarantee that cannot be verified. A guarantee such as “the light is convenient” is a valid text, but it is of no use to
either side: the electrician has no indication of what to build and acceptance testing has nothing to measure. As
chapter 2 shows, bcdd reports an error for a guarantee without the verification line; it is up to whoever writes
the CSC, instead, to judge whether the written verification makes sense.
Internal element: not indicated. A relay, even if the electrician has to install and wire it, is a choice of whoever implements the system and is not written in the guarantee. The case is different when someone outside the box must use a specific terminal: that terminal is then part of what is observed at the boundary, and the case is dealt with in chapter 25.
System with more boundaries. The staircase light has more than one boundary, as shown in chapter 11. In this chapter only one is considered: the one between the person on the stairs and the installation.

