A proof of concept script for improving unit test coverage of a project (keon/algorithms) using the Gemini LLM API. For more details, see the blog post.
The script executes code generated by the LLM. While in tests the model hasn't generated any damaging code, it is safest to isolate the script from the important files by running it in a VM or a Docker container:
./docker_activate.sh
Then, in the container, checkout keon/algorithm project, prepare venv and install dependencies by running:
./setup.sh
Finally, run the script:
source ./venv/bin/activate;
export GEMINI_API_KEY='your API key from https://aistudio.google.com/'
python gemini_unit_tests_gen.py