29

Check out our open-source, language-agnostic mutation testing tool using LLM agents here: https://github.com/codeintegrity-ai/mutahunter

Mutation testing is a way to verify the effectiveness of your test cases. It involves creating small changes, or “mutants,” in the code and checking if the test cases can catch these changes. Unlike line coverage, which only tells you how much of the code has been executed, mutation testing tells you how well it’s been tested. We all know line coverage is BS.

That’s where Mutahunter comes in. We leverage LLM models to inject context-aware faults into your codebase. As the first AI-based mutation testing tool, Mutahunter surpasses traditional “dumb” AST-based methods. Our AI-driven approach provides a full contextual understanding of the entire codebase, enabling it to identify and inject mutations that closely resemble real vulnerabilities. This ensures comprehensive and effective testing, significantly enhancing software security and quality.

We’ve added examples for JavaScript, Python, and Go (see /examples). It can theoretically work with any programming language that provides a coverage report in Cobertura XML format (more supported soon) and has a language grammar available in TreeSitter.

Check it out and let us know what you think! We’re excited to get feedback from the community and help developers everywhere improve their code quality.

top 8 comments
sorted by: hot top controversial new old
[-] dandi8@fedia.io 3 points 2 days ago* (last edited 2 days ago)

On the one hand, mutation testing is an important concept that more people should know about and use.

On the other, I fail to see how AI is helpful here, as mutation testing is an issue completely solvable by algorithms.

The need to use external LLMs like OpenAI is also a big no from me.

I think I'll stick to Pitest for my Java code.

[-] smeg@feddit.uk 5 points 2 days ago

Mutation testing is a cool concept, but what's it got to do with the fediverse?

[-] Gallardo994@sh.itjust.works 3 points 2 days ago* (last edited 2 days ago)

Mutahar after reading the name: I'm in danger

Mutahar after reading the description: phew

[-] wmrch@lemmy.world 1 points 2 days ago

So you're saying i have to write tests for my test cases now? Ooof.

[-] dandi8@fedia.io 2 points 2 days ago* (last edited 2 days ago)

Regarding mutation testing, you don't write any "tests for your test". Rather, a mutation testing tool automatically modifies ("mutates") your production code to see if the modification will be caught by any of your tests.

That way you can see how well your tests are written and how well-tested parts of your application are in general. Its extremely useful.

[-] yo_scottie_oh@lemmy.ml 1 points 2 days ago* (last edited 2 days ago)

Yo dawg, I heard you like tests, so I got some tests for your tests so you can test while you test!

[-] warmaster@lemmy.world 1 points 2 days ago

What's the use case? ELI5.

[-] Killing_Spark@feddit.de 3 points 2 days ago

You have written tests for your code and now feel safe because your code is tested. But test quality is really hard to measure. The idea seems to be to introduce "vulnerabilities" (whatever that means...) and see if your tests catch them. If they do that's supposed to show that the tests are good and vice versa.

this post was submitted on 27 Jun 2024
29 points (82.2% liked)

Fediverse

26737 readers
65 users here now

A community to talk about the Fediverse and all it's related services using ActivityPub (Mastodon, Lemmy, KBin, etc).

If you wanted to get help with moderating your own community then head over to !moderators@lemmy.world!

Rules

Learn more at these websites: Join The Fediverse Wiki, Fediverse.info, Wikipedia Page, The Federation Info (Stats), FediDB (Stats), Sub Rehab (Reddit Migration), Search Lemmy

founded 1 year ago
MODERATORS