Skip to content

Repository files navigation

🧪 AI Code Quality Agent

Does your AI-generated test suite actually test anything — or does it just look good?

An agent that generates unit tests with AI, then proves the tests are real by trying to break the code and checking that the tests notice.


🚩 The Problem

AI coding assistants make it trivial to generate tests in seconds. The catch: a test can pass without actually checking anything meaningful. That gap is invisible in a normal test run — everything shows green — until a real bug slips through in production.

💡 The Idea

Step What happens
1️⃣ Generate Give the agent one .NET class → it writes a unit test suite for it
2️⃣ Attack The agent deliberately introduces small bugs ("mutants") into the code, one at a time
3️⃣ Check If the tests catch the bug → good. If a bug slips through undetected → that test suite has a blind spot
4️⃣ Fix For every blind spot found, the agent explains the gap and writes a new test that closes it
5️⃣ Repeat Steps 2–4 repeat (with a limit) until the suite is proven solid — or every remaining gap is documented and explained
flowchart LR
    A[📄 Target class] --> B[🤖 Generate tests]
    B --> C[🧬 Mutation testing<br/>= try to break the code]
    C -->|Bug caught| D[✅ Confirmed effective]
    C -->|Bug missed| E[🔎 Explain the gap]
    E --> F[✍️ Write a targeted test]
    F --> C
    D --> G[📊 Final report:<br/>score + what was fixed + what's left]
Loading

In plain terms: instead of trusting that AI-written tests are good because they pass, this tool makes them earn that trust — or tells you exactly where they fall short.

🎯 Why It Matters

  • ✅ Confidence before merging AI-authored code into a shared codebase
  • ✅ No more "the tests passed" as a false sense of security
  • ✅ Every gap that's found is either fixed automatically or documented with a reason — nothing is silently swept under the rug

📍 Status

Phase 📝 Planning complete for the core feature — implementation not started
Details specs/001-mutation-guided-test-generation/
Timeline 2 weeks, see BACKLOG.md for the full plan and schedule

🛠️ Built With

.NET 10 · Semantic Kernel · OpenAI / Azure OpenAI · Stryker.NET (mutation testing) · xUnit

About

.NET agent (Semantic Kernel + Stryker.NET) that generates tests and self-improves them using mutation-testing feedback, closing real coverage gaps.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages