Specification by example

Specification by example describes the expected behavior of a program through concrete cases: corresponding inputs and outputs, including edge cases. Given to a model or a colleague, it removes the ambiguities of natural language and then serves as the basis for tests.

Example

moyenne([2, 4]) must return 3; moyenne([]) must raise ValueError.

Related concepts

The whole glossary