Back to articles
Stop Explaining Bugs to AI - Show It the Bug

Stop Explaining Bugs to AI - Show It the Bug

via Dev.to WebdevBrady Stroud

I found a better way to debug bugs with AI. AI is brilliant at code-level reasoning, but sometimes it's painful to provide enough context of a bug to get a useful output. So if you're trying to debug by describing the bug in chat, you can waste a lot of time. A better approach is to stop explaining and start showing. The Pattern That Works When the AI can't reliably drive your UI, do this: Tell the UI to add targeted logs around the action path. It knows what to log and where to put it. Reproduce the bug yourself in the app. Write the logs to a file. Let the AI read the file and debug from facts, not guesses. This works well, lately I've fixed heaps of bugs this way. My prompt: There is a bug with xxx feature where yyy happens. 1. Add logs in that area and log to a local file. 2. Ask me to reproduce the bug a few times. 3. Read the logs and find the bug. 4. Fix the bug, then I'll test again. UI issues are usually timing + state + sequence problems: "Clicked save twice in 400ms" "Reques

Continue reading on Dev.to Webdev

Opens in a new tab

Read Full Article
2 views

Related Articles