Ok - Disclaimer: Learning about it, so might be off the mark, but they do say that if you can explain it, then you “understand” it.
Basically contract testing is a way of testing your services between you and another service.
e.g One of the services will be a provider (they will send responses based on the data that is sent) while the other service is going to be the consumer of said responses/events.
What contract testing aims to do is improve the feedback of when changed features break other services that are dependant on each other.
You write tests (or contracts) that state something along the lines of
“If I send A, then I expect B”.
If B is sent back, then the contract is fulfilled and the tests pass
If C is sent back, then something is wrong and the tests fail.
The other services within your test framework will be mocked out.
Pros of this approach is that you have to talk to other people to figure out what contract tests are valuable.
Basically, it’s a way of saying. These are my T&Cs for us to work correctly.
I know this is a simple way of explaining it, but like I said, still learning so some deeper explanation is probably needed.
Check out PACT - https://docs.pact.io