Hey Community, I figured that I could strengthen existing automated unit test generation quality by integrating mutation testing results as a metric to determine the quality of my unit tests. Figured everyone should be unit testing their code now especially after the recent Crowdstrike fiasco.
Check it out here https://github.com/codeintegrity-ai/mutahunter
Please star if you like it :)
Everyone should be unit testing their code regardless of what fiascos happen in the wild. Unit testing does a few important things:
Using LLMs to do this is lazy imo, and I’m worried a lot of the tests will be useless. Take the time to write good unit tests because you care about the above, not because you want to see some number go up (e.g. test coverage). Using an LLM to generate tests sounds too much like coverage for the sake of coverage.
I’d prefer to go the opposite route: use LLMs to write code and manually write tests to prove correctness. Imo, good unit tests are more important than good code.
So using LLMS to blindly generate unit tests in lazy, pretty much any codgen tool can do this, the point of Mutahunter is we back the unit test generation with mutation testing data. Mutation testing catches vulnerabilities in your code and we generate test cases to target those vulnerabilities. So arguably Mutahunter would write more rigorous unit tests than any developer on your team.
There are plenty of fuzzing libraries available.
There are plenty of fish in the ocean too…