Contract Tests

Contract Test

Contract Tests are examples that describe the behaviour of an abstraction by expressing what cannot be encoded in the type system. These are typically helpful in testing adapters as defined in the Ports & Adapters architecture.

July 15, 2025 · 10 min · 2053 words · Jakub Zalas
Contract and collaboration tests

Collaboration and contract tests

A collaboration test is an example of interactions between the subject of the test and its collaborators often replaced with test doubles. A contract test confirms assumptions made in test doubles.

August 16, 2022 · 5 min · 951 words · Jakub Zalas
On granularity of tests focused on behaviour

On granularity of tests focused on behaviour

A function is one of the smallest units of behaviour. Functions can be composed to build coarser behaviours. What granularity and altitude to test behaviours on?

May 17, 2022 · 4 min · 704 words · Jakub Zalas