Skip to main content

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:

pip install .

Usage

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.

Metadata

Release files for adaptive-testing-tools 0.1.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for adaptive-testing-tools 0.1.4
File Size Uploaded Provenance Actions
adaptive_testing_tools-0.1.4.tar.gz 5.1 kB Without provenance Details for adaptive_testing_tools-0.1.4.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for adaptive-testing-tools 0.1.4
File Interpreter ABI Platform Actions
adaptive_testing_tools-0.1.4-py3-none-any.whl Python 3 none any Details for adaptive_testing_tools-0.1.4-py3-none-any.whl

Total release size: 10.5 kB

Release files / adaptive_testing_tools-0.1.4.tar.gz

Download URL adaptive_testing_tools-0.1.4.tar.gz
Size 5.1 kB
Tags Source
SHA-256 checksum
How to use checksums
62bc350a00f76cfb4d15a0e7b4dfc0caa5591ce30279e193921ffeaf368616b0
BLAKE2b-256 checksum
How to use checksums
106b2488336e7c279d2cb37d35b95fceeaf21bcb055ba1e9a5516f5a06cef92c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.1.1 CPython/3.12.12

Release files / adaptive_testing_tools-0.1.4-py3-none-any.whl

Download URL adaptive_testing_tools-0.1.4-py3-none-any.whl
Size 5.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d576e5c8e685f67abb1b642bce64c5a3931bd6af2b10d2e1425e2b12473411b2
BLAKE2b-256 checksum
How to use checksums
8ca73795319f912a9ce345d413a1cee1284bbf2f3c96acf56464618a261d719c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.1.1 CPython/3.12.12

Security for adaptive-testing-tools 0.1.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.4 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page