Discussion on The Good and Bad of Contract Testing by Wessel Braakman | Testμ 2024

Wessel Braakman from Bouvet ASA will explore the impact of contract testing. :mag:

Gain insights on common mistakes and effective strategies to improve system reliability and efficiency.

Not registered yet? Don’t miss out—secure your free tickets and register now.

Already registered? Share your questions in the thread below :point_down:

Hi there,

If you couldn’t catch the session live, don’t worry! You can watch the recording here:

Here are some of the Q&As from this session:

Should a contract test focus on the specific current usage from a consumer, or list all that is current available (such as from the openapi spec) ?

Wessel Braakman: Contract tests should focus on the specific current usage from a consumer to ensure the contract meets the actual needs of the consumers, while also considering the OpenAPI spec for comprehensive coverage.

Are there any tools or best practices that can improve contract testing (mitigate the negatives in factor of the positives)?

Wessel Braakman: Tools like Pact and Postman can improve contract testing. Best practices include maintaining clear contracts, regularly updating tests, and involving all stakeholders in contract discussions.

Contract testing in different in each layer we test and use different framework ? Can you please suggest any tool for the same ?

Wessel Braakman: Contract testing can vary by layer (e.g., consumer-driven contract testing for APIs). Tools like Pact for consumer-driven contracts and Schema Testers for data contracts can be used based on the layer and framework.

In what all the layers of an application we can apply contract testing ?

Wessel Braakman: Contract testing can be applied across several layers of an application. At the API layer, it ensures that the API endpoints adhere to the agreed contract between services. For microservices, it verifies that each service correctly fulfills its interactions as per the contract. In data contracts, it ensures data formats and structures between different parts of the system are consistent.

Can you tell me some of the good use cases where we should go for contract testing?

Wessel Braakman: Good use cases include microservices architectures, API integrations, and scenarios where multiple teams or services depend on consistent API contracts.

Here are some unanswered questions that were asked in the session:

Can you share a real-world example where contract testing solved a critical issue?

Can we expect to know more about contract testing?

What are some best practices for designing effective contract tests that ensure both parties’ expectations are met?

How does contract testing differ from other types of software testing?

What common pitfalls should developers be aware of when implementing contract testing?

Typically, who takes charge of bi-directional contract testing, developers or SDETs? It seems like it necessitates access to code to be effectively executed, doesn’t it?

Can you share an example where contract testing helped catch an issue that might have been missed with traditional testing methods?

Is contract testing more effective than others?

What should we do to understand contract testing in depth so that we can judge the good and bad with our own experience? :slight_smile:

What are some common pitfalls to avoid when implementing contract testing?

Contract testing can fail in any tests??

Which expenses and insurance need to be taken into consideration?

Can you share a real-world example of how to use contract testing in daily life?