Company
Date Published
Author
Gabe Kaufman
Word count
978
Language
English
Hacker News points
None

Summary

Contract testing is a lightweight form of API testing that focuses on ensuring the content and format of requests and responses conform to specifications such as Swagger or OpenAPI. It's useful for early stages of building or updating mobile apps or web platforms, where speed and cost are crucial, by providing a balance between risk and velocity. Contract testing can be beneficial in modern workflows with scattered stakeholders, but it has limitations, including the need for human error correction from isolated tests, unreliable performance testing on public APIs, and situations where data cannot be loaded into providers without using the API being tested. In contrast, functional and end-to-end testing are more insightful, focusing on how multiple APIs collaborate to achieve meaningful results, and can be combined with contract testing in an ideal quality workflow that balances velocity and time to market.