Skip to main content

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


Download files

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

Source Distribution

chrysalis_test-0.1.2.tar.gz (16.9 kB view details)

Uploaded Source

Built Distribution

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

chrysalis_test-0.1.2-py3-none-any.whl (22.7 kB view details)

Uploaded Python 3

File details

Details for the file chrysalis_test-0.1.2.tar.gz.

File metadata

  • Download URL: chrysalis_test-0.1.2.tar.gz
  • Upload date:
  • Size: 16.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.13

File hashes

Hashes for chrysalis_test-0.1.2.tar.gz
Algorithm Hash digest
SHA256 d0f9e47068b75624be7b80d13663894517f74ec84f7bc4bb74c4f2b94b1eaf91
MD5 db793d7a2a16635a64343da437d7ded0
BLAKE2b-256 70a11a973e217be9e3232e1c021fe1423ab257e5c667abb3c3a553b0977ba5f6

See more details on using hashes here.

File details

Details for the file chrysalis_test-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for chrysalis_test-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 2878ee1504a26b0ac4d8b1616ac269e7bf60be602db78de6799431dcae03d04c
MD5 8e5f6778e5624f94a9d7f6bf6b18ef41
BLAKE2b-256 7588cb66614c2feb5bf0ba3134504358d10e953ffd806e45b6b3d221c7d6c02e

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