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 :)

  • sugar_in_your_tea@sh.itjust.works
    link
    fedilink
    arrow-up
    2
    arrow-down
    1
    ·
    4 months ago

    Everyone should be unit testing their code regardless of what fiascos happen in the wild. Unit testing does a few important things:

    • reduce bugs if test quality is high
    • documents intended usage of APIs
    • communicates to users that the devs care about code quality

    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.

    • timetokey@programming.devOP
      link
      fedilink
      arrow-up
      1
      ·
      4 months ago

      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.