README.md

March 6, 2025 ยท View on GitHub

Mutahunter

Open-Source Language Agnostic LLM-based Mutation Testing

GitHub license Unit Tests Last Commit

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.