Test-Driven Development · JSON Structure

Test Driven Development Test Spec Structure

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

Type: object Properties: 13 Required: 3
AgileBest PracticesContinuous IntegrationExtreme ProgrammingMethodologySoftware DevelopmentTesting

TestSpec is a JSON Structure definition published by Test-Driven Development, describing 13 properties, of which 3 are required. It conforms to the https://json-structure.org/meta/core/v0/# meta-schema.

Properties

id name describe context it_should given when then assertions tags language framework status

Meta-schema: https://json-structure.org/meta/core/v0/#

JSON Structure

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

Work with this as data

Every JSON Structure 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 json structure

4 MCP tools reach this
  • find_json_structuresBrowse and filter every JSON Structure 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 Structure
curl "https://apis.io/api/v1/json-structures/test-driven-development-test-spec-structure"
All json structure
curl "https://apis.io/api/v1/json-structures?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.