Contract testing checks that two connected programs agree on the shape of the information they exchange. It is like making sure a delivery box matches the size and address rules both the sender and receiver expect.
For example, an app may expect a weather service to return a temperature field. A contract test can catch a change where that field is renamed before the app breaks for its users.
These tests focus on the agreement between connected parts, not on every detail of either program. They are especially useful when different teams build the two sides separately.
