Skip to main content

LLM Mutation Testing for any programming language

Project description

  

Mutahunter

  Open-Source Language Agnostic LLM-based Mutation Testing      GitHub license   Unit Tests      GitHub   

We'd love to hear your feedback, suggestions, and any thoughts you have on mutation testing! 🙌

Getting Started with Mutation Testing

# Install Mutahunter package via GitHub. Python 3.11+ is required.
$ pip install https://github.com/codeintegrity-ai/mutahunter

# Work with GPT-4o on your repo
$ export OPENAI_API_KEY=your-key-goes-here

# Run Mutahunter on a specific file. 
$ 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"


2025-03-05 18:56:42,528 INFO: 'mvn clean test' - '/Users/taikorind/Desktop/mutahunter/examples/java_maven/logs/_latest/mutants/34a5d8a5_BankAccount.java'
2025-03-05 18:56:44,935 INFO: 🛡️ Mutant survived 🛡️

2025-03-05 18:56:44,936 INFO: 'mvn clean test' - '/Users/taikorind/Desktop/mutahunter/examples/java_maven/logs/_latest/mutants/183e6826_BankAccount.java'
2025-03-05 18:56:47,308 INFO: 🗡️ Mutant killed 🗡️

.  . . . .-. .-. . . . . . . .-. .-. .-.
|\/| | |  |  |-| |-| | | |\|  |  |-  |(
'  ` `-'  '  ` ' ' ` `-' ' `  '  `-' ' '

2024-07-29 12:31:22,045 INFO:
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

📊 Overall Mutation Coverage 📊
🎯 Mutation Coverage: 57.14% 🎯
🦠 Total Mutants: 7 🦠
🛡️ Survived Mutants: 3 🛡️
🗡️ Killed Mutants: 4 🗡️
🕒 Timeout Mutants: 0 🕒
🔥 Compile Error Mutants: 1 🔥
💰 Total Cost: $0.00060 USD 💰

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
2025-03-05 18:56:54,689 INFO: Mutation Testing Ended. Took 29s

Examples

Go to the examples directory to see how to run Mutahunter on different programming languages:

Check Java Example to see some interesting LLM-based mutation testing examples.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mutahunter-1.3.0.tar.gz (60.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mutahunter-1.3.0-py3-none-any.whl (53.9 kB view details)

Uploaded Python 3

File details

Details for the file mutahunter-1.3.0.tar.gz.

File metadata

  • Download URL: mutahunter-1.3.0.tar.gz
  • Upload date:
  • Size: 60.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.7

File hashes

Hashes for mutahunter-1.3.0.tar.gz
Algorithm Hash digest
SHA256 469429de0c58b7f19c2b00079b1462bbed7684f71342359a0402b171bc33df46
MD5 f37d158ece038540112428858a313177
BLAKE2b-256 62a71687245d65df0b3eb9c14f02c032d3744630d2f88b9983d6748f2e9dd956

See more details on using hashes here.

File details

Details for the file mutahunter-1.3.0-py3-none-any.whl.

File metadata

  • Download URL: mutahunter-1.3.0-py3-none-any.whl
  • Upload date:
  • Size: 53.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.7

File hashes

Hashes for mutahunter-1.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 92cb9008548688b4fc5f16431e95280aca92563ac54134347b87b4da2983fe73
MD5 635cf697dc606d7b56bd6ab315963562
BLAKE2b-256 cda2cfee16f66e1a49c54942737ae5d7707fee9366eff2bfda9723de90046e92

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page