DEV Community

Hernan Chilabert
Hernan Chilabert

Posted on • Edited on

My AI Unit Test Agent is Alive! Now for Part 2: The QA Agent ๐Ÿค–

Hey everyone!

Just a week ago, I shared that I started building an AI agent to handle my unit tests in Python. Well, the little guy is officially up and running!

Phase 1 is a wrap! The MVP is working as planned: it can analyze a Python file, figure out what's inside, and use an LLM to generate a solid suite of pytest tests. It feels a bit like magic watching it work. I'm super happy with the foundation we've got.

But now... the real fun begins.

Entering Phase 2: The "QA Engineer" Agent

The first agent is the "Dev Engineer"โ€”it writes the code. Now, I'm building its partner: the "QA Engineer" agent.

So, what's its job? This new agent will:

  1. Run the Tests: It will actually execute pytest on the tests the first agent wrote.
  2. Check for Errors: Did the tests pass? Did they fail? Why?
  3. Provide Feedback: It will then go back to the "Dev Engineer" and say something like, "Hey, this test you wrote is failing because of X," or "You missed covering this edge case."

The goal here is to create an autonomous feedback loop. The two agents will collaborate, refine, and improve the tests until they meet a certain quality bar, all on their own. Wild, right?

This is the part of the project I've been most excited about, where it starts to feel less like a script and more like a real, autonomous team.

As always, the project is fully open-source. You can follow along with the progress, check out the code, and see the roadmap on GitHub.

๐Ÿ‘‰ GitHub Repo: herchila/unittest-ai-agent

Thanks for reading and following the journey! Let me know in the comments what you think about this two-agent approach.

Top comments (0)