Skip to content

Latest commit

History

14 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

AgenticTesting

Choose a repo. Set a coverage target. Let agents grow the test suite.

PythonLicenseStatus


✨ What It Does

AgenticTesting is a local-first framework for AI-assisted test generation. It measures a repository's current line coverage, asks agents to reason about the gaps, lets them add or improve tests through constrained repo tools, and repeats until the requested target is reached.

The core loop is intentionally simple:

StepAgent / SystemJob
1Coverage runnerMeasures current line coverage
2AnalyzerFinds useful test gaps
3PlannerChooses the next focused test task
4ImplementerEdits tests through safe repo tools
5ReviewerReviews the result and guides the next loop

The loop stops when the requested line coverage is reached or the iteration limit is exhausted.

🚀 Quick Start

git clone https://github.com/sl-badcoder/AgenticTesting.git
cd AgenticTesting
python -m venv .venv
source .venv/bin/activate
pip install pytest pytest-cov cryptography
python -m src.frontend.debug_ui

Open:

http://127.0.0.1:8765

On first launch, create a local user. Then select a repository, target coverage, project type, provider, and model.

🧭 Highlights

The UI is the primary workflow. It is designed for repeated local use: pick a project, tune the target, choose a model, run the agents, inspect the result, and come back later with your settings still saved.

AreaSupport
UILocal browser dashboard with saved settings
Repo pickermacOS Finder dialog via osascript, plus in-page fallback
Local modelsllama.cpp GGUF, Hugging Face Transformers
API modelsOpenAI, Anthropic
Project profilesPython, .NET, C++ GoogleTest, Jest, Custom
Credential storageSQLite + encrypted API keys
Password storageSalted PBKDF2-HMAC-SHA256 hashes
Repo safetyRelative file tools and command allowlists

🖥️ Web UI

Start the UI:

python -m src.frontend.debug_ui

The dashboard stores useful local state:

Stored itemPurpose
Last repoPre-fills the next run
Target coverageReuses your preferred threshold
Provider/modelKeeps your LLM setup
API keysEncrypted locally for OpenAI/Anthropic
Run historyShows recent results

Local files are created under:

.agentic_testing/
├── app.db
└── secret.key

Keep this folder private. It is ignored by Git.

🧪 Project Profiles

The selected profile controls the default coverage command and the test style guidance sent to the agents.

ProfileTest styleCoverage command
Python / pytestpytest testspytest --cov=. --cov-report=term-missing
.NETxUnit, NUnit, or MSTestdotnet test /p:CollectCoverage=true /p:CoverletOutputFormat=opencover
C++ / GoogleTestTEST / TEST_F casesgcovr --txt
JS/TS / JestJest testsnpm test -- --coverage
CustomExisting repo conventionsEditable command

The command is still editable in the UI for custom build systems.

🤖 Providers

Use a hosted model when you want stronger reasoning, or a local model when you want everything to stay on your laptop.

ProviderInstallNotes
FakeBuilt inDry runs and tests
OpenAIpip install openaiAPI key saved encrypted in UI
Anthropicpip install anthropicAPI key saved encrypted in UI
llama.cpppip install llama-cpp-pythonUses local GGUF model paths
Hugging Facepip install transformers torch accelerateUses model ids and local cache

⚙️ CLI

The UI is the main workflow, but a CLI exists for automation:

python -m src.agentic_testing_cli /path/to/repo 80 --provider fake

Examples:

python -m src.agentic_testing_cli /path/to/repo 85 \
--provider openai \
--model gpt-4.1-mini
python -m src.agentic_testing_cli /path/to/repo 80 \
--provider llama.cpp \
--model-path /path/to/model.gguf

🧱 Architecture

The code is split between the app shell, the agentic testing loop, provider integrations, and reusable database/cache infrastructure.

src/
├── app/ # Local user, credentials, preferences
├── core/ # Coverage loop, workspace tools, project profiles
├── database/ # Database adapters and cache layer
├── frontend/ # Web UI, agents, LLM providers
├── agentic_testing_cli.py
└── local_agent_cli.py

Core modules:

ModuleResponsibility
src/core/agentic_testing.pyMain analyzer/planner/implementer/reviewer loop
src/core/coverage.pyCoverage command runner and parser
src/core/workspace.pySafe file and command operations
src/core/project_profiles.pyProject profile presets
src/app/storage.pySQLite app state
src/app/security.pyPassword hashing and API-key encryption

✅ Testing

pytest

Current coverage includes:

AreaCovered
UI parsing/renderingYes
User/password storageYes
Encrypted API keysYes
Provider factoryYes
Coverage parsingYes
Workspace safetyYes
Database/cache adaptersYes

🔐 Security Notes

The UI stores secrets locally because API-backed providers need reusable credentials. Passwords use a different model: they are never encrypted for later recovery, only hashed for verification.

DataStorage
PasswordsSalted PBKDF2-HMAC-SHA256 hash
API keysFernet-encrypted ciphertext
App DB.agentic_testing/app.db
Encryption key.agentic_testing/secret.key

API keys must be decryptable so the selected provider can use them. Passwords are never decrypted because they are not stored reversibly.

📄 License

Released under the MIT License.

About

An automatic testing framework based on an agentic AI layer.

Resources

Stars

2 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages