mutahunter  by codeintegrity-ai

CLI tool for LLM-based mutation testing

created 1 year ago
276 stars

Top 94.7% on sourcepulse

GitHubView on GitHub
Project Summary

Mutahunter offers an open-source, language-agnostic approach to mutation testing powered by Large Language Models (LLMs). It aims to improve software quality by automatically generating code variations (mutants) and assessing the effectiveness of existing test suites. This tool is designed for developers and QA engineers seeking to enhance their test coverage and identify weaknesses in their testing strategies.

How It Works

Mutahunter leverages LLMs, specifically models like GPT-4o, to generate code mutants. It then executes the project's test suite against these mutants. The core advantage lies in its LLM-driven mutation generation, which can potentially create more semantically relevant and challenging mutants compared to traditional syntactic mutation operators. This approach aims for higher mutation scores and more robust test suites.

Quick Start & Requirements

  • Install via pip: pip install https://github.com/codeintegrity-ai/mutahunter
  • Requires Python 3.11+ and an OpenAI API key (export OPENAI_API_KEY=your-key-goes-here).
  • Example run command: mutahunter run --test-command "mvn clean test" --model "gpt-4o-mini" --source-path "src/main/java/com/example/BankAccount.java" --test-path "src/test/java/BankAccountTest.java"
  • Official examples are available in the repository's examples directory.

Highlighted Details

  • Language-agnostic mutation testing.
  • Utilizes LLMs (e.g., GPT-4o) for mutant generation.
  • Provides detailed reports on mutation coverage, survived/killed mutants, and cost.
  • Demonstrates a 57.14% mutation coverage on a Java example with 7 total mutants.

Maintenance & Community

No specific details on contributors, sponsorships, or community channels (like Discord/Slack) are provided in the README.

Licensing & Compatibility

The repository does not explicitly state a license in the provided README.

Limitations & Caveats

The tool relies on external LLM APIs, which may incur costs and introduce latency. The effectiveness and quality of generated mutants are dependent on the chosen LLM. The README does not detail compatibility with specific testing frameworks beyond the Maven example.

Health Check
Last commit

3 months ago

Responsiveness

1 week

Pull Requests (30d)
0
Issues (30d)
0
Star History
6 stars in the last 90 days

Explore Similar Projects

Starred by Andrej Karpathy Andrej Karpathy(Founder of Eureka Labs; Formerly at Tesla, OpenAI; Author of CS 231n), Patrick von Platen Patrick von Platen(Core Contributor to Hugging Face Transformers and Diffusers), and
4 more.

yet-another-applied-llm-benchmark by carlini

0.2%
1k
LLM benchmark for evaluating models on previously asked programming questions
created 1 year ago
updated 3 months ago
Starred by Elie Bursztein Elie Bursztein(Cybersecurity Lead at Google DeepMind), Chip Huyen Chip Huyen(Author of AI Engineering, Designing Machine Learning Systems), and
1 more.

oss-fuzz-gen by google

0.3%
1k
LLM-powered fuzz target generator for C/C++/Java/Python projects, benchmarked via OSS-Fuzz
created 1 year ago
updated 1 week ago
Feedback? Help us improve.