Skip to main content

Pipeline to create test generators

Project description

SBFT Python Tool Competition Runner

GitHub Actions

The Workshop on The 17th International Search-Based and Fuzz Testing (SBFT) offers a Python tool competition on automatic test generation for the Python programming language.

Python Tool Competition

Important SBFT'24 Python Tool Compeetition Dates

All dates are anywhere on earth (AoE, UTC-12h):

  • Tool Submission: 1. December 2023
  • Results provided to tool authors: 9. January 2024
  • Competition report: 16. January 2024
  • Notification to authors: 21. December 2023
  • Camera ready due: 25. January 2024
  • Author's registration due: TBA
  • Workshop: TBA April 2024

Submission

Submit your test generator by sending an email all organizers:

Your email should include:

  • A link to the repository
    • If the repository is private then invite the competition organizers to the repository
  • The name of the version tag
  • The commit hash of the version tag

Overview

In general, manual testing of software systems is costly. Automatic test generation for Python lowers barriers to test and ensure quality for Python software. Therefore, the SBFT initiates a competition on Python test generation, which enhances research and implementation for novel test generators for Python. This repository provides the necessary facilities and guidelines for participating in the SBFT Python tool competition.

Test Generator Implementation

The platform provides an API for writing test cases. You simply need to generate a string that represent the body of a valid Python testing module that tests a given target with pytest. Furthermore, your test code needs to be compatible with cosmic-ray so that your test suite can be assessed through mutation scores. Below you see how to use the platform to implement a generator.

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:

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.

License

CLI tool for developing python test generators
Copyright (C) 2023  Nicolas Erni

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <https://www.gnu.org/licenses/>.

Improving the Competition Runner

  • Installation: poetry install
  • Testing: tox
  • Use pre-commit if possible.

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

python_tool_competition_2024-0.2.0.tar.gz (36.1 kB view details)

Uploaded Source

Built Distribution

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

python_tool_competition_2024-0.2.0-py3-none-any.whl (55.4 kB view details)

Uploaded Python 3

File details

Details for the file python_tool_competition_2024-0.2.0.tar.gz.

File metadata

  • Download URL: python_tool_competition_2024-0.2.0.tar.gz
  • Upload date:
  • Size: 36.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.0 CPython/3.11.5 Linux/5.15.138-1-MANJARO

File hashes

Hashes for python_tool_competition_2024-0.2.0.tar.gz
Algorithm Hash digest
SHA256 c15bb0fad01557d2c1c00239a1c00e6241ae2a99ee59f89fddc938561ad4b426
MD5 e4aab82b8af23d2447ca93e647a109a5
BLAKE2b-256 8d041540ae4e9b98c37ae8de1bf3d6b14b4ba87955caf507e15877b3e534e6c6

See more details on using hashes here.

File details

Details for the file python_tool_competition_2024-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for python_tool_competition_2024-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bc85f484a6d793854e68e139ae9c542177729aa3f9a1799e5df51bf2c26b0857
MD5 2f26e29547f6d582a0235f206d85b249
BLAKE2b-256 e688e384da095a8048d2806b4ef1cd9425bc32ae334ae58fb437e86593c9fec4

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