AugmenTest is an advanced automated test oracle generation system that leverages Large Language Models (LLMs) to enhance software testing efficiency. The tool generates JUnit test assertions for test cases (automatically generated or developer written) utilizing code documentations and developer code comments, serving as an intelligent oracle for Java applications.
Research Paper: This tool accompanies our paper "AugmenTest: Enhancing Tests with LLM-driven Oracles". The complete replication package is available on Zenodo.
- π§ LLM Integration: Supports multiple LLM backends including GPT-4All and OpenAI
- π§ͺ Automated Assertion Generation: Creates precise test assertions using code context
- π Multi-Variant Prompting: Implements different prompting strategies (Simple, Extended, RAG)
- π Test Augmentation: Enhames existing automatically generated or developer written tests with intelligent oracles
- π Context-Aware: Utilizes code structure, developer comments, code documentations and dependencies
- Python 3.9+
- Java 8+
- GPT4All or OpenAI API access
-
Clone the repository:
git clone git@github.com:se-fbk/augmentest.git cd augmentest -
Set up virtual environment:
python -m venv augmentest_venv source augmentest_venv/bin/activate # Linux/Mac .\augmentest_venv\Scripts\activate # Windows
-
Install dependencies:
pip install -r requirements.txt
-
Change working directory:
cd src/ -
Prepare LLM Models (Choose one option):
Option A: Local GPT4All Models
# Download quantized models from: # https://docs.gpt4all.io/gpt4all_desktop/quickstart.html # Recommended models: # - Nous-Hermes-2-Mistral-7B-DPO.Q4_0.gguf # - mistral-7b-openorca.Q4_0.gguf mkdir -p models/ # Move downloaded .gguf files to models/ directory
Option B: OpenAI API
# No additional downloads needed # Just configure your API key in config.ini
Option C: Other APIs/Models (Gemini/DeepSeek/etc)
# Install additional requirements as needed: # implement the APIs in class: llm_prompter.py
-
Configure environment:
cp config.ini.example config.ini nano config.ini # or use your preferred editorEdit the following sections:
[DEFAULT] ; For Local Models llm_base_path = ./models/ DEFAULT_MODEL = Nous-Hermes-2-Mistral-7B-DPO.Q4_0.gguf ; For OpenAI [openai] api_key = your-api-key-here DEFAULT_MODEL = gpt-4-turbo ; For other APIs # deepseek_api_key = your-key # gemini_api_key = your-key
-
Preprocess Test Cases:
python run_preprocess_test_cases.py <project_dir> <language> # Example: python run_preprocess_test_cases.py /path/to/project java # Note: Currently supports only Java projects (Python support coming soon)
-
Generate Oracles Individually:
python run_oracle_generation.py <test_id> <project_dir> <class_name> <method_name> <model> <variant> <use_comments> # Example: python run_oracle_generation.py T001 /path/to/project MyClass test1 \ Nous-Hermes-2-Mistral-7B-DPO.Q4_0.gguf SIMPLE_PROMPT true
python run_augmentest.py <project_dir> <language>
# Example:
python run_augmentest.py /path/to/project java
# This automatically performs:
# 1. Test case preprocessing
# 2. Oracle generation for all test casesEdit config.ini to customize:
[DEFAULT]
output_dir = ./output/
model_path = ./models/
openai_api_key = your-key-here
# ... other configurations- Local Models:
- GPT4All
- Cloud Models:
- OpenAI GPT-4o
This work accompanies our research paper:
"AugmenTest: Enhancing Tests with LLM-driven Oracles"
π¦ Replication Package:
All experimental data, benchmarks, and additional resources are available in our Zenodo replication package.
π Citation:
@misc{khandaker2025augmentestenhancingtestsllmdriven,
title={AugmenTest: Enhancing Tests with LLM-Driven Oracles},
author={Shaker Mahmud Khandaker and Fitsum Kifetew and Davide Prandi and Angelo Susi},
year={2025},
eprint={2501.17461},
archivePrefix={arXiv},
primaryClass={cs.SE},
url={https://arxiv.org/abs/2501.17461},
}
@dataset{khandaker_2024_13881826,
author = {Khandaker, Shaker Mahmud and
Kifetew, Fitsum and
Prandi, Davide and
Susi, Angelo},
title = {AugmenTest: Enhancing Tests with LLM-driven
Oracles - Replication package
},
month = oct,
year = 2024,
publisher = {Zenodo},
doi = {10.5281/zenodo.13881826},
url = {https://doi.org/10.5281/zenodo.13881826},
}This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
Shaker Mahmud Khandaker (Maintainer)
π§ skhandakerATfbkDOTeu
π www.khandakerrahin.com
π LinkedIn
π¦ @khandakerrahin
Fitsum Meshesha Kifetew
π§ kifetewATfbkDOTeu
π kifetew.github.io
π LinkedIn
Davide Prandi
π§ prandiATfbkDOTeu
π se.fbk.eu/team/prandi
π LinkedIN
Angelo Susi
π§ susiATfbkDOTeu
π se.fbk.eu/team/susi
π LinkedIN
For research-related inquiries, please contact the maintainer with "[AugmenTest Research]" in the subject line.
