pynguin

The PYthoN General UnIt Test geNerator is a test-generation tool for Python

https://github.com/se2p/pynguin

Science Score: 85.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 3 DOI reference(s) in README
  • Academic publication links
    Links to: zenodo.org
  • Committers with academic emails
    9 of 23 committers (39.1%) from academic institutions
  • Institutional organization owner
    Organization se2p has institutional domain (www.fim.uni-passau.de)
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (15.2%) to scientific vocabulary

Keywords

python search-based-software-testing test-generation test-generator testing-tools

Keywords from Contributors

cryptocurrencies

Scientific Fields

Sociology Social Sciences - 87% confidence
Last synced: 6 months ago · JSON representation ·

Repository

The PYthoN General UnIt Test geNerator is a test-generation tool for Python

Basic Info
  • Host: GitHub
  • Owner: se2p
  • License: mit
  • Language: Python
  • Default Branch: main
  • Homepage: https://www.pynguin.eu
  • Size: 7.06 MB
Statistics
  • Stars: 1,318
  • Watchers: 25
  • Forks: 90
  • Open Issues: 19
  • Releases: 59
Topics
python search-based-software-testing test-generation test-generator testing-tools
Created over 5 years ago · Last pushed 6 months ago
Metadata Files
Readme Changelog Contributing License Code of conduct Citation Codeowners Zenodo

README.md

Pynguin

Pynguin (IPA: ˈpɪŋɡuiːn), the PYthoN General UnIt test geNerator, is a tool that allows developers to generate unit tests automatically.

Testing software is often considered to be a tedious task. Thus, automated generation techniques have been proposed and mature tools exist—for statically typed languages, such as Java. There is, however, no fully-automated tool available that produces unit tests for general-purpose programs in a dynamically typed language. Pynguin is, to the best of our knowledge, the first tool that fills this gap and allows the automated generation of unit tests for Python programs.

Internal Pipeline Status [![pipeline status](https://gitlab.infosun.fim.uni-passau.de/se2/pynguin/pynguin/badges/main/pipeline.svg)](https://gitlab.infosun.fim.uni-passau.de/se2/pynguin/pynguin/-/commits/main) [![coverage report](https://gitlab.infosun.fim.uni-passau.de/se2/pynguin/pynguin/badges/main/coverage.svg)](https://gitlab.infosun.fim.uni-passau.de/se2/pynguin/pynguin/-/commits/main)

License MIT Code style: black Ruff PyPI version Supported Python Versions Documentation Status DOI REUSE status Downloads SWH

Pynguin Logo

Attention

Please Note:

Pynguin executes the module under test! As a consequence, depending on what code is in that module, running Pynguin can cause serious harm to your computer, for example, wipe your entire hard disk! We recommend running Pynguin in an isolated environment; use, for example, a Docker container to minimize the risk of damaging your system.

Pynguin is only a research prototype! It is not tailored towards production use whatsoever. However, we would love to see Pynguin in a production-ready stage at some point; please report your experiences in using Pynguin to us.

Prerequisites

Before you begin, ensure you have met the following requirements: - You have installed Python 3.10 (the support for 3.11, 3.12 and 3.13 is experimental).

Attention: Pynguin now requires Python 3.10! Older versions are no longer supported! - You have a recent Linux/macOS/Windows machine.

Please consider reading the online documentation to start your Pynguin adventure.

Installing Pynguin

Pynguin can be easily installed using the pip tool by typing: bash pip install pynguin

Make sure that your version of pip is that of a supported Python version, as any older version is not supported by Pynguin!

Using Pynguin

Before you continue, please read the quick start guide

Pynguin is a command-line application. Once you installed it to a virtual environment, you can invoke the tool by typing pynguin inside this virtual environment. Pynguin will then print a list of its command-line parameters.

A minimal full command line to invoke Pynguin could be the following, where we assume that a project foo is located in /tmp/foo, we want to store Pynguin's generated tests in /tmp/testgen, and we want to generate tests using a whole-suite approach for the module foo.bar (wrapped for better readability): bash pynguin \ --project-path /tmp/foo \ --output-path /tmp/testgen \ --module-name foo.bar Please find a more detailed example in the quick start guide.

Contributing to Pynguin

For the development of Pynguin you will need the poetry dependency management and packaging tool. To start developing, follow these steps: 1. Clone the repository 2. Change to the pynguin folder: cd pynguin 3. Create a virtual environment and install dependencies using poetry: poetry install 4. Make your changes 5. Run make check to verify that your changes pass all checks

Please see the poetry documentation for more information on this tool.

Contributors

Pynguin is developed at the Chair of Software Engineering II of the University of Passau.

Maintainers: Stephan Lukasczyk, Lukas Krodinger

Contributors: - Altin Hajdari - Abdelillah Aissani - Juan Altmayer Pizzorno - Lucas Berg - Tucker Blue - Gordon Fraser - Abdur-Rahmaan Janhangeer - Maximilian Königseder - Florian Kroiß - Simon Labrenz - Roman Levin - Juan Julián Merelo Guervós - Lukas Steffens - Florian Straubinger - Sara Tavares

Development using PyCharm.

If you want to use the PyCharm IDE you have to set up a few things: 1. Import pynguin into PyCharm. 2. Let PyCharm configure configure a virtual environment using poetry. 3. Set the default test runner to pytest 4. Set the DocString format to Google

License

This project is licensed under the terms of the MIT License. Pynguin was using the GNU Lesser General Public License (LGPL) until version 0.29.0, its licence was changed with version 0.30.0.

Star History

Star History Chart

Owner

  • Name: Chair of Software Engineering II, Uni Passau
  • Login: se2p
  • Kind: organization
  • Location: Passau, Germany

Citation (CITATION.cff)

# vim: set ft=yaml ts=2 sts=2 sw=2 expandtab:
# SPDX-FileCopyrightText: 2019–2025 Pynguin Contributors
#
# SPDX-License-Identifier: CC0-1.0
cff-version: "1.2.0"
authors:
  - family-names: Lukasczyk
    given-names: Stephan
    orcid: "https://orcid.org/0000-0002-0092-3476"
  - family-names: Kroiß
    given-names: Florian
  - family-names: Steffens
    given-names: Lukas
  - family-names: Straubinger
    given-names: Florian
  - family-names: Labrenz
    given-names: Simon
  - family-names: Fraser
    given-names: Gordon
    orcid: "https://orcid.org/0000-0002-4364-6595"
doi: "10.5281/zenodo.3989840"
identifiers:
  - type: doi
    value: 10.5281/zenodo.3989840
    description: General DOI for Pynguin pointing to the latest version automatically.
keywords:
  - python
  - "test generation"
  - "unit test"
license: "MIT"
references:
  - authors:
    - family-names: Lukasczyk
      given-names: Stephan
    - family-names: Fraser
      given-names: Gordon
    title: "Pynguin: Automated Unit Test Generation for Python"
    doi: 10.1145/3510454.3516829
    conference:
      name: "44th International Conference on Software Engineering Companion (ICSE '22 Companion)"
    type: conference-paper
    year: 2022
  - authors:
    - family-names: Lukasczyk
      given-names: Stephan
    - family-names: Kroiß
      given-names: Florian
    - family-names: Fraser
      given-names: Gordon
    title: An empirical study of automated unit test generation for python
    type: article
    journal: Empirical Software Engineering
    doi: 10.1007/s10664-022-10248-w
    volume: 28
    number: 2
    year: 2023
  - authors:
    - family-names: Lukasczyk
      given-names: Stephan
    - family-names: Kroiß
      given-names: Florian
    - family-names: Fraser
      given-names: Gordon
    title: Automated Unit Test Generation for Python
    doi: 10.1007/978-3-030-59762-7_2
    conference:
      name: "12th International Symposium on Search-Based Software Engineering (SSBSE)"
    type: conference-paper
    year: 2020
message: "If you use this software, please cite it using these metadata."
repository-code: "https://github.com/se2p/pynguin"
title: "Pynguin"
preferred-citation:
  type: conference-paper
  authors:
  - family-names: Lukasczyk
    given-names: Stephan
    orcid: "https://orcid.org/0000-0002-0092-3476"
  - family-names: Fraser
    given-names: Gordon
    orcid: "https://orcid.org/0000-0002-4364-6595"
  doi: 10.1145/3510454.3516829
  conference:
    name: "44th International Conference on Software Engineering Companion (ICSE '22 Companion)"
  title: "Pynguin: Automated Unit Test Generation for Python"
  year: 2022

GitHub Events

Total
  • Create event: 7
  • Release event: 3
  • Issues event: 30
  • Watch event: 69
  • Issue comment event: 97
  • Push event: 98
  • Pull request review event: 36
  • Pull request review comment event: 33
  • Pull request event: 21
  • Fork event: 18
Last Year
  • Create event: 7
  • Release event: 3
  • Issues event: 30
  • Watch event: 69
  • Issue comment event: 97
  • Push event: 98
  • Pull request review event: 36
  • Pull request review comment event: 33
  • Pull request event: 21
  • Fork event: 18

Committers

Last synced: 9 months ago

All Time
  • Total Commits: 3,476
  • Total Committers: 23
  • Avg Commits per committer: 151.13
  • Development Distribution Score (DDS): 0.641
Past Year
  • Commits: 456
  • Committers: 9
  • Avg Commits per committer: 50.667
  • Development Distribution Score (DDS): 0.673
Top Committers
Name Email Commits
Stephan Lukasczyk s****n@l****e 1,249
Florian Kroiss k****s@f****e 1,231
Simon Labrenz s****z@o****e 248
Berg Lucas 5****s 197
lukas l****r@g****m 149
Lukas Steffens s****s@f****e 114
Abdelillah Aissani y****u@e****m 114
AltinHajdari a****4@g****m 72
Florian Straubinger s****e@f****e 68
Gordon Fraser g****r@u****e 12
Maximilian Koenigseder k****d@m****e 5
Sara Tavares 2****3 2
Lukas Steffens l****7@o****e 2
Juan Altmayer Pizzorno j****n@a****m 2
Maximilian Koenigseder k****d@v****e 2
Maximilian Koenigseder k****d@z****e 2
Abdur-Rahmaan Janhangeer c****r@g****m 1
Emmanuel Ferdman e****n@g****m 1
Juan Julián Merelo Guervós j****o@g****m 1
adamaissani a****r@g****m 1
Maximilian Koenigseder k****d@d****e 1
Lukas Krodinger k****r@f****e 1
Tucker Blue me@t****s 1

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 76
  • Total pull requests: 56
  • Average time to close issues: 3 months
  • Average time to close pull requests: 26 days
  • Total issue authors: 61
  • Total pull request authors: 14
  • Average comments per issue: 2.91
  • Average comments per pull request: 1.54
  • Merged pull requests: 37
  • Bot issues: 0
  • Bot pull requests: 1
Past Year
  • Issues: 20
  • Pull requests: 29
  • Average time to close issues: about 2 months
  • Average time to close pull requests: 14 days
  • Issue authors: 14
  • Pull request authors: 4
  • Average comments per issue: 3.65
  • Average comments per pull request: 1.9
  • Merged pull requests: 17
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • BergLucas (12)
  • exKAZUu (3)
  • tovmeod (2)
  • Andres981231 (2)
  • fhg-isi (1)
  • vballestrini (1)
  • xdb64 (1)
  • sjswerdloff (1)
  • JoaoMaio (1)
  • MarineChap (1)
  • mshnschnko (1)
  • mohrez86 (1)
  • zzctmac (1)
  • banzo (1)
  • freddiewanah (1)
Pull Request Authors
  • BergLucas (34)
  • PNejr10 (6)
  • jaltmayerpizzorno (2)
  • stavares843 (2)
  • seva781 (2)
  • emmanuel-ferdman (2)
  • LuKrO2011 (1)
  • dependabot[bot] (1)
  • Ben-Hampson (1)
  • romanlevin (1)
  • JJ (1)
  • tuckcodes (1)
  • Abdur-rahmaanJ (1)
  • Kucki2018 (1)
Top Labels
Issue Labels
enhancement (1)
Pull Request Labels
dependencies (1)

Packages

  • Total packages: 2
  • Total downloads:
    • pypi 2,770 last-month
  • Total dependent packages: 0
    (may contain duplicates)
  • Total dependent repositories: 13
    (may contain duplicates)
  • Total versions: 78
  • Total maintainers: 1
pypi.org: pynguin

Pynguin is a tool for automated unit test generation for Python

  • Versions: 57
  • Dependent Packages: 0
  • Dependent Repositories: 13
  • Downloads: 2,770 Last month
Rankings
Stargazers count: 1.9%
Dependent repos count: 4.0%
Downloads: 4.1%
Average: 5.1%
Forks count: 5.4%
Dependent packages count: 10.1%
Maintainers (1)
Last synced: 6 months ago
conda-forge.org: pynguin

Unit test automated generation techniques have been proposed and mature tools exist for statically typed languages, such as Java. Pynguin is on of the first tool that fills this gap and allows the automated generation of unit tests for Python programs.

  • Versions: 21
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Stargazers count: 11.7%
Forks count: 23.8%
Average: 30.2%
Dependent repos count: 34.0%
Dependent packages count: 51.2%
Last synced: 6 months ago

Dependencies

docs/requirements.txt pypi
  • alabaster ==0.7.12
  • astmonkey ==0.3.6
  • astroid ==2.11.6
  • atomicwrites ==1.4.0
  • attrs ==21.4.0
  • babel ==2.10.3
  • bandit ==1.7.4
  • black ==22.6.0
  • bytecode ==0.13.0
  • certifi ==2022.6.15
  • cfgv ==3.3.1
  • charset-normalizer ==2.1.0
  • click ==8.1.3
  • colorama ==0.4.5
  • commonmark ==0.9.1
  • coverage ==6.4.1
  • darglint ==1.8.1
  • dill ==0.3.5.1
  • distlib ==0.3.4
  • docutils ==0.18.1
  • dparse ==0.5.1
  • exceptiongroup ==1.0.0rc8
  • execnet ==1.9.0
  • filelock ==3.7.1
  • flake8 ==4.0.1
  • gitdb ==4.0.9
  • gitpython ==3.1.27
  • hypothesis ==6.48.2
  • identify ==2.5.1
  • idna ==3.3
  • imagesize ==1.4.0
  • iniconfig ==1.1.1
  • isort ==5.10.1
  • jellyfish ==0.9.0
  • jinja2 ==3.1.2
  • lazy-object-proxy ==1.7.1
  • markupsafe ==2.1.1
  • mccabe ==0.6.1
  • mutpy-pynguin ==0.7.1
  • mypy ==0.961
  • mypy-extensions ==0.4.3
  • networkx ==2.8.2
  • nodeenv ==1.7.0
  • ordered-set ==4.1.0
  • packaging ==21.3
  • pathspec ==0.9.0
  • pbr ==5.9.0
  • platformdirs ==2.5.2
  • pluggy ==1.0.0
  • pre-commit ==2.19.0
  • py ==1.11.0
  • pycodestyle ==2.8.0
  • pydot ==1.4.2
  • pyflakes ==2.4.0
  • pygments ==2.12.0
  • pylint ==2.14.4
  • pylint-print ==1.0.0
  • pyparsing ==3.0.9
  • pytest ==7.1.2
  • pytest-cov ==3.0.0
  • pytest-forked ==1.4.0
  • pytest-mock ==3.8.1
  • pytest-picked ==0.4.6
  • pytest-xdist ==2.5.0
  • pytz ==2022.1
  • pyupgrade ==2.34.0
  • pyyaml ==6.0
  • requests ==2.28.1
  • rich ==12.4.4
  • ruamel.yaml ==0.17.21
  • ruamel.yaml.clib ==0.2.6
  • safety ==2.0.0
  • simple-parsing ==0.0.20
  • six ==1.16.0
  • smmap ==5.0.0
  • snowballstemmer ==2.2.0
  • sortedcontainers ==2.4.0
  • sphinx ==5.0.2
  • sphinx-autodoc-typehints ==1.18.3
  • sphinxcontrib-applehelp ==1.0.2
  • sphinxcontrib-devhelp ==1.0.2
  • sphinxcontrib-htmlhelp ==2.0.0
  • sphinxcontrib-jsmath ==1.0.1
  • sphinxcontrib-qthelp ==1.0.3
  • sphinxcontrib-serializinghtml ==1.1.5
  • stevedore ==3.5.0
  • termcolor ==1.1.0
  • tokenize-rt ==4.2.1
  • toml ==0.10.2
  • tomli ==2.0.1
  • tomlkit ==0.11.0
  • typing-extensions ==4.2.0
  • typing-inspect ==0.7.1
  • urllib3 ==1.26.9
  • virtualenv ==20.15.1
  • wrapt ==1.14.1
poetry.lock pypi
  • alabaster 0.7.12 develop
  • babel 2.10.3 develop
  • bandit 1.7.4 develop
  • certifi 2022.6.15 develop
  • cfgv 3.3.1 develop
  • charset-normalizer 2.1.0 develop
  • coverage 6.4.1 develop
  • darglint 1.8.1 develop
  • dill 0.3.5.1 develop
  • distlib 0.3.4 develop
  • docutils 0.18.1 develop
  • dparse 0.5.1 develop
  • exceptiongroup 1.0.0rc8 develop
  • execnet 1.9.0 develop
  • filelock 3.7.1 develop
  • flake8 4.0.1 develop
  • gitdb 4.0.9 develop
  • gitpython 3.1.27 develop
  • hypothesis 6.48.2 develop
  • identify 2.5.1 develop
  • idna 3.3 develop
  • imagesize 1.4.0 develop
  • isort 5.10.1 develop
  • mccabe 0.6.1 develop
  • mypy 0.961 develop
  • nodeenv 1.7.0 develop
  • pbr 5.9.0 develop
  • pre-commit 2.19.0 develop
  • pycodestyle 2.8.0 develop
  • pyflakes 2.4.0 develop
  • pylint 2.14.4 develop
  • pylint-print 1.0.0 develop
  • pytest-cov 3.0.0 develop
  • pytest-forked 1.4.0 develop
  • pytest-mock 3.8.1 develop
  • pytest-picked 0.4.6 develop
  • pytest-sugar 0.9.4 develop
  • pytest-xdist 2.5.0 develop
  • pytz 2022.1 develop
  • pyupgrade 2.34.0 develop
  • requests 2.28.1 develop
  • ruamel.yaml 0.17.21 develop
  • ruamel.yaml.clib 0.2.6 develop
  • safety 2.0.0 develop
  • six 1.16.0 develop
  • smmap 5.0.0 develop
  • snowballstemmer 2.2.0 develop
  • sortedcontainers 2.4.0 develop
  • sphinx 5.0.2 develop
  • sphinx-autodoc-typehints 1.18.3 develop
  • sphinxcontrib-applehelp 1.0.2 develop
  • sphinxcontrib-devhelp 1.0.2 develop
  • sphinxcontrib-htmlhelp 2.0.0 develop
  • sphinxcontrib-jsmath 1.0.1 develop
  • sphinxcontrib-qthelp 1.0.3 develop
  • sphinxcontrib-serializinghtml 1.1.5 develop
  • stevedore 3.5.0 develop
  • tokenize-rt 4.2.1 develop
  • toml 0.10.2 develop
  • tomlkit 0.11.0 develop
  • urllib3 1.26.9 develop
  • virtualenv 20.15.1 develop
  • astmonkey 0.3.6
  • astroid 2.11.6
  • atomicwrites 1.4.0
  • attrs 21.4.0
  • black 22.6.0
  • bytecode 0.13.0
  • click 8.1.3
  • colorama 0.4.5
  • commonmark 0.9.1
  • iniconfig 1.1.1
  • jellyfish 0.9.0
  • jinja2 3.1.2
  • lazy-object-proxy 1.7.1
  • markupsafe 2.1.1
  • mutpy-pynguin 0.7.1
  • mypy-extensions 0.4.3
  • networkx 2.8.2
  • ordered-set 4.1.0
  • packaging 21.3
  • pathspec 0.9.0
  • platformdirs 2.5.2
  • pluggy 1.0.0
  • py 1.11.0
  • pydot 1.4.2
  • pygments 2.12.0
  • pyparsing 3.0.9
  • pytest 7.1.2
  • pyyaml 6.0
  • rich 12.4.4
  • simple-parsing 0.0.20
  • termcolor 1.1.0
  • tomli 2.0.1
  • typing-extensions 4.2.0
  • typing-inspect 0.7.1
  • wrapt 1.14.1
.github/workflows/ci.yml actions
  • abatilo/actions-poetry v2.0.0 composite
  • actions/checkout v2 composite
  • actions/setup-python v2 composite
docker/Dockerfile docker
  • python 3.10.9-slim-bullseye build
pyproject.toml pypi
  • Jinja2 ^3.1.2
  • MutPy-Pynguin ^0.7.1
  • Pygments ^2.14.0
  • asciitree ^0.3.3
  • astroid ^2.13.2
  • black ^23.1.0
  • bytecode 0.13
  • jellyfish ^0.9.0
  • libcst ^0.4.9
  • networkx ^3.0
  • pytest ^7.2.1
  • python >=3.10, <3.11
  • requests ^2.28.2
  • rich ^13.3.1
  • simple-parsing ^0.0.21.post1
  • typing_inspect ^0.8.0