Skip to main content

No project description provided

Project description

utfuzz

utfuzz is a Python fuzzing engine, generating ready-to-use unit tests for both error and regression suites.

Prerequisites

utfuzz supports Python 3.8–3.11.

utfuzz depends on Java 17 and newer. If you do not have Java installed, utfuzz will install it, or your can do it manually using these instructions:

Installation

  • Install from archive:

    1. Download utfuzz.tar.gz
    2. Run:
    python -m pip install utfuzz.tar.gz
    
  • Install from GitLab repository:

    python -m pip install git+https://gitlab.com/tamarinvs19/utfuzz
    
  • Install from source code:

    git clone https://gitlab.com/tamarinvs19/utfuzz
    cd utfuzz
    python -m pip install ./
    

Usage

You can run utfuzz in one of three modes:

  • dialogue mode (default)
  • config file mode
  • CLI arguments mode

Upon each test generation, settings are saved to the utfuzz_config.json file.

Generate tests in a dialogue mode

By default, utfuzz runs in a dialogue mode. You can use prompts and configure test generation, or stick to default options:

python -m utfuzz

or

utfuzz

The resulting tests appear in the autogenerated utfuzz_tests folder by default.

Generate tests using CLI options

Turn off the dialogue mode with –-skip-dialog and specify the necessary options, for example:

python -m utfuzz –-skip-dialog -o /mnt/c/Users/username/uftests

Generate tests using a configuration file

Edit the utfuzz_config.json file and enable the --use-config-file option:

python -m utfuzz --use-config-file

Run tests

Run the generated tests as the usual unittest ones.

Options

usage: utfuzz [-h] [--skip-dialog] [--use-config-file] [--generate-only-error-suite] 
              [-j JAVA] [-t TIMEOUT] [-p PROJECT_DIR] [-o OUTPUT_DIR] [--sys-paths [SYS_PATHS ...]]
              [--analyze-targets [ANALYZE_TARGETS ...]] [--requirements-file REQUIREMENTS_FILE] [--debug]

utfuzz is a Python fuzzing engine, generating ready-to-use unit tests for both error and regression suites.

options:
  -h, --help            show this help message and exit
  --skip-dialog         do not ask for options interactively
  --use-config-file     use config file from current directory
  --generate-only-error-suite
                        generate only error suite
  -j JAVA, --java JAVA  path to Java executable file or JAVA_HOME
  -t TIMEOUT, --timeout TIMEOUT
                        timeout in seconds for generating tests per class or group of top-level functions from one file
  -p PROJECT_DIR, --project-dir PROJECT_DIR
                        root directory with code under test (used for imports and dependency resolving)
  -o OUTPUT_DIR, --output-dir OUTPUT_DIR
                        directory for generated tests
  --sys-paths [SYS_PATHS ...]
                        additional path to find imports (will be added to `sys.path`; default = project directory)
  --analyze-targets [ANALYZE_TARGETS ...]
                        list of files or directories to test; empty value field means <<test all>>
  --requirements-file REQUIREMENTS_FILE
                        path to requirements.txt
  --debug               use debug mode

utfuzz has the UnitTestBot fuzzing engine inside. To change the version of the UnitTestBot source, replace it with the necessary utfuzz/utbot-cli-python.jar file (do not change the file name). Upon replacing, remember to reinstall this module.

For more information, see the UnitTestBot website and the related GitHub repository.

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

utfuzz-0.1.14.tar.gz (36.4 MB view details)

Uploaded Source

Built Distribution

utfuzz-0.1.14-py3-none-any.whl (36.4 MB view details)

Uploaded Python 3

File details

Details for the file utfuzz-0.1.14.tar.gz.

File metadata

  • Download URL: utfuzz-0.1.14.tar.gz
  • Upload date:
  • Size: 36.4 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.5.1 CPython/3.11.5 Linux/6.5.8-arch1-1

File hashes

Hashes for utfuzz-0.1.14.tar.gz
Algorithm Hash digest
SHA256 b0c860cbb5c263b6dc440eaf28b2cfa01532c7b271efd9de91fba20ae8b8c5ee
MD5 8936b7c311f4e401f0be39819b4aae75
BLAKE2b-256 517023f5d96af285af2712b1d3b84f1c3a87caaff99c50689dc6a8169caff14a

See more details on using hashes here.

File details

Details for the file utfuzz-0.1.14-py3-none-any.whl.

File metadata

  • Download URL: utfuzz-0.1.14-py3-none-any.whl
  • Upload date:
  • Size: 36.4 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.5.1 CPython/3.11.5 Linux/6.5.8-arch1-1

File hashes

Hashes for utfuzz-0.1.14-py3-none-any.whl
Algorithm Hash digest
SHA256 cf248ca17b2bfe649ab0d6bd4fdfb8e31391e68f8491af3f8d105b8221282954
MD5 6901fe7fc97f3d3fbf3957063bc891e7
BLAKE2b-256 66b447e19d61dd3b4b38b12d5f255c21dabc43258ac1cdd5b1ddbd5fce5c7f01

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page