Skip to main content

APITESTS: AI-Powered Runtime Test Generator for Microservices

Project description

APITESTS: AI-Powered Runtime Test Generator for Microservices

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

Installation

$ pip install apitests

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

PYPI publising:

  1. Fix version

  2. Build

$ python -m build
  1. Upload to pypi
$ python -m twine upload dist/*

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.2.tar.gz (23.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.2-py3-none-any.whl (28.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: apitests-0.0.2.tar.gz
  • Upload date:
  • Size: 23.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.2.tar.gz
Algorithm Hash digest
SHA256 897498842d2429b4be6876ba47b602692ab32aeb0efb758a1b087f2afc2c0265
MD5 88ebd8e2233932bb4c47eaf6ffe02e7c
BLAKE2b-256 dce38fc7ebc278cbf77a0ccf8445910abd7c294523bfafbc65e0c3f8c9edf749

See more details on using hashes here.

File details

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

File metadata

  • Download URL: apitests-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 28.0 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 0e14ee85a1647fedfd42b2891870422268cc576b4a4ff0d8fd2ea246f22b55ff
MD5 c2f11d1fb48db74d8645dee648d4389b
BLAKE2b-256 d9e67c6019f8afe5163444cc6d5b0ae6952e87e0add6b19063a1c8d139db956e

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