Test First
A software development approach where tests are written before the implementation code, ensuring code quality and driving design decisions through test requirements. Test-first development is the foundational principle behind test-driven development (TDD) and behavior-driven development (BDD), where the specification of expected behavior is captured in executable tests before any production code is written.
APIs
Cucumber API
REST API and tooling for Cucumber BDD framework supporting test-first development with Gherkin feature files, scenario definitions, and step implementations.
Pact Broker API
REST API for Pact Broker contract testing service, enabling consumer-driven contract testing where consumer tests define the API contract before providers implement it.
Stoplight API
API design-first platform enabling teams to write API specifications before implementation, supporting test-first development with mock servers, contract testing, and API style ...
Microcks API
Open-source cloud-native tool for API mocking and contract testing, supporting test-first development by generating mocks from OpenAPI, Postman, and gRPC specifications.
Dredd API
Command-line HTTP API testing framework that validates API implementations against API Blueprint or OpenAPI descriptions, enabling test-first API development.
Features
Write executable test specifications that define expected behavior before writing any production code.
Define the API contract through tests before the implementation exists, ensuring design clarity.
Use mock servers generated from specifications to enable parallel frontend and backend development.
Tests serve as up-to-date documentation of how the system is expected to behave.
Discover design issues early by specifying tests before implementation reveals constraints.
Let API consumers define their expectations as tests that the API provider must satisfy.
Use Cases
Write OpenAPI specifications and generate tests from them before building the implementation.
API consumers publish test expectations that API providers must verify in their CI pipelines.
Use Gherkin feature files to define expected system behavior before writing implementation.
Enable frontend and backend teams to develop in parallel using mock servers from specifications.
Validate that API implementations comply with their published specifications using test-first assertions.
Integrations
Generate test-first stubs and mocks directly from OpenAPI specifications.
Use Gherkin scenarios as the test-first specification for behavior-driven development.
Apply consumer-driven contract testing where consumer tests define provider expectations.
Use Stoplight Prism to mock APIs from OpenAPI specs enabling test-first development.