AI Test driven development

Currently, AI-powered tools are able to help junior developers with code explanation and completions, but with more complex problems, they fall short.

As a senior developer, I expect much more from AI-powered tools. Most software has complex codebases and tests to ensure they are production-ready.

My dev workflow is to write my tests first. These tests describe the behavior of my application and define its features. A killer feature for me would be the ability to write a test, and then have the IDE/AI tool run my test and generate the files and code to make the test pass. Inside the TDD feedback loop, the AI would be able to evaluate its code generation and improve it until the test passes.

To go further :

1 Like

TDD-AI-demo-V0.1-GIF

I created a POC to test the feasibility, the result is quite good, but I guess with all the cursor AI features it could be much better

Big fan of AI-assisted TDD here; I included mention of it in a recent post:

An Idiot’s Guide To Bigger Projects

and went into more detail about it in one of the replies.

I really like your suggestions about making it better integrated into the workflow, making the iterations more automated. Instead of feeling like you’re repeating half a dozen steps and context-switching between them (and manually pasting back test results for the model to read), it would be great to feel like you’re repeating the same one overarching step and having the automation take care of the mechanics. It would be a much better way to stay in ‘flow’.

+1 from me.

3 Likes

I 100% agree with this

1 Like

what you are describing already exists… and its free GitHub - BuilderIO/micro-agent: An AI agent that writes (actually useful) code for you

1 Like

Nice ! I didn’t know this project. But it’s not exactly what I’m looking for…

Here what they say in the doc : “This project won’t install modules, read and write multiple files, or do anything else that is highly likely to cause havoc when it inevitably fails.
It’s a micro agent. It’s small, focused, and does one thing as well as possible: write a test, then produce code that passes that test.”

I want to write my test, and then the ai agent must be able to create or modify multiple files inside my project to pass the test

Hi everyone !

Since I didn’t find any good alternative, I created Milow, the Test-Driven AI Assistant ! :rocket:

Feel free to try it and give me some feedback