2 How contract testing fits into wider testing concepts
This chapter covers
- Contract testing and other testing types
- Whether contract testing can replace other types of tests
- Benefits of contract testing
- Introducing contract testing to your teams
- Challenges with contract testing
- Practical guidance on introducing contract testing to projects
Contract testing is unique when compared to other testing types because it requires developing two sets of tests to fully reap the benefits. A consumer test can exist without a provider test, but it won’t be useful. You can initiate the contract testing process by writing either a consumer test or a provider test individually, but it’s important to note that these individual tests alone don’t give you real benefits. To unlock the full potential of contract testing, you must implement and execute both consumer and provider tests in tandem, in a continuous integration (CI) pipeline ideally.