utfuzz
is a Python fuzzing engine. It supports fuzzing of Python code and generation reproducing code for error and regression suites.
utfuzz
supports Python versions 3.8-3.11
You can use one of these ways:
- Install from package archive:
- download utfuzz.tar.gz
- run
python -m pip install utfuzz.tar.gz
To run utfuzz
you can use module python -m utfuzz
or command utfuzz
with active python environment.
utfuzz
depends on Java 17 and newer. If you don't have an installed Java utfuzz
will try to install it or your can install Java by yourself using these instructions:
Java installation instruction for Linux
Java installation instruction for Windows
Java installation instruction for MacOS
To run:
python -m utfuzz
or
utfuzz
You can use utfuzz
one of three modes:
- dialog mode (default)
- config file mode
- CLI arguments mode
After each test generation settings will be saved to file utfuzz_config.json
Priority:
- if
--use_config_file
default values will be from config file - if not
--use_config_file
default values will be from cli-arguments - then if not
--skip-dialog
new values will be from dialog
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. It supports fuzzing of Python code and
generation reproducing code for error and regression suites
options:
-h, --help show this help message and exit
--skip-dialog Do not ask parameters before execution
--use-config-file Use config file in 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 test generation process per one
class or group of top-level functions from one file
-p PROJECT_DIR, --project-dir PROJECT_DIR
Root directory with your code for testing (will be
used for imports and dependencies resolving)
-o OUTPUT_DIR, --output-dir OUTPUT_DIR
Directory for generated tests collecting
--sys-paths [SYS_PATHS ...]
Additional path to find imports(will be added to
`sys.path`, default = project directory) [optional]
--analyze-targets [ANALYZE_TARGETS ...]
List of files or directories for testing, empty means
<<test all>> [optional]
--requirements-file REQUIREMENTS_FILE
Path to requirements.txt [optional]
--debug Use debug mode
See also main website of UnitTestBot project: utbot.org
You can change UnitTestBot source java file by changing jar
-file utfuzz/utbot-cli-python.jar
(Note: don't change the file name).
After replacing jar
-file you should reinstall this module.
See also main website of UnitTestBot project and GitHub repository.