Skip to main content

Runtime test generation framework

Project description

GenTests for Python

Runtime test generation framework

Define GenTestCase blueprints with parameter sets; the framework generates a test for each combination, reducing boilerplate and increasing coverage.

Key concepts

AI-Powered Generation

Use a Large Language Model (e.g., Gemini) with a RAG system to auto-generate test parameters. The RAG fetches context from internal docs (API specs), and the LLM creates a dictionary of valid, invalid, and edge-case inputs for your GenTestCase.

Black-Box Mocking

For black-box testing, patch your app's HTTP client to redirect traffic to a local Active Stub Server. The stub server queries the GenTests generator for dynamic, context-aware responses for each test, allowing you to test an unmodified application.

Data Collection During Generation and "live documentation"

As tests are generated and run, the framework can collect valuable data, such as:

  • Request/response payloads from mocked services.
  • Application logs emitted during the test.
  • Performance metrics like response times.

This data can be aggregated into a report, offering insights into the application's behavior under different scenarios and aiding in debugging. This collected data can then be fed into a corporate RAG system, creating a form of "live documentation" that reflects the application's actual, tested behavior.

Running the Generator

You can tag your GenTestCase tests and run them selectively with your test runner.

This will start test generation:

Django:

$ ./manage.py test animals --tag=generator

Pytest:

$ pytest tests/test_mod.py -m=generator

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

apitests-0.0.1.tar.gz (6.9 kB view details)

Uploaded Source

Built Distribution

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

apitests-0.0.1-py3-none-any.whl (7.2 kB view details)

Uploaded Python 3

File details

Details for the file apitests-0.0.1.tar.gz.

File metadata

  • Download URL: apitests-0.0.1.tar.gz
  • Upload date:
  • Size: 6.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for apitests-0.0.1.tar.gz
Algorithm Hash digest
SHA256 21274c017cacbfaefb60709e12efaa3d025fe49d52403440ae2bd2a1c0dcbcd5
MD5 0e20204a43ebf5169017dc2f6f9931b6
BLAKE2b-256 1448eaf7bbb9ddef35114203ab32b83c8ef2cec32db6dad5e5c5938789b7744f

See more details on using hashes here.

File details

Details for the file apitests-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: apitests-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 7.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for apitests-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1a221664c381e90b1f9af784a8bf233d515eaccd451f194376470c8e66ba1c14
MD5 75d7c9c6ac78798a61413a42b9a79678
BLAKE2b-256 82a36990056410e080c074f8831090612ab25e00dbd515d49d133257e7f5e85e

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