Logo BCDDLogo CSC
BCDDBehavioural Contract-Driven Design
version 1.0-beta
ITEN

Index

For each chapter, the index gives the content and the topics introduced. The chapters are meant to be read in order, because each builds on the previous ones. There are two exceptions. A reader who has to describe a single boundary can go from chapter 10 to part three; part four, however, also requires part two, because its examples take up the entities of part two. Chapters 14, 15, 19 and 20 deal with special cases and can be postponed until they are needed; chapters 19 and 20 are nevertheless required for chapter 28.

Part one — One boundary, described in words

This part describes the staircase light from the consumer's point of view, first in words and then in a file. It presents writing, checking, approving and modifying the description of a system.

1. The boundary and the guarantee — The chapter considers the staircase light from the consumer's point of view. From it the chapter derives the two concepts on which the language is founded: the boundary, that is the interface between a system and its consumer, and the guarantee, that is what the system guarantees on that boundary, together with the way to verify it.

2. The first CSC — The first CSC file is presented: the staircase light described with two guarantees in words. The file is then submitted to the bcdd program, which checks its form.

3. Assumptions — The assumption is introduced, that is a condition on whoever is on the other side of the boundary, a condition on which a guarantee depends. In the example the guarantee is that the light switches on if the button is held down for at least a tenth of a second: if the button is only brushed, the guarantee is not violated.

4. The two sides of a boundary — The chapter states that a CSC is written from the side of whoever keeps the guarantees, while whoever is on the other side reads the same lines the other way round. On this basis a signal is added to the light for the person on the stairs: a warning shortly before it switches off.

5. Requests — Starting from the caretaker's request to keep the light on for cleaning, the chapter describes how to write a request, which first has a response, accepted or rejected, and then an outcome, succeeded or failed.

6. The types of values — The light now has three modes: off, on, and on for cleaning. To describe them the chapter introduces types, which establish which values what is observed at the boundary can take, and named lists of values.

7. Pending approval and approved — The chapter states who approves a guarantee pending approval: a person with the authority to do so, never the program or the language model. The file records the decision that approved it. At the end of the chapter the CSC of the light is approved in full, and the bcdd command that prepares the skeleton of a new file is presented.

8. Making a guarantee precise — “It switches off after a while” becomes “it switches off 60 seconds after the last press, with a tolerance of 5 seconds”, and a new press restarts the time. For this purpose the chapter introduces a more precise line, which is added without deleting the guarantee in words, and named constants. It also introduces numbers not yet decided and the use of the language model, which asks questions about the points that are still vague.

9. Examples that fix the intention — Scenarios are introduced, described instant by instant, which show what the light must do and what it must not do: two presses 100 seconds apart are admitted, a switch-off that comes too early is not. The chapter also states their limit: a scenario forbids nothing that it does not describe.

10. Changing a CSC already approved — The on-time goes from 60 to 90 seconds. Since an approved CSC is not modified, a new version of it is written; the chapter states what must be approved again and what remains approved.

Part two — More boundaries: entities

In part one the light has a single boundary, but a system often has more than one. This part describes what stands behind those boundaries and connects them, which is called an entity.

11. One boundary or separate boundaries — The button and the light can be described separately, and the CSC is split in two: one for the button pressed, one for the light observed. The chapter states when it is worth splitting a boundary and highlights a problem: a guarantee that concerns both boundaries can no longer be written in either of the two CSCs.

12. What lies behind the boundaries: the entity — The entity is introduced, that is what stands behind one or more boundaries; the guarantee “when the button is pressed, the light switches on” is written in the entity. An entity is described by stating the boundaries on which it keeps guarantees, those for which it relies on the guarantees of others (for example of the electrical mains) and the guarantees that bind two of its boundaries. Where it is located is never stated.

13. An entity made of parts — The staircase light is divided into two parts, a button and a lamp, and the command passes from one to the other; the boundary between the two parts remains internal to the entity. The chapter also introduces the rule that a boundary used by a part must be provided by another part, or used by the entity itself towards the outside: bcdd checks the rule and reports the cases in which it is not respected.

14. A channel that loses or delays: the wireless button — The button becomes wireless, with a receiver next to the lamp. A channel that can lose a message, delay it or reorder messages is a boundary in its own right, with its own CSC: the chapter describes how to treat it and how to write an external boundary of the entity.

15. Boundary versions — A new lamp uses version 0.2 of the command, while the old button provides only 0.1. Starting from this case the chapter describes how to indicate a precise version of a CSC, in which cases the version used and the version provided match, and how a part can provide two versions of the same boundary at once.

16. The number of copies of a part — With one button per floor, from one to five, the chapter describes how to indicate the number of copies of a part and what each one guarantees: every copy keeps all the guarantees of the part, none takes precedence over the others and none performs tasks on behalf of the others.

17. The size of an entity — The chapter provides the criterion by which it is established whether an entity has an adequate size: it does when whoever implements it, a person or a language model, can consider together its boundaries, its guarantees and the boundaries of the neighbouring parts. This criterion explains why the staircase light is divided into button and lamp, and no further.

18. Scenarios across several boundaries — In the entity the scenario “the button is pressed, and within one second the light is on” is written. Since a CSC concerns only its own boundary, the order of events on two different boundaries is written in the entity; each name is preceded by the CSC it comes from.

19. A part that may be missing — The twilight sensor is introduced, which indicates whether it is dark outside. Whoever composes the system chooses whether to fit it, and the choice does not change afterwards; the chapter describes how to write that the entity must work in both cases. bcdd checks the two cases separately and, when the sensor is absent, lists what is missing without considering it an error.

20. Several forms of the same thing: variants — The chapter deals with four different installations in a single entity: ceiling light or wall light, button or presence sensor. Between ceiling light and wall light only one is chosen, and this choice combines with the one between button and sensor; the description, however, does not state which one is chosen. The chapter describes how to write these variants; bcdd checks every combination and lists them all.

Part three — Guarantees that a tool can check

In chapters 1-20 the guarantees are written in words and checked by a person. This part describes how to write them as formulas, which a program can check without the intervention of a person, and how to read the results of the check. bcdd reads the formulas of chapters 21-23 and checks their form, names and types; their evaluation on scenarios and the recording verification of chapter 24 are not performed by any program described in the manual.

21. The step and the first formulas — The guarantee “when the button is pressed, the light switches on” becomes a formula. A formula describes the behaviour of the system step by step; its basic keywords are “always”, “eventually”, “whenever… then” and “while”, and “in the same step” specifies the consequence of “whenever… then”. The comparison and arithmetic operators are introduced, together with their precedence. The guarantee changes form, but keeps its name.

22. Time in formulas — The guarantee “the light switches off 90 seconds after the last press” is written as a formula. For this purpose the chapter introduces the forms for expressing “within a certain time”, the time elapsed since an event, the number of times an event has occurred, the filter on the parameters of an event and the value that a state had in the previous step; finally, repeating scenarios.

23. Shorthands — The guarantee “the light is never on if nobody has pressed” can be written in short form and in expanded form. Some forms are in fact shorthands: each one has an expanded form, written with the formulas of chapters 21 and 22, which has the same meaning. The chapter also introduces the closed set of transitions of a state, computed constants, functions, derived events, named types, records and indexed states.

24. The meaning of “verified” — Starting from the CSC of the light written with formulas, the chapter shows that verification takes place at two moments: on the text, before construction, and on the recordings of a built system. The chapter also explains why the judgement of a person is never combined with the result of a program and why “satisfied on the trace” holds only for what has been observed. Finally it describes what happens when an assumption is not satisfied and which checks bcdd performs.

Part four — Beyond behaviour

The previous parts describe what the system does. This part describes how the system concretely appears to the outside, how it is tested, and how to proceed when the keywords of the language are not enough. bcdd reads the blocks of these three chapters and checks them against the names of the CSC they are bound to.

25. The concrete form of boundaries — The command that the button sends to the lamp is, in concrete terms, a contact closed on terminal 3 for at least 50 milliseconds; the relay that switches on the lamp, on the other hand, is not observable by the person on the stairs. The chapter describes the concrete forms in which a boundary appears, whether it is a terminal, a text on the screen or a file format, and the single criterion by which it is decided what to write: “who sees it?”. Concrete forms are written in a BINDING block.

26. The verification plan — To test the light a verification plan is prepared: a light sensor in front of the lamp and a camera that films the button and the lamp. The VERIFICATION block states which instruments record a boundary and at what resolution; bcdd computes which guarantees each instrument observes and which remain not executed.

27. Extensions and profiles — The aim is to specify that the light does not switch off instantaneously but dims gradually over two seconds, and the language provides no form to express it. The chapter describes how to add a new form, with its meaning and the way to verify it. It also describes how to collect the forms of a field of use in a profile that a CSC imports, and what trial words are, which a revision of the language can move into a profile.

Part five — Application to a real system

This part applies the topics of the previous chapters, first to a real case, then by taking up the example again from beginning to end.

28. A real case: the audio measurement kit — The description of a real, larger system is examined: an audio measurement kit, with two choices for the level sensor and an optional part, the direct box, which takes the signal from the loudspeaker terminals. The chapter introduces no new topics: the topics of the previous chapters reappear in the description and in the bcdd report.

29. The complete procedure, from beginning to end — The staircase light is rewritten from scratch, using the four bcdd commands in sequence. The chapter also states what the program does not do: it does not judge whether a guarantee is correct, it does not interpret the text in quotation marks and it does not compare two versions of the same CSC.

Appendices

A. Keywords, in the order in which they are introduced — For each keyword of the language, the chapter in which it is described.

B. What bcdd checks — The errors reported by the program, described in words and accompanied by the code that appears in the report; what bcdd does not check.

C. Glossary — The terms of the manual with their meaning.