Metadata-Version: 2.1
Name: adaptive-testing-tools
Version: 0.1.4
Summary: Adaptive random testing helpers for Python.
Author: Khaled Ahmed
License: MIT
Keywords: random,testing,fixtures
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Intended Audience :: Developers
Classifier: Topic :: Software Development :: Testing
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: rapidfuzz>=3.0

# adaptive-testing-tools

Adaptive random testing helpers for generating spread-out random inputs and a few small random data utilities.

## Installation

Install directly from the repository or a built wheel:

```bash
pip install .
```

## Usage

```python
from adaptive_testing_tools import random_choice, random_int, random_string

value = random_int(10, 99)
letter = random_choice(["a", "b", "c"])
token = random_string(length=12)

# Adaptive random testing with FSCs
from random import Random
from adaptive_testing_tools import adaptive_random_testing

def make_candidate(rng: Random) -> str:
    # Example: random 4-word phrase; replace with your own generator
    words = ["alpha", "bravo", "charlie", "delta", "echo", "foxtrot"]
    return " ".join(rng.sample(words, 4))

def evaluate(candidate: str) -> bool:
    # Replace with your system-under-test invocation
    return "alpha" in candidate

samples = adaptive_random_testing(
    make_candidate,
    evaluate,
    pool_size=5,
    max_iterations=3,
    seed=42,
)
for sample in samples:
    print(sample.iteration, sample.distance_to_previous, sample.result)
```

## Development

- Build artifacts: `python -m build`
- Install locally in editable mode: `pip install -e .`

Feel free to extend the helpers in `src/randomtest/generator.py` to fit your projects.
