# Spec-Driven Development

Spec-Driven Development is an engineering approach in which versioned specifications guide what gets built and how the implementation is verified.

Cloud concept. Updated 2026-12-01. Page: https://blowstack.com/tools/cloud-concepts-hub/spec-driven-development

> Spec-Driven Development turns requirements, interface contracts, and acceptance criteria into artifacts that engineers can review alongside the code. It makes intended behavior explicit across teams and gives developers, automation, and AI assistants a shared reference for implementation and testing.

Practice exams covering Spec-Driven Development: [DVA-C03 AWS Certified Developer - Associate](https://blowstack.com/practice-exams/aws-certified-developer-associate).

## 5 key aspects of Spec-Driven Development

The approach makes intended behavior explicit, uses it to guide implementation, and checks that code and specifications stay aligned as they change.

1. **Explicit, testable requirements**: Describe normal behavior, error cases, and constraints in terms that an engineer can verify. Replace a vague requirement such as 'handle retries' with the expected outcome and the conditions under which it applies.
2. **Machine-readable contracts**: Use structured definitions for interfaces where tooling can validate schemas, detect breaking changes, or generate stubs. Keep business rules that the format cannot express in acceptance criteria and tests.
3. **Specification-guided generation and review**: Give an AI assistant the relevant spec and repository context when drafting code, completing a function, or reviewing a change. Treat the output as a proposal and verify it against the contract and independently reviewed tests.
4. **Versioning and change management**: Review specification revisions with their implementation changes and notify consumers about incompatible changes. Define which files are generated and how they are regenerated.
5. **Continuous conformance checks**: Run contract and acceptance tests in CI, and verify behavior that depends on cloud configuration or managed services in a representative environment. Add security scans and performance tests where the requirements warrant them.

## Cloud services for Spec-Driven Development

Authoring tools such as Kiro and GitHub Copilot can help translate reviewed requirements into implementation changes, but neither replaces independent verification. For an API, a versioned OpenAPI definition can serve as input to Amazon API Gateway and as a reference for client and test development. AWS CodeBuild can run schema checks and acceptance tests in the same delivery workflow, with integration tests checking that the deployed gateway and backend honor the contract. These services cover different stages; the same pattern works with other authoring, deployment, and CI tools.

- **[Kiro](https://blowstack.com/tools/cloud-services-hub/kiro)**: Kiro supports a feature workflow that turns a request into reviewable requirements, a design, and implementation tasks. Its coding agent can use those artifacts as context when implementing the feature.
- **[Amazon API Gateway](https://blowstack.com/tools/cloud-services-hub/amazon-api-gateway)**: Amazon API Gateway can import OpenAPI definitions for HTTP and REST APIs, subject to the capabilities of each API type. The definition can drive gateway configuration, while tests verify backend behavior that the interface alone does not describe.
- **[AWS CodeBuild](https://blowstack.com/tools/cloud-services-hub/aws-codebuild)**: AWS CodeBuild can run schema validation, compatibility checks, and application tests from a repository's build specification. A failing check can mark the build as failed before the delivery pipeline advances.

## What is Spec-Driven Development

In spec-driven development, a specification describes what a system must do before the corresponding implementation is written or changed. It records externally observable behavior, constraints, and conditions for acceptance. The specification can combine prose and examples for business rules with machine-readable artifacts such as OpenAPI definitions for HTTP interfaces or schemas for event payloads. It can be as small as a contract change and a few acceptance cases. The point is to make behavior reviewable and verifiable, not to produce a large document.

Consider a cloud API that starts an asynchronous report export. Its specification can define a 202 response with a job identifier, require a retry with the same idempotency key and request body to return the existing identifier within a stated window, and prevent callers from accessing jobs owned by another tenant. An OpenAPI document can define the request and response shapes, while acceptance tests verify replay and tenant isolation. Teams can build and test clients against a mock before the worker is ready, then verify the deployed API against the same contract. Schema validation alone cannot establish that retries avoid creating duplicate jobs.

Engineers can implement the specification by hand, generate client libraries or server stubs from a schema, or give an AI assistant the approved requirements, repository conventions, and acceptance criteria to draft code and tests. During review, the assistant can compare a diff with the spec, flag a missing error case, or suggest a refactor that preserves the public contract. Reviewers must still check assumptions and test edge cases independently: code and tests generated from the same misunderstanding can agree and still be wrong. Security scans also serve a separate purpose, and suggested performance improvements should be confirmed under representative load.

Keep the spec, implementation, and verification changes together in version control. For shared interfaces, run compatibility checks in continuous integration and use integration tests against a representative cloud environment for behavior that depends on managed services, such as message redelivery. When requirements change, update the spec and tests with the implementation. Establish a regeneration rule for generated files so manual edits are not silently overwritten.

The payoff is earlier feedback on mismatched assumptions, especially when multiple teams deploy independently. The cost is maintaining the specification and its checks as the system evolves. Overly detailed specs can lock in design choices that do not affect consumers, while vague criteria leave important decisions to whoever writes or generates the code. The approach is neither waterfall nor synonymous with AI code generation: teams can revise a small specification each iteration and choose which parts, if any, to automate.

## Spec-Driven Development exam questions

Real practice exam questions on Spec-Driven Development, with the correct answer and its explanation.

### Question 1 (DVA-C03)

**Question:**

A team is adding partial batch failure handling to an AWS Lambda function that processes messages from an Amazon SQS queue. The team wants to use an AI coding assistant to define which messages should be retried, review the technical design before application code changes, and then implement and test the change in small, trackable steps. The team wants the requirements, design, and task plan to remain in the repository for future maintainers. Which approach best meets these requirements?

**Correct answer:** Create a Kiro spec for the feature. Review the generated requirements, design, and task list before running implementation tasks. Commit the spec files with the code and tests.

**Explanation:** Kiro's spec workflow produces separate requirements, design, and implementation task files that the team can review and version. After review, the team can use the task list to guide incremental code and test changes.

## Practice Spec-Driven Development in a full exam

Questions on Spec-Driven Development in each practice exam, with every answer option and an explanation for each:

- [DVA-C03](https://blowstack.com/practice-exams/aws-certified-developer-associate): 2 questions

## Learn Spec-Driven Development in lessons

2 short lessons on Spec-Driven Development in 1 certification course.

- DVA-C03: Code Completion vs. Spec-Driven Development (free), https://app.blowstack.com/lessons/code-completion-vs-spec-driven-development-dva-c03
- DVA-C03: Spec-Driven Development: from feature request to implementation plan (free), https://app.blowstack.com/lessons/spec-driven-development-from-feature-request-to-implementation-plan-dva-c03
