Language-agnostic Intent-Behavioral Testing framework.
intent-spec implements the Intent-Behavioral Testing (IBT) methodology for testing software through natural language intent specifications rather than traditional assertion-based tests.
- Language-agnostic: Define intents in YAML/JSON, test any language
- Semantic assertions: LLM-powered evaluation of test outcomes
- pytest integration: Native pytest plugin with
@intentmarkers - Multiple interfaces: CLI, pytest plugin, HTTP API
- Coverage tracking: Intent coverage reports
pip install intent-specWith all optional features:
pip install intent-spec[all]# intents.yaml
version: "1.0"
project: "my-api"
language: "python"
intents:
- id: user-login
description: "User can authenticate with email and password"
category: auth
priority: critical
behaviors:
- precondition: "User exists in database"
action: "Login with valid credentials"
postcondition: "Returns JWT token"intent-spec validate intents.yamlintent-spec generate intents.yaml --output tests/@pytest.mark.intent("user-login")
def test_login_success():
result = api.login("user@example.com", "password")
assert result.token is not None# Validate spec file
intent-spec validate intents.yaml
# Show parsed spec
intent-spec show intents.yaml
# Generate test stubs
intent-spec generate intents.yaml --output tests/
# Coverage summary
intent-spec coverage intents.yamlMIT