Vidar

Vidar

How to measure AI code quality?

I’ve been trying to come up with a fairly real life representative way of evaluating code quality from AI, and by extension the functionality of skills and their setup, and the code checking utilities used.

Ideally there would be perfect real life scope code examples along with the prompts that should make them. And a variety for different problem spaces to make sure it is widely applicable. One could then setup a loop using the ideal prompts where

  1. The planning and implementing skills act according to the prompt.
  2. The review tools and review skill telling the plan and implementing skills what needs improvement in order to get closer to the code ideal.
  3. If/ when the planning and implementation skills get closer than the review tools can actively instruct then the review tools and skill should improve. Given the non-deterministic somewhat noisy nature of LLMs this cycle should gradually evolve towards the better.

Alas, for lack of real life scale ideal code examples with ideal prompts the best I have found so far is the Real Life Conduit which is a medium clone setup. It is just one data point, but it will give a certain objective feedback as it is fully external, made for testing purposes, and can tested online against their live API.

So that is the current plan. Give a short prompt without much technical guidance, and let Claude sort it out or fail horribly. To what extent will be some kind of metric I suppose? So I’m thinking: 1. Going blind 1 shot from the prompt and directly to test against the API. 2. Going blind 1 shot, but before testing against the API use code review tools and the review skills and have Claude ‘use tools and review skill and fix any and all issues’. And then test.

I think it is also interesting to repeat that with Claude on lower thinking modes. Given enough skills guidance, and or with automated code check and fix after, maybe a lower level thinking or lower level model will be make quality output? In that case good skills and review tools would be cost and token saving, which I would appreciate a lot.

Anyway, ideas for good functional metrics are welcome?

Most Liked

jdiago

jdiago

Code quality is code quality. Doesn’t matter who or what wrote it.

dimitarvp

dimitarvp

I have zero idea but – really good question.

I’d start with “less coding lines”. LLMs are master bullsh1tters and will spit out 1000 lines of code when I, given the time, can very likely write 250 and even have the code be more understandable and nicer to work with.

mudasobwa

mudasobwa

Creator of Cure

Validating the quality of the code, produced by the very sophisticated code completion tool with another code completion tool always looked silly to me. That’s why I extensively developed static code analysis and linter tools in the last several month.

Additional credo checks helped me to catch stuff several times → OeditusCredo v0.8.1 — Documentation

Literally last week I caught and broke the huge compile-connected mega-cycle (459 nodes) with Ragex.

Old good static analysis works with the code on the level, LLM could never ever achieve, that’s why.

Where Next?

Popular in AI / LLMs Top

Vidar
This morning I set out to make an Elixir library for internal use of some specific statistical method that only seemed to exist in some P...
#ai
New
nathanl
This isn’t an Elixir library, but if you’re testing with phoenix_test_playwright | Hex , you might like a new tool I recently made. When...
New
ricksonoliveira
Hey folks, I have been looking for an alternative to good old VsCode for a while. Have tried some vim and emacs editors with their plugi...
New
AstonJ
What kind of impact do you think AI will have on programming/tech jobs? Have you or anyone you know been impacted directly? Does it conce...
New
borag
I shared an Elixir Architect skill for Claude Code which proves that Elixir is the best LLM friendly language (@josevalim ) https://git...
New
DaAnalyst
Exactly. A bit off topic, but I think the issue with the machines is they don’t bear any consequences. And even if they did one day, the...
New
nbw
This is an open discussion to anyone using AI to help them work with Elixir in production-ready apps. I work on an Elixir app at work th...
#ai
New
Vidar
I’ve been trying to come up with a fairly real life representative way of evaluating code quality from AI, and by extension the functiona...
New
Exadra37
:tada: My last project is now live: AI Intent Driven Development (IDD) guidelines and instructions for AI Coding Agents, AI Coding Assist...
New
SyntaxSorcerer
I found Elixir after a friend recommended looking into it for developing a multi-agent orchestration and task management system. Soon aft...
New

Other popular topics Top

marius95
Hello everyone, I try to use an Javascript Event Handler in my root.html.leex file. Therefore I created a function in the app.js file: ...
New
mcarvalho
What is the difference between System.get_env and Application.get_env? For example, what are best practices to use one versus another.
New
electic
Hi, I am new to Elixir. I am trying to use the DateTime component to insert a date into MySQL however the there seems to be no way to fo...
New
shahryarjb
Hello, I have map which I want to convert it to string like this: the map: %{last_name: "tavakkoli", name: "shahryar"} the string I ne...
New
hariharasudhan94
lets say i have a sample like a = 20; b = 10; if (a > b) do {:ok, "a"} end if (a < b) do {:ok, b} end if (a == b) do {:ok, "equa...
New
dokuzbir
I want to highlight html closing tags when i click a html tag. That works in .html files but doesnt work for html.eex templates. How can...
New
vegabook
I’m brand new to Phoenix and I have stripped one of the demo applications to the bone. I just want to get an svg up on the screen. Here i...
New
sergio_101
I am VERY much an elixir newbie. I have taken one elixir course and one phoenix course on Udemy. During that course, I saw the instructor...
New
saif
Hello everyone, Long time lurker first time poster here. I’ve recently begun working on Elixir full-time again! :raised_hands: It’s been...
New
dblack
I’ve got an issue with an app and I’ve no idea of how to troubleshoot it. I’m hoping someone here might have seen something similar. I p...
New

We're in Beta

About us Mission Statement