A metamorphic testing framework for Python
Project description
Chrysalis
A metamorphic testing framework that utilizes metamorphic relations.
What is Metamorphic Testing?
Metamorphic testing is a software testing technique that focuses on relations between multiple executions of a program. Instead of checking if a program produces the "correct" output for a given input (which may be unknown) metamorphic testing verifies that certain relationships hold between inputs and their corresponding outputs.
Core Concepts
System Under Test (SUT) - The function or system to test.
Transformations - Functions that modify the input data while preserving certain properties.
Invariants - Predicates that define relationships between outputs.
Metamorphic Relations - The combination of a transformation and invariant that defines a testable property of a system.
Installation
pip install chrysalis-test
Usage
Registering Relations
Use chry.register() to register metamorphic relations by combining transformations and invariants:
import chrysalis as chry
chry.register(
transformation=transformation_function,
invariant=chry.invariants.equals
)
Running Tests
Use chry.run() to execute metamorphic testing on your system under test:
results = chry.run(
sut=sut_function,
input_data=test_data,
chain_length=10,
num_chains=20
)
Official Documentation
Chrysalis - A metamorphic testing framework that utilizes metamorphic relations to detect bugs.
Development
For development, use the following commands:
- Format and check code:
./scripts/format_and_check.sh - Run unit tests:
uv run pytest - Run integration test:
python3 -m tests_integration.sql - Build docs:
./scripts/build_docs.sh
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file chrysalis_test-0.1.1.tar.gz.
File metadata
- Download URL: chrysalis_test-0.1.1.tar.gz
- Upload date:
- Size: 17.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b4b439c41e63ab1b22331e9141f7c39e059c5ce885f8a801cedfc3cd2cdcefaf
|
|
| MD5 |
84cdf4f5d81eccb116a0366700d2c8e7
|
|
| BLAKE2b-256 |
5d4a47438f8cb3b6ce8f22a4b2829881fa71cfe9fbc172ff0cdffc7b18656bfd
|
File details
Details for the file chrysalis_test-0.1.1-py3-none-any.whl.
File metadata
- Download URL: chrysalis_test-0.1.1-py3-none-any.whl
- Upload date:
- Size: 22.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cb394fe218ab8498f090eb34ea9d7a9b08fba0cdeea902c8fc3199253c7aa114
|
|
| MD5 |
d38eadc13b111c8b9a6b352b20ae7f0c
|
|
| BLAKE2b-256 |
6ee3a9adfa1c05c55cd97dad599967dc5e2715e1c1f802c721cbf7643d1afd97
|