Member-only story

When Is The Inverted Contract Testing Really Necessary?

The when and the how of protecting your software against external changes.

David Rodenas PhD
7 min readJan 27, 2024
Two software developers working on the ceiling upside down. One says “I do not understand why they say inverted”. The other is scratching his head, trying to imagine software developers working on the floor.
“Developers working on the floor?” — Prompted and edited by the author.

In my previous article, I discussed the inverted contract testing, which involves testing in a manner contrary to what we usually expect. Normally, contract testing implies that the service creates its own definitions and tests. However, we can go a step further and have the client create tests for the service. But when to do that?

The why is straightforward.

If we are developing a client, and we have no control over the service, we’re at risk. Even if we don’t change anything on our end, changes in the service can still break our application.

How do we prevent this?

As the previous article says, by adding the client’s relevant tests into the service’s own code repository. That safeguards ourselves from breaking changes. Any dangerous change by the service will break its own CI, forcing a dialogue and agreement on a solution with us. We are protected.

--

--

David Rodenas PhD
David Rodenas PhD

Written by David Rodenas PhD

Passionate software engineer & storyteller. Sharing knowledge to advance our skills. Join me on a journey of discovery in the world of software engineering.

Responses (2)