Skip to content

Latest commit

 

History

59 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Evaluating Power Consumption of Python Test Generation using Pynguin

Prerequisites

  • Docker
  • Python 3.10.12

Setup Instructions

  1. Install EnergiBridge
  2. Build the pynguin docker container: docker build -t pynguin-cli .
  3. Use ./pynguin.sh or everywhere instead of the normal pynguin command
  4. In case of write permission errors, you may need to give permissions to the Docker appuser: sudo chown -R 10001:10001 ./tests/
  5. Set up the Python environment using venv or uv

Python Environment Setup w/venv

note: make sure to use Python 3.10.12

  1. Create a python virtual environment:
python -m venv .venv
  1. Activate the virtual environment:
source .venv/bin/activate
  1. Install requirements:
pip install -r requirements.txt
  1. Done, run the experiment

Python Environment Setup w/uv

  1. Generate a venv:
uv venv --seed
  1. Install dependencies:
uv pip install -r requirements.txt

Running the experiment

  1. Rename pyenergibridge_config.json.example to pyenergibridge_config.json:
mv pyenergibridge_config.json{.example,}
  1. Update the binary path in pyenergibridge_config.json to the installation path of the EnergiBridge binary
  2. Create experiment configs in pynguing_configs.json, passing a config name and the pynguin CLI parameters. For example:
[
    //...
    {
        "name": "dynamosa-42",
        "params": {
            "seed": 42,
            "algorithm": "DYNAMOSA"
        }
    }
    //...
]
  1. Run the main.py script:

    • with uv:
    uv run python main.py --allowed-projects codetiming_local,docstring_parser_local --iterations 10
    • with uv from the zen script on macos:
    ./run_zen.sh
    • from .venv:
    .venv/bin/python main.py --allowed-projects codetiming_local,docstring_parser_local --iterations 10

For more information on available command-line options:

python main.py --help

Analysis

To collect the results from the json files and run the analysis, use:

python analysis.py

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages