Skip to main content

AI-Powered Test Design Engine — from requirements to mathematically optimal test cases using ISTQB methodology

Project description

TestAxiom

From requirements to mathematically optimal test cases — with AI intelligence and ISTQB methodology.

TestAxiom is an AI-Powered Test Design Engine that combines Large Language Model intelligence with deterministic, mathematically-grounded test design techniques.


Why TestAxiom?

Most AI test generators just throw requirements at an LLM and say "generate tests." The result: bloated, unexplainable, untraceable test suites. Mathematical tools like PICT are precise but require manual parameter extraction.

TestAxiom bridges the gap. Every test case comes with:

  • The technique that generated it (EP, BVA, Decision Table, Pairwise, State Transition)
  • The mathematical rationale explaining WHY this specific value was chosen
  • Full traceability from requirement → technique → test case

Quick Start

pip install testaxiom
pip install testaxiom[ai]   # optional: for AI requirement parsing

Python API

from testaxiom import analyze

result = analyze("age", param_type="int", valid_range=(18, 65))
print(result.summary())

Output:

═══ TestAxiom Analysis: age ═══
Techniques applied: EP, BVA
Test cases generated: 7  (87% reduction from 50 exhaustive)

  [EP]  EP-age-001: input=10   → ✗ invalid
         ↳ Equivalence Partitioning: below valid range (18–65). Any value here behaves identically.
  [EP]  EP-age-002: input=30   → ✓ valid
         ↳ Equivalence Partitioning: representative of valid partition.
  [BVA] BVA-age-001: input=17  → ✗ invalid
         ↳ Boundary Value Analysis: just below minimum (18). Classic off-by-one location.
  ...

CLI

testaxiom --param age --type int --range 18 65
testaxiom --param age --type int --range 18 65 --bva-mode 3-value --json

Show, Don't Tell — Real Use Cases

1. Free text → pytest tests in 4 lines

import pytest
from testaxiom.parsers import parse_and_analyze
from testaxiom import exporters

# One sentence of requirements → mathematically grounded test cases
results = parse_and_analyze(
    "User age must be between 18 and 65. "
    "Username must be 3–50 characters."
)

# Inject directly into pytest — no manual work
@pytest.mark.parametrize("input_val, expected", exporters.to_pytest_params(results[0]))
def test_age_validation(input_val, expected, app):
    assert app.validate_age(input_val) == (expected == "valid")

2. Decision Table: "If cart > $100 and user is VIP, apply 20% discount"

from testaxiom.engines.decision_table import DecisionTableEngine, Condition, Action

engine = DecisionTableEngine()

conditions = [
    Condition("cart_over_100", "Cart total exceeds $100"),
    Condition("user_is_vip",   "User has VIP status"),
]
actions = [Action("apply_20pct_discount")]

def discount_resolver(conds):
    return {"apply_20pct_discount": conds["cart_over_100"] and conds["user_is_vip"]}

rules = engine.generate_full_table(conditions, actions, action_resolver=discount_resolver)
test_cases = engine.generate(conditions, actions, rules=rules)

# → 4 test cases, covering every combination:
# cart=T, vip=T → discount ✓
# cart=T, vip=F → no discount ✗
# cart=F, vip=T → no discount ✗
# cart=F, vip=F → no discount ✗

3. State Transition: Login flow

from testaxiom.engines.state_transition import (
    State, Transition, InvalidTransition, StateTransitionEngine
)

engine = StateTransitionEngine()

states = [State("logged_out"), State("logged_in"), State("locked")]
transitions = [
    Transition("logged_out", "valid_credentials", "logged_in"),
    Transition("logged_in",  "logout",             "logged_out"),
    Transition("logged_out", "invalid_credentials","locked",    guard="attempts >= 3"),
    Transition("locked",     "admin_unlock",        "logged_out"),
]
invalid = [
    InvalidTransition("locked", "valid_credentials", "Account is locked — must be unlocked first"),
]

test_cases = engine.generate(states, transitions, "logged_out", invalid_transitions=invalid)
# → 4 valid transition tests + 1 negative test, all fully traced

4. Pairwise: Cross-browser/OS matrix (88% reduction)

from testaxiom.engines.pairwise import PairwiseEngine, Parameter

engine = PairwiseEngine()
params = [
    Parameter("browser", ["Chrome", "Firefox", "Safari", "Edge"]),
    Parameter("os",      ["Windows", "macOS", "Linux"]),
    Parameter("lang",    ["en", "he", "ar", "fr"]),
]

cases = engine.generate(params)
# Exhaustive: 4 × 3 × 4 = 48 combinations
# Pairwise:   ~12 test cases — covers every browser×os, browser×lang, os×lang pair
print(cases[0].rationale)
# → "Pairwise test 1/12: covers unique parameter pairs ... 75% reduction"

pytest Integration

TestAxiom output plugs directly into @pytest.mark.parametrize:

from testaxiom import analyze, exporters
import pytest

result = analyze("price", param_type="float", valid_range=(0.01, 9999.99))

@pytest.mark.parametrize("price, expected", exporters.to_pytest_params(result))
def test_price_validation(price, expected, pricing_service):
    result = pricing_service.validate(price)
    assert result.status == expected
    # Each test is individually named: BVA-price-001, EP-price-002, ...

to_pytest_params() returns pytest.param objects with auto-generated IDs (EP-age-001, BVA-age-003, etc.) so failures are immediately traceable to their ISTQB technique.


AI Requirement Parser

Setup

pip install testaxiom[ai]
export ANTHROPIC_API_KEY="sk-ant-..."   # or set in your environment

Usage

from testaxiom.parsers import parse_requirements, parse_and_analyze

# Extract parameters from free text
specs = parse_requirements(
    "Cart total must be between $0 and $10,000. "
    "Discount percentage: 0–100, must be divisible by 5. "
    "User tier: bronze, silver, gold, platinum."
)

# Or: parse + run full analysis in one call
results = parse_and_analyze("Age must be 18–65", bva_mode="3-value")
for r in results:
    print(r.summary())

Privacy & Security

  • Your requirements text is sent to the Anthropic API (Claude) for parsing.
  • TestAxiom uses your own ANTHROPIC_API_KEY — no data is routed through TestAxiom servers.
  • The system prompt is prompt-cached (Anthropic's caching feature) to reduce latency and cost on repeated calls — no persistent storage of your data.
  • If you're working with sensitive specifications, review Anthropic's privacy policy before use. All other TestAxiom engines (EP, BVA, Decision Table, Pairwise, State Transition) are fully local and send no data anywhere.

Supported Techniques

Technique Description
Equivalence Partitioning (EP) Divides input space into partitions — one test per partition
Boundary Value Analysis (BVA) Tests at and around partition boundaries (2-value & 3-value modes)
Decision Table Covers all combinations of business rules (2ⁿ rules for n conditions)
State Transition Tests valid & invalid transitions in state machines
Pairwise (All-Pairs) Minimizes combinatorial test sets — covers all value pairs
AI Requirement Parser Extracts ParameterSpec from free-text requirements via Claude API

All techniques are free and open source (MIT).


Architecture

testaxiom/
├── core.py          # Data models (ParameterSpec, TestCase, AnalysisResult)
├── engines/         # Deterministic technique engines — fully local, no AI
│   ├── equivalence_partitioning.py
│   ├── boundary_value.py
│   ├── decision_table.py
│   ├── pairwise.py
│   └── state_transition.py
├── parsers/         # AI layer — optional, requires anthropic package
│   └── ai_requirement_parser.py   # Claude API + tool_use + prompt caching
├── exporters.py     # JSON, Markdown, CSV, Traceability Matrix, pytest params
└── cli.py           # Command-line interface

Key design principles

  • Traceability first — every test case includes its technique, partition, and mathematical rationale
  • Deterministic — no randomness except Pairwise's greedy search (seeded, reproducible)
  • Zero required dependencies — core engines work with no external packages
  • AI is optionalpip install testaxiom[ai] only if you want NLP parsing

License

MIT

Author

Yaniv (Yaniv2809) — AI-Powered QA Engineer

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

testaxiom-0.1.1.tar.gz (28.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

testaxiom-0.1.1-py3-none-any.whl (27.4 kB view details)

Uploaded Python 3

File details

Details for the file testaxiom-0.1.1.tar.gz.

File metadata

  • Download URL: testaxiom-0.1.1.tar.gz
  • Upload date:
  • Size: 28.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.12

File hashes

Hashes for testaxiom-0.1.1.tar.gz
Algorithm Hash digest
SHA256 f7d59d3aa5aff2f137e5c914a6a3c5490a655b457791bbf36e2a5d287e6ed01b
MD5 6e10b7ba941ede71e8681fda559667e6
BLAKE2b-256 6b56a39ac982ce3c74f5e6a8d3b438a28558ee127fff07047d6aa461b1c29a5a

See more details on using hashes here.

File details

Details for the file testaxiom-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: testaxiom-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 27.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.12

File hashes

Hashes for testaxiom-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9421e1721e97c0b64c5a167818cb80d2c7c3a930e1093a8cf3358e1fad97eec8
MD5 eb7831dd50e8eb6ddd40f57ded87cc86
BLAKE2b-256 a97d1b239e1633f72d62742d83de0e24a330e28830fbf709587efb0342bfb753

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page