Solving bugs using AI

There are several AI tools, like Windsurf and ChatGPT that allows you to analyse your code and change or add code to it. While vibe coding is about creating a solution, using AI, you can also use it to solve bugs. In this blog post I will dive into the pro’s and con’s I discovered when using AI to analyse and fixing bugs.

Adapting code

Like when doing vibe coding, the models tent to have issues when changing code in a consistent way. Normally the model won’t give you the correct answers or solutions within the first question. Within the area of vibe coding, the first prompt doesn’t also lead to the desired solution. So you will spend multiple iterations to fine-tune the solution until you reach the point you come up with the solution you want. When going from iteration to iteration, you see that the model tries to introduce changes that will break your code or doesn’t lead to the desired outcome. That also requires you to tell the model it failed, so you will back and forth multiple times.

I see the same when tackling bugs. At some point the model moves to a different thinking direction, which then will lead to issues.

Providing new insights

This leads us to another point of using AI when solving bugs, it will provide you sometimes new insights you didn’t check or wasn’t aware of. This mainly is driven by models which use reasoning. In this way it explains it “thoughts” and how it came to it’s conclusion. Even though it is not correct the first time, these insights can give you some hints you didn’t think off yourself.

Some models also try to add logging to see what is going on. This will also help you within the thinking process.

Not well documented frameworks and languages

It works well with frameworks and languages that are well described on the internet. Since these models train on information they got from the internet, they also only know what is available to them.

If a newer version of a certain library pops up, it also have difficulties when applying a solution to your bug when you are using this newer version that isn’t known by the model.

Clean code

When your code is bad designed, the model has also problems with finding a proper solution for your problem. The model most of the times reasons like a programmer is doing, looking at names of classes and variables. If the classes and variables for example have proper names, it makes it easier for the model to understand the logic of your code.

It can solve bugs, but not find them

The AI model doesn’t have a complete overview of your requirements, so in that sense it also can’t know what you are trying to accomplish and if the code actually does this. Like any LINT tool it could find code construction issues, and help you to fix those. This is because construction issues most of the time break general rules of code construction. Having said that, the same goes for the fact if a lot of people do make the same mistake. Then the model is probably also trained in such a way it doesn’t notice a possible issue with your code.

You are responsible

Concluding, I tend to see the tool as a junior software developer who you will give a task it need to perform. It will then come back to you, explained what it thought (when using a reasoning model), showing a solution which you then need to validate yourself. When you are fine with the opposed solution, you can then apply it to your code.

Posted in Uncategorized by Bruno at August 15th, 2025.

Leave a Reply