TestSpec

A test specification written as part of TDD, defining the expected behavior of a unit before implementation.

AgileBest PracticesContinuous IntegrationExtreme ProgrammingMethodologySoftware DevelopmentTesting

Properties

Name Type Description
id string Unique identifier for the test specification.
name string Descriptive name of the test specification.
describe string The subject under test described in the outermost describe block.
context string The specific scenario or context being tested.
it_should string The expected behavior expressed as it should... statement.
given string Given precondition for BDD-style specs.
when string When action for BDD-style specs.
then string Then expected outcome for BDD-style specs.
assertions array List of assertions that must pass for the spec to be satisfied.
tags array Tags for filtering and organizing specs.
language string Programming language of the test spec.
framework string Testing framework the spec is written for.
status string Current execution status of the spec.
View JSON Schema on GitHub

JSON Schema

test-driven-development-test-spec-schema.json Raw ↑
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/test-driven-development/refs/heads/main/json-schema/test-driven-development-test-spec-schema.json",
  "title": "TestSpec",
  "description": "A test specification written as part of TDD, defining the expected behavior of a unit before implementation.",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Unique identifier for the test specification."
    },
    "name": {
      "type": "string",
      "description": "Descriptive name of the test specification."
    },
    "describe": {
      "type": "string",
      "description": "The subject under test described in the outermost describe block."
    },
    "context": {
      "type": "string",
      "description": "The specific scenario or context being tested."
    },
    "it_should": {
      "type": "string",
      "description": "The expected behavior expressed as it should... statement."
    },
    "given": {
      "type": "string",
      "description": "Given precondition for BDD-style specs."
    },
    "when": {
      "type": "string",
      "description": "When action for BDD-style specs."
    },
    "then": {
      "type": "string",
      "description": "Then expected outcome for BDD-style specs."
    },
    "assertions": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/Assertion"
      },
      "description": "List of assertions that must pass for the spec to be satisfied."
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Tags for filtering and organizing specs."
    },
    "language": {
      "type": "string",
      "description": "Programming language of the test spec."
    },
    "framework": {
      "type": "string",
      "description": "Testing framework the spec is written for."
    },
    "status": {
      "type": "string",
      "enum": ["pending", "passing", "failing", "skipped"],
      "description": "Current execution status of the spec."
    }
  },
  "required": ["id", "name", "it_should"],
  "$defs": {
    "Assertion": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "enum": ["equals", "contains", "matches", "throws", "resolves", "rejects"],
          "description": "Type of assertion."
        },
        "expected": {
          "description": "The expected value for the assertion."
        },
        "message": {
          "type": "string",
          "description": "Failure message shown when the assertion fails."
        }
      },
      "required": ["type"]
    }
  }
}

Work with this as data

Every JSON Schema here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for schemas

4 MCP tools reach this
  • find_json_schemasBrowse and filter every JSON Schema in the catalog.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This JSON Schema
curl "https://apis.io/api/v1/json-schemas/test-driven-development-test-spec"
All schemas
curl "https://apis.io/api/v1/json-schemas?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.