Contract vs. Approval Testing: Identifying Bugs in RESTfulBooker’s API with Specmatic and TextTest

The BEST way to find BUGS in an API | Contract vs Approval Testing – Emily Bache

Testing APIs: Specmatic vs TextTest

Emily Bache wanted to compare TextTest with Specmatic and has published a video about her experience: The BEST way to find BUGS in an API | Contract vs Approval Testing

She observes, “Specmatic works best when the spec is defined independently in an ongoing discussion about expectations between the service developers and the service consumers. Specmatic is not so much about finding bugs as agreeing expectations about an API.”

  • Emily looks into the best ways to find bugs in an API by exploring the use of Contract vs Approval Testing.
  • She takes us through an in-depth comparison of using TextTest and Specmatic to test and expose bugs in the RESTfulBooker API.
  • She explores the concept of contract testing as a means to ensure seamless communication between different teams working on services that communicate via APIs.
  • Observe the power of leveraging API specifications as executable contracts and maintaining them in a central Git repository to ensure that both providers and consumers are working with the correct version of the specification.
  • Check out her video to get a detailed breakdown of the benefits and functionalities of both TextTest and Specmatic in identifying, documenting, and preventing bugs in API development.

Key Takeaways from the video

1. Exploring API Bugs: Emily demonstrates how RESTfulBooker, intentionally filled with bugs, provides a playground for discovering issues through manual testing and automated tools like Specmatic and Text Test.

2. Contract Testing with Specmatic: Emily reveals how Specmatic facilitates contract testing by creating and running tests based on API specifications, ensuring alignment with the expected behaviors. She goes on to explain how this enables teams working on different services to independently verify if their respective services / components comply with the agreed API contract. Emily also discusses how Specmatic is able to use the examples in the OpenAPI specification for generating tests.

3. Approval Testing with Text Test: Emily discusses the features and benefits of Text Test, emphasizing its capacity for approval testing by comparing the actual API responses with previously approved outputs. This tool aids in exposing bugs and ensuring proper functionality through meticulous testing and validation.

4. Effective Bug Identification: The video sheds light on the significance of thorough bug identification through a combination of manual exploratory testing and automated testing tools, showcasing how both approaches contribute to comprehensive bug detection.

Elevating API Testing with Contract Driven Development

In the evolving landscape of microservices and API-driven architectures, Contract Driven Development (CDD) emerges as a game-changer. By leveraging API specifications as executable contracts, CDD enables seamless collaboration between service providers and consumers, fostering a robust and reliable API ecosystem.

Explore the power of Contract Driven Development in API testing by embracing Specmatic and TextTest. These tools provide indispensable support for developers and testers, ensuring the robustness and reliability of your API infrastructure.

Related Posts

Specmatic vs WireMock

By Hari Krishnan

Comparison: Specmatic vs WireMock

API mocking is only effective if the mocks are truly representative of the provider / services they are emulating. Deviations between mocks and providers can
Read More
Specmatic vs Pact & Pactflow comparison

By Hari Krishnan

Comparison: Specmatic vs Pact.io and Pactflow.io

Specmatic and Contract Driven Development differ significantly from Pact. We built Specmatic out of our own necessity where Pact did not fit the bill for
Read More

By Naresh Jain

Contract Testing using OpenAPI Specs as Executable Contracts

Demonstration video showing OpenAPI specifications being leveraged as executable contracts with Specmatic Sample projects with OpenAPI https://docs.specmatic.io/sample_projects.html#openapi
Read More
Contract Testing with Specmatic - Markus Oberlehner

Stubbing an HTTP end-point with Specmatic

Markus Oberlehner gives a brief overview on the topic of Contract Testing with Specmatic and his experience using it for stubbing an HTTP end-point.
Read More

By Joel Rosario

TMForum ODA CTK API specification conformance testing with Specmatic

We recently discovered some major issues with the TMForum Conformance Test Kit (CTK) v5.0.0 and will demonstrate how using Specmatic can address these problems.
Read More
Specmatic API Coverage Report

Early detection of mismatches between your API specs and implementation: Exploring Specmatic’s API Coverage Report

Specmatic’s API coverage report helps identify any mismatches between an OpenAPI specification and an application's endpoints early in the development lifecycle. The report lists all
Read More
Dave Farley pointing to the Specmatic tool for easy microservice testing, featured on Dave Farley's Continuous Delivery channel.

“Easy Microservice Testing” – Specmatic featured on Continuous Delivery channel

Dave Farley is a respected author and widely recognised proponent of Continuous Delivery. In this video on his Continuous Delivery YouTube channel he discusses why
Read More
JDBC stubbing with Redis and Specmatic contract testing.

Break the Chains of Database Dependencies: Leveraging Specmatic for JDBC Stubbing

With Specmatic JDBC stub, you can easily test APIs without the need for a complex database setup. By switching out the real database with a
Read More

JMS Mocking with AsyncAPI using Specmatic

The JMS mock is wire compatible and can be controlled entirely from within the test. This means you can run the test locally or also
Read More
Specmatic + Kafka demo video thumbnail

Kafka Mocking with AsyncAPI using Specmatic

The Specmatic Kafka mock is wire compatible and entirely within the control of the test, the test can run locally and in CI and deliver
Read More