Pipeline to create test generators
Project description
Python Tool Competition Runner
Usage
Installation
This tool requires at least Python 3.9 and poetry.
pip install python-tool-competition-2024
Creating a New Test Generator Project
Run python-tool-competition-2024 init and follow the instructions on the screen.
During the setup process, you need to provide the following information:
- Human-readable name of the test generator (mandatory)
- Directory in which the project will be created (by default: the current directory)
- Your full name (mandatory)
- Your email address (mandatory)
- Information required to create
pyproject.toml:- Project's version (by default 0.1.0)
- Author (by default, it will use the information provided in the prior steps)
- Licence (optional)
- Compatible Python versions for your generator
- Project's main dependencies (can be defined during the setup or afterward)
- Project's development dependencies (can be defined during the setup or afterward)
This will create a poetry project with all required files. It creates a template of the generator and exposes it as a plugin of the competition runner.
Additionally, some very basic example targets are created as well.
You can add your own files to the targets directory.
Now you can implement the build_test function of your generator.
This will be called for each target file and it expects that either a
TestGenerationSuccess or TestGenerationFailure is returned.
The success contains the body of the generated test file.
Storing the file is handled by the runner that runs build_test.
The failure contains a reason and lines that describe the failure.
For examples see:
- https://github.com/ThunderKey/python-tool-competition-2024-klara
- https://github.com/ThunderKey/python-tool-competition-2024-hypothesis-ghostwriter
Running inside of the Project
Inside of the create project run
poetry run python-tool-competition-2024 run <generator name>.
This will start the test generation process.
With poetry run python-tool-competition-2024 run -h you can find out what
generators were detected.
The tool does not only execute the test generator, it also runs the generated tests against the code to measure different metrics: it measures line and branch coverage using the coverage framework; it furthermore computes mutation score utilizing the cosmic-ray tool.
After finishing the test generation process, the script will print the
information regarding the coverage achieved by the tests generated by your tool.
It will also save these data as XML files in the <generator name>/coverages
directory.
Improving the Competition Runner
- Installation:
poetry install - Testing:
tox - Use pre-commit if possible.
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 python_tool_competition_2024-0.1.1.tar.gz.
File metadata
- Download URL: python_tool_competition_2024-0.1.1.tar.gz
- Upload date:
- Size: 33.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.6.1 CPython/3.11.5 Linux/5.15.132-1-MANJARO
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d5687fc48a6a5d188c5dc77f57394f8baa6a96a349ff48a77a67dc0339a196ef
|
|
| MD5 |
45436bd9bde2af6bf898074ee19fe5b4
|
|
| BLAKE2b-256 |
54f2bd1b587da56f12b5fe3ed912a7a8c2679d2ceeab61cbc11c2bfdfe98eb3d
|
File details
Details for the file python_tool_competition_2024-0.1.1-py3-none-any.whl.
File metadata
- Download URL: python_tool_competition_2024-0.1.1-py3-none-any.whl
- Upload date:
- Size: 53.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.6.1 CPython/3.11.5 Linux/5.15.132-1-MANJARO
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3234672bd1d68750793318e58da8e363c19ed5d032daf110546491849bfbe52f
|
|
| MD5 |
57c0819f6477b8c0df1e7a3e521fe17a
|
|
| BLAKE2b-256 |
716c55813eea2b8b73ea7fad08c4ef3e328e288f366f8ba08a5f3c70c32564a9
|